LoslegenKostenlos loslegen

Make forecast with GARCH models

Previously you have implemented a basic GARCH(1,1) model with the Python arch package. In this exercise, you will practice making a basic volatility forecast.

You will again use the historical returns of S&P 500 time series. First define and fit a GARCH(1,1) model with all available observations, then call .forecast() to make a prediction. By default it produces a 1-step ahead estimate. You can use horizon = n to specify longer forward periods.

The arch package has been preloaded for you.

Diese Übung ist Teil des Kurses

GARCH Models in Python

Kurs anzeigen

Interaktive Übung

Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.

# Specify a GARCH(1,1) model
basic_gm = ____(sp_data['Return'], p = 1, q = 1, 
                      mean = 'constant', vol = 'GARCH', dist = 'normal')
# Fit the model
gm_result = basic_gm.____()
Code bearbeiten und ausführen