Skip to content

Commit

Permalink
added reference to README
Browse files Browse the repository at this point in the history
  • Loading branch information
loelschlaeger committed May 28, 2024
1 parent ea2e602 commit 783b271
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 7 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ Authors@R: c(
comment = c(ORCID = "0000-0002-5433-6197")))
Description: Fitting (hierarchical) hidden Markov models to financial data
via maximum likelihood estimation. See Oelschläger, L. and Adam, T.
"Detecting bearish and bullish markets in financial time series using
hierarchical hidden Markov models" (2021, Statistical Modelling)
"Detecting Bearish and Bullish Markets in Financial Time Series Using
Hierarchical Hidden Markov Models" (2021, Statistical Modelling)
<doi:10.1177/1471082X211034048> for a reference on the method. A user guide
is provided by the accompanying software paper "fHMM: Hidden Markov Models
for Financial Time Series in R", Oelschläger, L., Adam, T., and Michels, R.
Expand Down
10 changes: 8 additions & 2 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,15 @@ data <- model$data
[![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html#stable)
<!-- badges: end -->

The `{fHMM}` R package allows for the detection and characterization of financial market regimes in time series data by applying hidden Markov Models (HMMs). The [vignettes](https://loelschlaeger.de/fHMM/articles/) outline the package functionality and the model formulation. For a reference on the method, see
The `{fHMM}` R package allows for the detection and characterization of financial market regimes in time series data by applying hidden Markov Models (HMMs). The [vignettes](https://loelschlaeger.de/fHMM/articles/) outline the package functionality and the model formulation.

> Oelschläger, L., and T. Adam. 2021. “Detecting Bearish and Bullish Markets in Financial Time Series Using Hierarchical Hidden Markov Models.” Statistical Modelling. https://doi.org/10.1177/1471082X211034048
For a reference on the method, see:

> Oelschläger, L., and Adam, T. 2021. "Detecting Bearish and Bullish Markets in Financial Time Series Using Hierarchical Hidden Markov Models." Statistical Modelling. https://doi.org/10.1177/1471082X211034048
A user guide is provided by the accompanying software paper:

> Oelschläger, L., Adam, T., and Michels, R. 2024. "fHMM: Hidden Markov Models for Financial Time Series in R". Journal of Statistical Software. https://doi.org/10.18637/jss.v109.i09
Below, we illustrate an application to the German stock index [DAX](https://en.wikipedia.org/wiki/DAX). We also show how to use the package to simulate HMM data, compute the model likelihood, and decode the hidden states using the Viterbi algorithm.

Expand Down
31 changes: 28 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,21 @@ stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://
The `{fHMM}` R package allows for the detection and characterization of
financial market regimes in time series data by applying hidden Markov
Models (HMMs). The [vignettes](https://loelschlaeger.de/fHMM/articles/)
outline the package functionality and the model formulation. For a
reference on the method, see
outline the package functionality and the model formulation.

> Oelschläger, L., and T. Adam. 2021. “Detecting Bearish and Bullish
For a reference on the method, see:

> Oelschläger, L., and Adam, T. 2021. “Detecting Bearish and Bullish
> Markets in Financial Time Series Using Hierarchical Hidden Markov
> Models.” Statistical Modelling.
> <https://doi.org/10.1177/1471082X211034048>
A user guide is provided by the accompanying software paper:

> Oelschläger, L., Adam, T., and Michels, R. 2024. “fHMM: Hidden Markov
> Models for Financial Time Series in R”. Journal of Statistical
> Software. <https://doi.org/10.18637/jss.v109.i09>
Below, we illustrate an application to the German stock index
[DAX](https://en.wikipedia.org/wiki/DAX). We also show how to use the
package to simulate HMM data, compute the model likelihood, and decode
Expand Down Expand Up @@ -238,6 +245,9 @@ exponential link).
``` r
ll_hmm(parUncon, sim$data, controls)
#> [1] -1620.515
```

``` r
ll_hmm(parUncon, sim$data, controls, negative = TRUE)
#> [1] 1620.515
```
Expand Down Expand Up @@ -267,21 +277,36 @@ par$Gamma
#> state_1 state_2
#> state_1 0.95 0.05
#> state_2 0.05 0.95
```

``` r
estimate$Gamma
#> state_1 state_2
#> state_1 0.96895127 0.03104873
#> state_2 0.03037199 0.96962801
```

``` r

par$mu
#> muCon_1 muCon_2
#> 1 3
```

``` r
estimate$mu
#> muCon_1 muCon_2
#> 1.061835 2.899473
```

``` r

par$sigma
#> sigmaCon_1 sigmaCon_2
#> 1 3
```

``` r
estimate$sigma
#> sigmaCon_1 sigmaCon_2
#> 1.122073 2.943097
Expand Down

0 comments on commit 783b271

Please sign in to comment.