garch_forecast | R Documentation |
A pre-computed backtest of the SPY log returns data using a GARCH(1,1)-JSU model (see details for replication code).
garch_forecast
garch_forecast
A data.table with 250 rows and 5 columns:
the forecast date
the realized values
the forecast mu
the forecast sigma
the estimated skew of the jsu distribution
the estimated shape of the jsu distribution
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.