garch_forecast {tstests}R Documentation

Sample GARCH Forecast Data

Description

A pre-computed backtest of the SPY log returns data using a GARCH(1,1)-JSU model (see details for replication code).

Usage

garch_forecast

Format

garch_forecast

A data.table with 250 rows and 5 columns:

date

the forecast date

actual

the realized values

forecast

the forecast mu

sigma

the forecast sigma

skew

the estimated skew of the jsu distribution

shape

the estimated shape of the jsu distribution

Details

The replication code for the backtest based 1-step ahead forecast distribution is as follows:

library(xts)
library(tsgarch)
data("spy", package = "tstests")
spyr <- na.omit(diff(log(spy)))
n <- NROW(spyr)
spec <- garch_modelspec(spyr, model = "garch", constant = T,
distribution = "jsu")
b <- tsbacktest(spec, start = (n - 250), end = n, h = 1, estimate_every = 30,
rolling = T, trace = T)
garch_forecast <- data.table(date = b$table$forecast_date,
actual = b$table$actual, forecast = b$table$mu, sigma = b$table$sigma,
skew = b$table$skew, shape = b$table$shape)

[Package tstests version 1.0.0 Index]