GARCH rolling window forecast

GARCH Models in Python

Chelsea Yang

Data Science Instructor

Rolling window for out-of-sample forecast

An exciting part of financial modeling: predict the unknown

Prediction art

Rolling window forecast: repeatedly perform model fitting and forecast as time rolls forward

Rolling

GARCH Models in Python

Expanding window forecast

Continuously add new data points to the sample

Expanding window forecast

GARCH Models in Python

Motivations of rolling window forecast

  • Avoid lookback bias
  • Less subject to overfitting
  • Adapt forecast to new observations
GARCH Models in Python

Implement expanding window forecast

Expanding window forecast:

for i in range(120):
    gm_result = basic_gm.fit(first_obs = start_loc, 
                             last_obs = i + end_loc, disp = 'off')
    temp_result = gm_result.forecast(horizon = 1).variance
GARCH Models in Python

Fixed rolling window forecast

New data points are added while old ones are dropped from the sample

Fixed rolling window forecast

GARCH Models in Python

Implement fixed rolling window forecast

Fixed rolling window forecast:

for i in range(120):
    # Specify rolling window range for model fitting
    gm_result = basic_gm.fit(first_obs = i + start_loc, 
                             last_obs = i + end_loc, disp = 'off')
    temp_result = gm_result.forecast(horizon = 1).variance
GARCH Models in Python

How to determine window size

Usually determined on a case-by-case basis

  • Too wide window size: include obsolete data that may lead to higher variance

  • Too narrow window size: exclude relevant data that may lead to higher bias

The optimal window size: trade-off to balance bias and variance

Balancing illustration art

GARCH Models in Python

Let's practice!

GARCH Models in Python

Preparing Video For Download...