CVar: k-fold Cross-Validation applied to an autoregressive model

Description Usage Arguments Value Author(s) References See Also Examples

Description

CVar computes the errors obtained by applying an autoregressive modelling function to subsets of the time series y using k-fold cross-validation as described in Bergmeir, Hyndman and Koo (2015).

Usage

1
CVar(y, k=10, FUN=nnetar, cvtrace=FALSE, ...)

Arguments

y

Univariate time series

k

Number of folds to use for cross-validation.

FUN

Function to fit an autoregressive model. Currently, it only works with the nnetar function.

cvtrace

Provide progress information.

...

Other arguments are passed to FUN.

Value

A list containing information about the model and accuracy for each fold, plus other summary information computed across folds.

Author(s)

Gabriel Caceres and Rob J Hyndman

References

Bergmeir, C., Hyndman, R.J., Koo, B. (2015) A note on the validity of cross-validation for evaluating time series prediction. Monash working paper 10/15. http://robjhyndman.com/working-papers/cv-time-series/.

See Also

CV, tsCV.

Examples

1
2
3
modelcv <- CVar(lynx, k=5, lambda=0.15)
print(modelcv)
print(modelcv$fold1)

pli2016/forecast documentation built on May 25, 2019, 8:22 a.m.