GARCH Models in Python
Chelsea Yang
Data Science Instructor
GARCH: Generalized AutoRegressive Conditional Heteroskedasticity
Step 1: Calculate returns as percentage of price changes $$ return = {\frac{P_1 - P_0}{P_0}} $$
Step 2: Calculate the sample mean return $$ mean = \frac {\sum_{i=1}^n {return_i} }n $$
Step 3: Calculate the sample standard deviation $$ volatility = \sqrt\frac {\sum_{i=1}^n {(return_i - mean)}^2} {n-1}= \sqrt {variance}$$
Use pandas pct_change()
method:
return_data = price_data.pct_change()
Use pandas std()
method:
volatility = return_data.std()
(assume 21 trading days in a month)
$$\sigma_{monthly} = \sqrt{21} * \sigma_d$$
(assume 252 trading days in a year)
$$\sigma_{annual} = \sqrt{252} * \sigma_d$$
Heteroskedasticity:
Homoskedasticity vs Heteroskedasticity
VIX historical prices:
GARCH Models in Python