tsbacktest: Walk Forward Model Backtest

tsbacktest.tsvets.specR Documentation

Walk Forward Model Backtest

Description

Generates an expanding window walk forward backtest.

Usage

## S3 method for class 'tsvets.spec'
tsbacktest(
  object,
  start = floor(NROW(object$target$y_orig)/2),
  end = NROW(object$target$y_orig),
  h = 1,
  alpha = NULL,
  aggregate = FALSE,
  weights = NULL,
  solver = "nlminb",
  trace = FALSE,
  autodiff = FALSE,
  ...
)

Arguments

object

an object of class “tsvets.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.

alpha

optional numeric vector of coverage rates for which to calculate the quantiles.

aggregate

whether to create an aggregate series from the forecasts (see tsaggregate for details).

weights

numeric weights vector for the aggregation.

solver

solver to use.

trace

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

autodiff

whether to use automatic differentiation for estimation. This makes use of the tsvetsad package.

...

additional arguments passed to the “auto_clean” function.

Value

A list with the following data.tables:

  • prediction : the backtest table with forecasts and actuals by series

  • metrics: a summary performance table showing metrics by forecast horizon and series

Note

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


tsmodels/tsvets documentation built on June 13, 2022, 2:14 p.m.