tsbacktest.tsgarch.spec {tsgarch}R Documentation

Walk Forward Rolling Backtest

Description

Generates an expanding window walk forward backtest with option for rolling the forecast by filtering (see details).

Usage

## S3 method for class 'tsgarch.spec'
tsbacktest(
  object,
  start = floor(length(object$target$y_orig))/2,
  end = length(object$target$y_orig),
  h = 1,
  estimate_every = 1,
  rolling = FALSE,
  trace = FALSE,
  ...
)

Arguments

object

an object of class “tsgarch.spec”.

start

numeric data index from which to start the backtest.

end

numeric data index on which to end the backtest. The backtest will end 1 period before that date in order to have at least 1 out of sample value to compare against.

h

forecast horizon. As the expanding window approaches the “end”, the horizon will automatically shrink to the number of available out of sample periods.

estimate_every

number of periods at which the model is re-estimated (defaults to 1).

rolling

this indicates whether forecasts are made only on the estimation date (FALSE) or whether to filter the data 1 period at a time and forecast from the filtered data (TRUE).

trace

whether to show the progress bar. The user is expected to have set up appropriate handlers for this using the “progressr” package.

...

not currently used.

Details

The rolling option allows to re-estimate the data every n periods whilst filtering the data 1-step ahead between re-estimation dates so that overlapping forecasts are generated.

Value

A list which includes a data.table having the following columns:

Additional slots in the list include the distribution used and other information relating to the backtest setup.

Note

The function can use parallel functionality as long as the user has set up a plan using the future package.


[Package tsgarch version 1.0.2 Index]