CV: Cross-validation statistic

Description Usage Arguments Value Author(s) See Also Examples

Description

Computes the leave-one-out cross-validation statistic (also known as PRESS – prediction residual sum of squares), AIC, corrected AIC, BIC and adjusted R^2 values for a linear model.

Usage

1
CV(obj)

Arguments

obj

output from lm or tslm

Value

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

Author(s)

Rob J Hyndman

See Also

AIC

Examples

1
2
3
4
5
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)

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