Fits an Ornstein-Uhlenbeck mean-reversion model to India VIX (2023–2025).
What the code does:
- Downloads India VIX daily closing data from Yahoo Finance
- Runs ADF test to confirm the series is mean-reverting
- Estimates OU parameters (κ, μ, σ) via OLS on the discretized process
- Computes half-life of mean reversion
- Generates z-score based trading signals
- Simulates an OU path with fitted parameters for comparison
- Calculates rolling half-life over a 120-day window
- Produces 8 plots covering all of the above
It Outputs ou_analysis_plots.png in the same directory.
To run:
pip install numpy pandas matplotlib statsmodels scipy yfinance
cd statistical-modelling
python ou_analysis.py