best.arima {forecast}R Documentation

Fit best ARIMA model to univariate time series

Description

Returns best ARIMA model according to either AIC or BIC value. The function conducts a search over possible model within the order constraints provided.

Usage

best.arima(x, d = ndiffs(x), D = 0, max.p = 5,
                         max.q = 5, max.P = 2, max.Q = 2, max.order = 5,
                         stationary = FALSE, drift = TRUE, trend = FALSE,
                         ic = c("aic","aicc", "bic"))

Arguments

x a univariate time series
d Order of first-differencing. Will choose something sensible based on KPSS test.
D Order of seasonal-differencing. Default is 0. Must be manually set.
max.p Maximum value of p
max.q Maximum value of q
max.P Maximum value of P
max.Q Maximum value of Q
max.order Maximum value of p+q+P+Q
stationary If TRUE, restricts search to stationary models.
drift If TRUE, allows (but doesn't force) the inclusion of drift in models with d>0.
trend If TRUE, allows (but doesn't force) the inclusion of a linear trend in models with d=0.
ic Information criterion to be used in model selection.

Details

Can be slow, especially for seasonal data. Non-seasonal differences chosen using kpss.test. Seasonal differences must be chosen manually.

Value

Same as for arima

Author(s)

Rob J Hyndman

See Also

arima

Examples

fit <- best.arima(WWWusage)
plot(forecast(fit,h=20))

[Package forecast version 1.04 Index]