This repository contains Jupyter notebooks that step through an educational replication of JungleRock’s white paper series “Models, Regimes, and Trend Following" (all parts).
Results closely match the originals, discrepancies are noted and commented.
You can run the notebooks directly in Colab, no installation needed:
- Go to the repo Parts 1 & 2 Colab, Part 3 Colab or Part 4 Colab.
- Login if needed.
- Run cells.
To run locally, make sure you have Python 3.8+ and the following libraries installed:
pandasnumpymatplotlibnumbarequestsstatsmodelscyclerscikit-learn
Clone the repository and then launch the desired notebook with Jupyter.
-
Setup & Imports
Load libraries and helper modules. -
Data Ingestion
Download daily & monthly Market – RF returns directly from professor Kenneth French's data library viaFFScraperor directly load via included csv files. -
Strategy Implementations
Replicate transformations done in the orginal work -
Backtests & Metrics
Compare cumulative returns, Sharpe ratios, drawdowns, turnover. -
Visualizations
Reproduce charts. -
Results Comparison
Highlight differences vs. published numbers and discuss possible causes.
Special thanks to the JungleRock team for providing the white papers this work attempts to replicate.
- JungleRock, “Models, Regimes, and Trend Following – Part 1”
- JungleRock, “Models, Regimes, and Trend Following – Part 2”
- JungleRock, “Models, Regimes, and Trend Following – Part 3”
- JungleRock, “Models, Regimes, and Trend Following – Part 4”
- Fama, E. F. & French, K. R. (1993). “Common risk factors in the returns on stocks and bonds.”
- StataCorp. (2015). MSWITCH: Markov-switching regression models. Stata Manual
- Hamilton, J. D. (1994). Time Series Analysis, Chapter 22. Princeton: Princeton University Press.