Skip to contents

Back-test a forecasting configuration on a holdout tail

Usage

morie_ts_backtest(x, h = 10L, order = c(0L, 0L, 0L), seasonal = c(0L, 0L, 0L))

Arguments

x

A numeric series or morie_ts.

h

Holdout length (also the forecast horizon).

order, seasonal

ARIMA orders passed to morie_ts_arima().

Value

A list with the forecast, the held-out actual, and the accuracy metrics.

Examples

set.seed(1)
morie_ts_backtest(cumsum(rnorm(120)), h = 12, order = c(1, 1, 0))$accuracy
#>     RMSE      MAE     MAPE       ME 
#> 1.359464 1.229057 8.908283 1.229057