arma_forecast {tstests}R Documentation

Sample ARMA Forecast Data

Description

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

Usage

arma_forecast

Format

arma_forecast

A data.table with 250 rows and 5 columns:

date

the forecast date

actual

the realized values

forecast

the forecast mu

sigma

the estimated 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(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)

[Package tstests version 1.0.0 Index]