Skip to main content

Stock Price Prediction with Fluctuation Patterns Using Indexing Dynamic Time Warping and \(k^*\)-Nearest Neighbors

  • Conference paper
  • First Online:
New Frontiers in Artificial Intelligence (JSAI-isAI 2017)

Part of the book series: Lecture Notes in Computer Science ((LNAI,volume 10838))

Included in the following conference series:

Abstract

Various methods to predict stock prices have been studied. A typical method is based on time-series analysis; other methods are based on machine-learning techniques using cross-sectional data as feature values. In the field of empirical finance, feature values for prediction include “momentum”. The momentum strategy is simply based on past prices. Following the nearest trend, we buy current performers. From the different viewpoint from momentum, We’d like to challenge EMH. Our proposed method is following the similar trend. In other word, we look for past pattern similar to the current and predict from that. When predicting stock prices, investors sometimes refer to past markets that are similar to the current market. In this research, we propose a method to predict future stock prices with the past fluctuations similar to the current. As the levels of stock prices differ depending on the measured period, we develop a scaling method to compensate for the difference of price levels and the proposed new method; specifically, we propose indexing dynamic time warping (IDTW) to evaluate the similarities between time-series data. We apply the \(k^*\)-nearest neighbor algorithm with IDTW to predict stock prices for major stock indices and to assist users in making informed investment decisions. To demonstrate the advantages of the proposed method, we analyze its performance using major world indices. Experimental results show that the proposed method is more effective for predicting monthly stock price changes than other methods proposed by previous studies (Based on the comments received in Ai-Biz 2017, we clarified the differences from previous studies. And we added economic discussions about our proposed method such as differences from “momentum”, a challenge to Efficient Market Hypothesis and meanings as investment behavior).

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

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    Volatility clustering is a phenomenon by which a period of high (low) volatility continues for some time after the volatility rises (decreases) [19].

  2. 2.

    The ticker codes are TPX Index, SPX Index, UKX Index, DAX Index, and CAC Index, respectively.

  3. 3.

    The parameter k ranged from 1 to 10 and parameter \(L/C\in \{0.001,0.005,0.01,0.05,0.1,0.5,1,5,10 \}\). These are the same setting as Anava and Levy [1].

References

  1. Anava, O., Levy, K.: \(k^*\)-nearest neighbors: from global to local. In: Advances in Neural Information Processing Systems, pp. 4916–4924 (2016)

    Google Scholar 

  2. Andrade, S.C., Chhaochharia, V., Fuerst, M.E.: “Sell in may and go away” just won’t go away. Finan. Anal. J. 69(4), 94 (2013)

    Article  Google Scholar 

  3. Asness, C.S., Moskowitz, T.J., Pedersen, L.H.: Value and momentum everywhere. J. Finan. 68(3), 929–985 (2013)

    Article  Google Scholar 

  4. Bergmeir, C., Benítez, J.M.: On the use of cross-validation for time series predictor evaluation. Inf. Sci. 191, 192–213 (2012)

    Article  Google Scholar 

  5. Bollerslev, T.: Generalized autoregressive conditional heteroskedasticity. J. Econom. 31(3), 307–327 (1986)

    Article  MathSciNet  Google Scholar 

  6. Bouman, S., Jacobsen, B.: The halloween indicator, “sell in may and go away”: another puzzle. Am. Econ. Rev. 92(5), 1618–1635 (2002)

    Article  Google Scholar 

  7. Box, G.E., Jenkins, G.M., Reinsel, G.C., Ljung, G.M.: Time Series Analysis: Forecasting and Control. Wiley, Hoboken (2015)

    MATH  Google Scholar 

  8. Cavalcante, R.C., Brasileiro, R.C., Souza, V.L., Nobrega, J.P., Oliveira, A.L.: Computational intelligence and financial markets: a survey and future directions. Expert Syst. Appl. 55, 194–211 (2016)

    Article  Google Scholar 

  9. Coelho, M.S.: Patterns in financial markets: dynamic time warping. Ph.D. thesis, NSBE-UNL (2012)

    Google Scholar 

  10. Fama, E.F.: Efficient capital markets: a review of theory and empirical work. J. Finan. 25(2), 383–417 (1970)

    Article  Google Scholar 

  11. Fama, E.F., French, K.R.: The cross-section of expected stock returns. J. Finan. 47(2), 427–465 (1992)

    Article  Google Scholar 

  12. Fama, E.F., French, K.R.: Common risk factors in the returns on stocks and bonds. J. Financ. Econ. 33(1), 3–56 (1993)

    Article  Google Scholar 

  13. Hamilton, J.D.: Time Series Analysis, vol. 2. Princeton University Press, Princeton (1994)

    Book  Google Scholar 

  14. Imamura, M., Nakagawa, K., Yoshida, K.: Evaluation of financial market forecasting with using similarity of asset price fluctuation patterns (in Japanese). In: The 31st Annual Conference of the Japanese Society for Artificial Intelligence, p. 2D1-2 (2017)

    Google Scholar 

  15. Itakura, F.: Minimum prediction residual principle applied to speech recognition. IEEE Trans. Acoust. Speech Sig. Process. 23(1), 67–72 (1975)

    Article  Google Scholar 

  16. Jegadeesh, N., Titman, S.: Returns to buying winners and selling losers: implications for stock market efficiency. J. Finan. 48(1), 65–91 (1993)

    Article  Google Scholar 

  17. Keogh, E.J., Pazzani, M.J.: Scaling up dynamic time warping for datamining applications. In: Proceedings of the Sixth ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pp. 285–289. ACM (2000)

    Google Scholar 

  18. Kuramoto, T., Izumi, K., Yoshimura, S., Ishida, T., Nakashima, A., Matsui, T., Yoshida, M., Nakagawa, H.: Analysis of long-term market trend by text-mining of news articles (in Janapnese). Trans. Jpn. Soc. Artif. Intell. 28(3), 291–296 (2013)

    Article  Google Scholar 

  19. Mandelbrot, B.: The variation of certain speculative prices. J. Bus. 36(4), 394–419 (1963)

    Article  Google Scholar 

  20. Nakagawa, K., Imamura, M., Yoshida, K.: Stock price prediction using similarity of stock price fluctuation patterns (in Japanese). In: The 31st Annual Conference of the Japanese Society for Artificial Intelligence, p. 2D1-1 (2017)

    Google Scholar 

  21. Stone, M.: Cross-validatory choice and assessment of statistical predictions. J. R. Stat. Soc. Ser. B (Methodol.) 36, 111–147 (1974)

    MathSciNet  MATH  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Kei Nakagawa .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2018 Springer International Publishing AG, part of Springer Nature

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Nakagawa, K., Imamura, M., Yoshida, K. (2018). Stock Price Prediction with Fluctuation Patterns Using Indexing Dynamic Time Warping and \(k^*\)-Nearest Neighbors. In: Arai, S., Kojima, K., Mineshima, K., Bekki, D., Satoh, K., Ohta, Y. (eds) New Frontiers in Artificial Intelligence. JSAI-isAI 2017. Lecture Notes in Computer Science(), vol 10838. Springer, Cham. https://doi.org/10.1007/978-3-319-93794-6_7

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-93794-6_7

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-93793-9

  • Online ISBN: 978-3-319-93794-6

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics