fHMM: Hidden Markov Models for Financial Time Series in R
Authors:
Open Access
- 1 January 2024
- journal article
- research article
- Published by Foundation for Open Access Statistic
- Vol. 109 (9) , 1-25
Abstract
Hidden Markov models constitute a versatile class of statistical models for time series that are driven by hidden states. In financial applications, the hidden states can often be linked to market regimes such as bearish and bullish markets or recessions and periods of economics growth. To give an example, when the market is in a nervous state, corresponding stock returns often follow some distribution with relatively high variance, whereas calm periods are often characterized by a different distribution with relatively smaller variance. Hidden Markov models can be used to explicitly model the distribution of the observations conditional on the hidden states and the transitions between states, and thus help us to draw a comprehensive picture of market behavior. While various implementations of hidden Markov models are available, a comprehensive R package that is tailored to financial applications is still lacking. In this paper, we introduce the R package fHMM, which provides various tools for applying hidden Markov models to financial time series. It contains functions for fitting hidden Markov models to data, conducting simulation experiments, and decoding the hidden state sequence. Furthermore, functions for model checking, model selection, and state prediction are provided. In addition to basic hidden Markov models, hierarchical hidden Markov models are implemented, which can be used to jointly model multiple data streams that were observed at different temporal resolutions. The aim of the fHMM package is to give R users with an interest in financial applications access to hidden Markov models and their extensions.Keywords
This publication has 17 references indexed in Scilit:
- Gradient boosting in Markov-switching generalized additive models for location, scale, and shapeEconometrics and Statistics, 2022
- momentuHMM: R package for generalized hidden Markov models of animal movementMethods in Ecology and Evolution, 2018
- Dynamic portfolio optimization across hidden market regimesQuantitative Finance, 2017
- Selecting the Number of States in Hidden Markov Models: Pragmatic Solutions Illustrated Using Animal MovementJournal of Agricultural, Biological and Environmental Statistics, 2017
- moveHMM: an R package for the statistical modelling of animal movement data using hidden Markov modelsMethods in Ecology and Evolution, 2016
- Stylised facts of financial time series and hidden Markov models in continuous timeQuantitative Finance, 2014
- Markov-switching asset allocation: Do profitable strategies exist?Journal of Asset Management, 2011
- hsmm — An R package for analyzing hidden semi-Markov modelsComputational Statistics & Data Analysis, 2010
- Empirical Evidence on Student-tLog-Returns of Diversified World Stock IndicesJournal of Statistical Theory and Practice, 2008
- Stylized facts of financial time series and hidden semi-Markov modelsComputational Statistics & Data Analysis, 2006