CVar: k-fold Cross-Validation applied to an autoregressive model
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
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.