forecast (version 4.02)

CV: Cross-validation statistic

Description

Computes cross-validation statistic, AIC, corrected AIC, BIC and adjusted R^2 values for a linear model.

Usage

CV(obj)

Arguments

obj
output from lm or tslm

Value

  • Numerical vector containing CV, AIC, AICc, BIC and AdjR2 values.

See Also

AIC

Examples

Run this code
y <- ts(rnorm(120,0,3) + 20*sin(2*pi*(1:120)/12), frequency=12)
fit1 <- tslm(y ~ trend + season)
fit2 <- tslm(y ~ season)
CV(fit1)
CV(fit2)

Run the code above in your browser using DataCamp Workspace