arma_forecast | R Documentation |
A pre-computed backtest of the SPY log returns data using an ARMA(1,1)-JSU model (see details for replication code).
arma_forecast
arma_forecast
A data.table with 250 rows and 5 columns:
the forecast date
the realized values
the forecast mu
the estimated 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(tsarma) # from the tsmodels github repo data("spy", package = "tstests") spyr <- na.omit(diff(log(spy))) n <- NROW(spyr) spec <- arma_modelspec(spyr, order c(1,1), distribution = "jsu") b <- tsbacktest(spec, start = (n - 250), end = n, h = 1, estimate_every = 30, rolling = T, trace = T) arma_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.