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

  • David MoskowitzEmail author


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.


Genetic programming Time series prediction Software design patterns Modularity 


  1. 1.
    J.R. Koza, Genetic Programming: On the Programming of Computers by Means of Natural Selection, vol. 1 (MIT press, Cambridge, 1992)zbMATHGoogle Scholar
  2. 2.
    J.R. Koza, Genetic Programming II: Automatic Discovery of Reusable Programs (MIT press, Cambridge, 1994)zbMATHGoogle Scholar
  3. 3.
    P. Angeline, Genetic programming and emergent intelligence. Adv. Genet. Program. 1, 75–98 (1994)Google Scholar
  4. 4.
    T. Yu, C. Clack, Recursion, lambda-abstractions and genetic programming. Cogn. Sci. Res. Pap. Birm. 22, 26–30 (1998)Google Scholar
  5. 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–263CrossRefGoogle Scholar
  6. 6.
    E. Gamma, R. Helm, R. Johnson, J. Vlissides, Design Patterns: Elements of Reusable Object-Oriented Software (Addison-Wesley, Reading, 1995)zbMATHGoogle Scholar
  7. 7.
    J.G. De Gooijer, R.J. Hyndman, 25 years of time series forecasting. Int. J. Forecast. 22(3), 443–473 (2006)CrossRefGoogle Scholar
  8. 8.
    S. Li, R. Lund, Multiple changepoint detection via genetic algorithms. J. Clim. 25(2), 674–686 (2012)CrossRefGoogle Scholar
  9. 9.
    M. Srinivas, L.M. Patnaik, Genetic algorithms: a survey. Computer (Long. Beach. Calif) 27(6), 17–26 (1994)Google Scholar
  10. 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)Google Scholar
  11. 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)Google Scholar
  12. 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)CrossRefGoogle Scholar
  13. 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)CrossRefGoogle Scholar
  14. 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)Google Scholar
  15. 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)Google Scholar
  16. 16.
    D.C. Schmidt, M. Fayad, R.E. Johnson, Software patterns. Commun. ACM 39(10), 37–39 (1996)CrossRefGoogle Scholar
  17. 17.
    C. Brooks, Introductory Econometrics for Finance [Kindle Version], Third Edit (Cambridge University Press, Cambridge, 2014)Google Scholar
  18. 18.
    N. Wagner, Time Series Forecasting for Non-static Environments: The DyFor Genetic Program Model, the University of North Carolina at Charlotte (2005)Google Scholar
  19. 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)Google Scholar
  20. 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–154Google Scholar
  21. 21.
    R. Poli, W. B. Langdon, N. F. McPhee, J. R. Koza, A Field Guide to Genetic Programming. (2008)Google Scholar
  22. 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)zbMATHGoogle Scholar
  23. 23.
    J.R. Koza, Human-competitive results produced by genetic programming. Genet. Program Evolvable Mach. 11(3–4), 251–284 (2010)CrossRefGoogle Scholar

Copyright information

© Springer Science+Business Media, LLC, part of Springer Nature 2018

Authors and Affiliations

  1. 1.Infoblazer, LLCStamfordUnited States
  2. 2.Nova Southeastern UniversityFort LauderdaleUnited States

Personalised recommendations