Statistical Modelling 23 (2) (2023), 107–126

Detecting bearish and bullish markets in financial time series using hierarchical hidden Markov models

Lennart Oehlschläger
Department of Business Administration and Economics,
Bielefeld University,
Universitätsstrasse 25,
33615 Bielefeld,
Germany.
e-mail: lennart.oelschlaeger@uni-bielefeld.de

Timo Adam,
School of Mathematics and Statistics,
University of St Andrews,
St Andrews,
United Kingdom.

Abstract:

Financial markets exhibit alternating periods of rising and falling prices. Stock traders seeking to make profitable investment decisions have to account for those trends, where the goal is to accurately predict switches from bullish to bearish markets and vice versa. Popular tools for modeling financial time series are hidden Markov models, where a latent state process is used to explicitly model switches among different market regimes. In their basic form, however, hidden Markov models are not capable of capturing both short- and long-term trends, which can lead to a misinterpretation of short-term price fluctuations as changes in the long-term trend. In this paper, we demonstrate how hierarchical hidden Markov models can be used to draw a comprehensive picture of market behavior, which can contribute to the development of more sophisticated trading strategies. The feasibility of the suggested approach is illustrated in two real-data applications, where we model data from the Deutscher Aktienindex and the Deutsche Bank stock. The proposed methodology is implemented in the R package fHMM, which is available on CRAN.

Keywords:

Decoding market behaviour, hidden Markov models, state-space models, temporal resolution, time series modelling

Downloads:

Code and data: R package fHMM


back