CVar

0th

Percentile

k-fold Cross-Validation applied to an autoregressive model

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).

Keywords
ts
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.

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. https://robjhyndman.com/publications/cv-time-series/.

CV, tsCV.

• CVar
• print.CVar
Examples
# NOT RUN {
modelcv <- CVar(lynx, k=5, lambda=0.15)
print(modelcv)
print(modelcv\$fold1)

# }

Documentation reproduced from package forecast, version 8.2, License: GPL-3

Community examples

Looks like there are no examples yet.