Prediction of Financial Time Series Using Hidden Markov Models
Lev Brailovskiy, Maya Herman · 2014
Hidden Markov Models (HMM) is a powerful machine learning model. HMM’s main usage has been in solving classification and pattern recognition problems in biology, speech and voice recognition. In recent days, attempts have been made to use HMM for prediction in general and prediction of time series in particular. However, this is not straightforward. To overcome the challenges in predicting time series with HMM some hybrid approaches have been applied. This paper has two main objectives. The first, is to compare HMM with other models when used for prediction of financial time series. We will show comparison between HMM and other models and also between different types of HMM’s as unique contribution of this work. In recent years, prediction of stock market behavior became a field of great interest to many scientists. Hence, as a case study, we will use our implementation and examine HMM with Multivariate Normal Distribution and Gaussian Mixture Model in hidden states. We use nearest likelihood prediction algorithm and compare results with MAPE. As training dataset, we will use some popular stock from NASDAQ and S&P500 indexes historical data. The second, is to showcase a working system with generic HMM, advanced training and prediction algorithms implementation in C#. All the code is open sourced as contribution to the community. The system allows researchers from different disciplines to use HMM and other models to solve classification, pattern recognition and prediction on various series represented by k-dimensional vectors arrays and a way to compare and reuse the models under test.