This repository contains an indicator for detecting phase transitions in implied volatility (IV) premiums using the VIX index. The indicator is based on fitting the VIX data to a Student's t-distribution with 1 degree of freedom using a 30-day rolling window.
The indicator is calculated using the cumulative distribution function (CDF) of the Student's t-distribution with 1 degree of freedom:
Indicator = F_t(x; ν=1, μ, σ) = ∫_{-∞}^x \frac{\Gamma(\frac{\nu+1}{2})}{\sqrt{\nu\pi}\,\Gamma(\frac{\nu}{2})} \left(1+\frac{t^2}{\nu}\right)^{-\frac{\nu+1}{2}} \,dt
Where:
F_t
is the cumulative distribution function (CDF) of the Student's t-distribution, using the latest VIX Daily Close valuex
is the input value (30-day rolling average of VIX Daily Close value)ν
is the degrees of freedom (set to 1)μ
is the location parameter (estimated usingscipy.stats.t.fit
)σ
is the scale parameter (estimated usingscipy.stats.t.fit
)Γ
is the gamma function
To see multiple timescales, visit https://nightvision04.github.io/ivol-t-indicator/
The repository provides links to download the raw and smoothed indicator data in CSV format. The data is updated hourly via Github Actions. You can also just download it here.
The Python code for calculating and plotting the IV Phase Transition Indicator is included in the repository. The code uses the following libraries:
- pandas
- numpy
- matplotlib
- scipy
- yfinance
The main functionality is implemented in the Data
class, which retrieves the historical VIX data, calculates the indicator, and generates the plots.
To use the IV Phase Transition Indicator code:
- Install the required dependencies:
pandas
,numpy
,matplotlib
,scipy
, andyfinance
. - Run the Python script to retrieve the VIX data, calculate the indicator, and generate the plots.
- The generated plots will be saved in the
images
folder.
- Taleb, N. N. (2020). Statistical Consequences of Fat Tails. STEM Academic Press.
- Daniel Scott, March 2024
- Buy me a coffee
Feel free to explore the website, download the data, and use the code to further analyze the IV Phase Transition Indicator.