fHMM: Hidden Markov Models for Financial Time Series in R
Dublin Core
Title
fHMM: Hidden Markov Models for Financial Time Series in R
Subject
hidden Markov models, hierarchical hidden Markov models, regime switching,
financial time series, decoding market behavior, R.
financial time series, decoding market behavior, R.
Description
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.
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.
Creator
Lennart Oelschläger
Source
https://www.jstatsoft.org/article/view/v109i09
Publisher
Bielefeld University
Date
May 2024
Contributor
Fajar bagus W
Format
PDF
Language
English
Type
Text
Files
Collection
Citation
Lennart Oelschläger
, “fHMM: Hidden Markov Models for Financial Time Series in R,” Repository Horizon University Indonesia, accessed April 4, 2025, https://repository.horizon.ac.id/items/show/8334.