Skip to contents

Selects an AR order by minimising a penalised-likelihood criterion over nested fits, with the innovation variances estimated by Yule-Walker (one Levinson-Durbin pass, the convention of stats::ar.yw()), Burg, or conditional least squares on a common sample.

Usage

ic_order(x, criterion = "bic", method = "yw", max_order = NULL)

Arguments

x

A numeric vector (a stationary series).

criterion

One of "aic", "aicc", "bic", "hq", "fpe", "cat", "mdl".

method

One of "yw" (default), "burg", "ols".

max_order

Maximum candidate order; NULL uses the stats::ar() default min(n - 1, 10 log10 n).

Value

A list with order, the criterion values for orders 0:max_order, and the innovation variances sigma2.

Examples

set.seed(1)
x <- arima.sim(list(ar = c(1.2, -0.6)), 400)
ic_order(x, "bic")$order
#> [1] 2