Last data update: 2014.03.03

R: The order of a time series using cross-validation of the...
lin.order.clsR Documentation

The order of a time series using cross-validation of the linear autoregressive model (conditional least-squares).

Description

A function to estimate the order of a time series using cross-validation of the linear autoregressive model. Coefficients are estimated using conditional least-squares.

Usage

    lin.order.cls(x, order=1:5, n.cond = 5, echo = TRUE)
    

Arguments

x

A time series without missing values

order

The candidate orders. The default is 1:5

.

n.cond

The number of observation to condition on. The default is 5 (must be >= max(order))

.

echo

if TRUE a counter for the data points and the orders is produced to monitor progress.

Details

The time series is normalized prior to cross-validation.

Note that if the dynamics is highly nonlinear, the nonparametric order-estimators (ll.order) may be more appropriate. (I coded this function to use for comparison with the nonparametric methods, because these also uses (nonlinear) conditional least-squares.)

Value

An object of class "lin.order" is returned consisting of the following components:

order

the grid of orders considered.

CVd

the cross-validation errors across the grid of orders.

Author(s)

Ottar N. Bjornstad onb1@psu.edu

See Also

summary.lin.order plot.lin.order ll.order

Examples

    data(plodia)
    fit <- lin.order.cls(sqrt(plodia), order=1:5)
    ## Not run: plot.lin.order(fit)
    summary.lin.order(fit)

Results