0

I have fitted a GARCH model using arch library (https://arch.readthedocs.io/en/latest/index.html#) Now I am trying to predict future volatility, but I can't see predictions any further then tomorrow. Changing horizon parameter makes new columns named 'h.' only. What should I do?

# Make 100-period ahead forecast
gm_forecast = gm_result.forecast(horizon = 3, method='bootstrap', reindex=False)
#reindex to silence the warning

# Print the forecast variance
print(gm_forecast.mean)
print(gm_forecast.residual_variance)
print(gm_forecast.variance) 

Output: h.1 h.2 h.3 Date
2022-05-20 0.230553 0.230553 0.230553 h.1 h.2 h.3 Date
2022-05-20 6.842437 7.512426 7.476012 h.1 h.2 h.3 Date
2022-05-20 6.842437 7.512426 7.476012

1 Answers1

0

The output is fine. You set your horizon=3, to predict three timesteps ahead. According to the docs:

The three main outputs [mean, variance, residual_variance] are all returned in DataFrames with columns of the form h.# where # is the number of steps ahead. That is, h.1 corresponds to one-step ahead forecasts while h.10 corresponds to 10-steps ahead.

That's why you have 3 h columns. Please note to predict 100 steps ahead, as your comment suggests to do, you'd need to set horizon=100.

Complete example:

import datetime as dt
import sys

import arch.data.sp500
import numpy as np
import pandas as pd
from arch import arch_model

data = arch.data.sp500.load()
market = data["Adj Close"]
returns = 100 * market.pct_change().dropna()

gm_forecast = gm_result.forecast(horizon = 3, method='bootstrap', reindex=False)

gm_forecast.variance

Output:

                h.1       h.2       h.3
Date                                   
2018-12-31  3.59647  3.561266  3.504606
KarelZe
  • 1,466
  • 1
  • 11
  • 21