backtest function

Backtest

Backtest

Backtest for an ARIMA time series model.

backtest(m1, rt, orig, h, xre = NULL, fixed = NULL, include.mean = TRUE)

Arguments

  • m1: an ARIMA time series model object.
  • rt: the time series.
  • orig: forecast origin.
  • h: forecast horizon.
  • xre: the independent variables.
  • fixed: parameter constraint.
  • include.mean: a logical value for constant term of the model. Default is TRUE.

Returns

The function returns a list with following components: - orig: the starting forecast origin.

  • err: observed value minus fitted value.

  • rmse: RMSE of out-of-sample forecasts.

  • mabso: mean absolute error of out-of-sample forecasts.

  • bias: bias of out-of-sample forecasts.

Examples

data=arima.sim(n=100,list(ar=c(0.5,0.3))) model=arima(data,order=c(2,0,0)) backtest(model,data,orig=70,h=1)
  • Maintainer: Xialu Liu
  • License: GPL (>= 2)
  • Last published: 2023-09-24

Useful links