GARCH-modellen in Python
Chelsea Yang
Data Science Instructor
from arch import arch_model

Ontwikkel een GARCH-model in drie stappen:
Modelaannames:
"normal" (standaard), "t", "skewt""constant" (standaard), "zero", "AR""GARCH" (standaard), "ARCH", "EGARCH"
basic_gm = arch_model(sp_data['Return'], p = 1, q = 1,
mean = 'constant', vol = 'GARCH', dist = 'normal')
Toon fit-uitvoer na elke n iteraties:
gm_result = gm_model.fit(update_freq = 4)

Weergave uitzetten:
gm_result = gm_model.fit(disp = 'off')
Geschat met de "maximum likelihood-methode"
print(gm_result.params)
mu 0.077239
omega 0.039587
alpha[1] 0.167963
beta[1] 0.786467
Name: params, dtype: float64
print(gm_result.summary())

gm_result.plot()

# Maak 5-periode-vooruit voorspelling
gm_forecast = gm_result.forecast(horizon = 5)
# Print de laatste rij van de variantievoorspelling
print(gm_forecast.variance[-1:])
h.1 h.2 h.3 h.4 h.5
Date
2019-10-10 0.994079 0.988366 0.982913 0.977708 0.972741
h.1 in rij "2019-10-10": 1-staps-vooruit voorspelling op basis van data t/m die datum
GARCH-modellen in Python