https://github.com/luisdamiano/rfinance17
Presentation and notebook for the lightning talk A Quick Intro to Hidden Markov Models Applied to Stock Volatility presented in R/Finance 2017.
https://github.com/luisdamiano/rfinance17
finance hidden-markov-model machine-learning rfinance statistics stock-market volatility
Last synced: 4 months ago
JSON representation
Presentation and notebook for the lightning talk A Quick Intro to Hidden Markov Models Applied to Stock Volatility presented in R/Finance 2017.
- Host: GitHub
- URL: https://github.com/luisdamiano/rfinance17
- Owner: luisdamiano
- License: cc-by-sa-4.0
- Created: 2017-05-17T23:32:04.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-05-18T01:07:53.000Z (about 9 years ago)
- Last Synced: 2025-01-21T13:25:14.474Z (over 1 year ago)
- Topics: finance, hidden-markov-model, machine-learning, rfinance, statistics, stock-market, volatility
- Language: HTML
- Homepage:
- Size: 3.04 MB
- Stars: 6
- Watchers: 1
- Forks: 10
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-forensics - **4**星
README
# A Quick Intro to Hidden Markov Models Applied to Stock Volatility
Both the [presentation](./presentation/) and the [notebook](./notebook/) are part of the material presented in [R/Finance](http://www.rinfinance.com/) 2017.
## About R/Finance
Applied Finance with R From the inaugural conference in 2009, the annual R/Finance conference in Chicago has become the primary meeting for academics and practioners interested in using R in Finance. Participants from academia and industry mingle for two days to exchange ideas about current research, best practices and applications. A single-track program permits continued focus on a series of refereed submissions. A lively social program rounds out the event.
## Abstract
I make a naive implementation of the forward algorithm in Stan for the Normal Mixed GARCH. Using series for an index and stock prices from companies in different industries, I find that belief states are shared across assets and the strength of the relationship varies for each pair of assets. This hints that volatility states follow a hierarchical structure: for example, the risk states of a global portfolio may be decomposed in Country + Industry + Stock Individual.
## Foreword
The (very) **naive** implementation of the algorithm in Stan is only meant for illustration. A few good practices were neglected, convergence is not guaranteed, there is much room left for optimization and fitting *N* different independent models is probably not a reasonable choice for production sampler. The main takeaway of this presentation is the ideas behind the code but not the code itself.
## Prerequisites
* R 3.3.3
* RStudio Desktop 1.0.136
* Rtools 3.3 (R 3.2.x to 3.3.x)
* Stan 2.14
* R Packages
* RStan 2.14.2
## Authors
* **Luis Damiano** - [luisdamiano](https://github.com/luisdamiano)
## License
_A Quick Intro to Hidden Markov Models Applied to Stock Volatility_ is licensed under CC-BY-SA 4.0. See the [LICENSE](LICENSE.md) file for details.
## Acknowledgments
* To the R/Finance Conference committee for accepting my proposal and generously providing travel funding.
* Special thanks to all those who showed me how much fun stats can be, a real life changer.