GARCH Models in Python 1
GARCH Models in Python 1
GARCH models
GA RCH MODELS IN P YTH ON
Chelsea Yang
Data Science Instructor
Course overview
GARCH: Generalized AutoRegressive Conditional Heteroskedasticity
√
2
∑n
(returni − mean)
volatility = i=1
= √variance
n−1
return_data = price_data.pct_change()
volatility = return_data.std()
σmonthly = √21 ∗ σd
σannual = √252 ∗ σd
Chelsea Yang
Data Science Instructor
First came the ARCH
Auto Regressive Conditional Heteroskedasticity
ω, α, β >= 0
α+β < 1
long-run variance:
ω/(1 − α − β)
Chelsea Yang
Data Science Instructor
Python "arch" package
from arch import arch_model
1 Kevin Sheppard. (2019, March 28). bashtage/arch: Release 4.8.1 (Version 4.8.1). Zenodo.
http://doi.org/10.5281/zenodo.2613877
3. Make a forecast
basic_gm = arch_model(sp_data['Return'], p = 1, q = 1,
mean = 'constant', vol = 'GARCH', dist = 'normal')
gm_result = gm_model.fit(update_freq = 4)
print(gm_result.params)
h.1 in row "2019-10-10": 1-step ahead forecast made using data up to and including that date