Skip to main content
Log in

Implementing the template method pattern in genetic programming for improved time series prediction

  • Published:
Genetic Programming and Evolvable Machines Aims and scope Submit manuscript

Abstract

Modularity is an ongoing focus in genetic programming research. Enhanced modularity can accelerate solution convergence and increase human understanding and knowledge gained from evolved programs. Prior advances in modularity research have addressed programming language elements such as functions, modules, and recursion. This paper proposes improving modularity by considering non-language elements, specifically software design patterns. A new genetic programming technique implementing the template method pattern is described. This technique was tested and compared to existing genetic programming approaches in the prediction of nonlinear time series subject to abrupt changes in the underlying data generation process. Such series are often seen in areas such as finance and meteorology and have proved challenging for genetic programming to model and predict. Experimental results demonstrate the potential for incorporating additional software design patterns into genetic programming and applying these techniques to additional problem domains.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Institutional subscriptions

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9
Fig. 10
Fig. 11
Fig. 12
Fig. 13
Fig. 14
Fig. 15

Similar content being viewed by others

Notes

  1. [2] discusses dynamically determining ADF parameters and is a more detailed treatment of the subject.

  2. Regime detection programs are also referred to as regime indicator groups.

  3. The super parent approach described in Sect. 3.1.1 can facilitate rank-based selection.

  4. The latter approach was used in the experiments in this paper. The choice of approaches is potentially domain specific, so no recommendation is given at this time.

  5. N is typically between 2 and 4.

  6. SINCOS is the only one of the three experimental series discussed that is not based on prior research.

  7. These series are referred to as LG–OZ–LG and MG–HEN–MG in [19]. This paper uses the abbreviations LGOZLG and MGHENMG, as the two sets of series may not match exactly.

  8. The population control features incorporated into DyFor GP are described in [12].

  9. LGOZLG tests were run using values 1-100 for training. MGHENMG tests were run using values 31–130 as the training period as the values depend on up to 30 lagged values. It is not clear if the benchmark also adjusted the training range. It is unlikely the difference significantly affects the results either way.

  10. The determined regime was analyzed only in the best performing runs. There is no way to average out regime determination over all sets of runs.

References

  1. J.R. Koza, Genetic Programming: On the Programming of Computers by Means of Natural Selection, vol. 1 (MIT press, Cambridge, 1992)

    MATH  Google Scholar 

  2. J.R. Koza, Genetic Programming II: Automatic Discovery of Reusable Programs (MIT press, Cambridge, 1994)

    MATH  Google Scholar 

  3. P. Angeline, Genetic programming and emergent intelligence. Adv. Genet. Program. 1, 75–98 (1994)

    Google Scholar 

  4. T. Yu, C. Clack, Recursion, lambda-abstractions and genetic programming. Cogn. Sci. Res. Pap. Birm. 22, 26–30 (1998)

    Google Scholar 

  5. J.R. Woodward, Modularity in genetic programming, in Genetic Programming, No. Theorem 2, ed. by C. Ryan, T. Soule, M. Keijzer, E. Tsang, R. Poli, E. Costa (Springer, Berlin, 2003), pp. 254–263

    Chapter  Google Scholar 

  6. E. Gamma, R. Helm, R. Johnson, J. Vlissides, Design Patterns: Elements of Reusable Object-Oriented Software (Addison-Wesley, Reading, 1995)

    MATH  Google Scholar 

  7. J.G. De Gooijer, R.J. Hyndman, 25 years of time series forecasting. Int. J. Forecast. 22(3), 443–473 (2006)

    Article  Google Scholar 

  8. S. Li, R. Lund, Multiple changepoint detection via genetic algorithms. J. Clim. 25(2), 674–686 (2012)

    Article  Google Scholar 

  9. M. Srinivas, L.M. Patnaik, Genetic algorithms: a survey. Computer (Long. Beach. Calif) 27(6), 17–26 (1994)

    Google Scholar 

  10. B. Mulloy, R. Riolo, R. Savit, Dynamics of genetic programming and chaotic time series prediction, in Proceedings of the First Annual Conference on Genetic Programming, pp. 166–174 (1996)

  11. M. A. Kaboudan, A GP approach to distinguish chaotic from noisy signals, in Genetic Programming 1998: Proceedings of the Third Annual Conference, pp. 187–191 (1998)

  12. N. Wagner, Z. Michalewicz, M. Khouja, R.R. McGregor, Time series forecasting for dynamic environments: the DyFor genetic program model. IEEE Trans. Evol. Comput. 11(4), 433–452 (2007)

    Article  Google Scholar 

  13. M. O’Neill, L. Vanneschi, S. Gustafson, W. Banzhaf, Open issues in genetic programming. Genet. Program Evolvable Mach. 11(3–4), 339–363 (2010)

    Article  Google Scholar 

  14. P. Angeline, J. Pollack, The evolutionary induction of subroutines, in Proceedings of the Fourteenth Annual Conference of the Cognitive Science Society, pp. 236–241 (1992)

  15. L. Spector, Evolving control structures with automatically defined macros, in Working Notes of the AAAI Fall Symposium on Genetic Programming, The American Association for Artificial Intelligence, pp. 99–105 (1995)

  16. D.C. Schmidt, M. Fayad, R.E. Johnson, Software patterns. Commun. ACM 39(10), 37–39 (1996)

    Article  Google Scholar 

  17. C. Brooks, Introductory Econometrics for Finance [Kindle Version], Third Edit (Cambridge University Press, Cambridge, 2014)

    Google Scholar 

  18. N. Wagner, Time Series Forecasting for Non-static Environments: The DyFor Genetic Program Model, the University of North Carolina at Charlotte (2005)

  19. N. Wagner, Z. Michalewicz, An analysis of adaptive windowing for time series forecasting in dynamic environments: further tests of the DyFor GP model, in Proceedings of the 10th Annual Conference on Genetic and Evolutionary Computation, pp. 1657–1664 (2008)

  20. S.H. Chen, T.W. Kuo, K.M. Hoi, Genetic Programming and Financial Trading: How Much About ‘What We Know’, in Handbook of Financial Engineering (Springer, Berlin, 2008), pp. 99–154

    Google Scholar 

  21. R. Poli, W. B. Langdon, N. F. McPhee, J. R. Koza, A Field Guide to Genetic Programming. Lulu.com (2008)

  22. J. Koza, M.A. Keane, M.J. Streeter, W. Mydlowec, J. Yu, G. Lanza, Genetic Programming IV: Routine Human-Competitive Machine Intelligence, vol. 5 (Springer, Berlin, 2006)

    MATH  Google Scholar 

  23. J.R. Koza, Human-competitive results produced by genetic programming. Genet. Program Evolvable Mach. 11(3–4), 251–284 (2010)

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to David Moskowitz.

Appendix

Appendix

Table 13 lists the random parameters used in the creation of the MGHENMG series.

Table 13 MGHENMG random initialization parameters

The full data sets, executable binaries, and parameter files from the experiments described in this report are available at http://www.infoblazer.com/geneticprogramming. Source code is also provided in a GitHub repository.

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Moskowitz, D. Implementing the template method pattern in genetic programming for improved time series prediction. Genet Program Evolvable Mach 19, 271–299 (2018). https://doi.org/10.1007/s10710-018-9320-9

Download citation

  • Received:

  • Revised:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s10710-018-9320-9

Keywords

Navigation