forecast (version 3.00)

auto.arima: Fit best ARIMA model to univariate time series

Description

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

Usage

auto.arima(x, d = NA, D = NA, max.p = 5, max.q = 5,
           max.P = 2, max.Q = 2, max.order = 5,
           start.p=2, start.q=2, start.P=1, start.Q=1,
           stationary = FALSE, ic = c("aic","aicc", "bic"), 
           stepwise=TRUE, trace=FALSE, 
           approximation=length(x)>100 | frequency(x)>12, xreg=NULL,
           test=c("kpss","adf","pp"), seasonal.test=c("ocsb","ch"),
					 allowdrift=TRUE, lambda=NULL)

Arguments

x
a univariate time series
d
Order of first-differencing. If missing, will choose a value based on KPSS test.
D
Order of seasonal-differencing. If missing, will choose a value based on CH test.
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 if model selection is not stepwise.
start.p
Starting value of p in stepwise procedure.
start.q
Starting value of q in stepwise procedure.
start.P
Starting value of P in stepwise procedure.
start.Q
Starting value of Q in stepwise procedure.
stationary
If TRUE, restricts search to stationary models.
ic
Information criterion to be used in model selection.
stepwise
If TRUE, will do stepwise selection (faster). Otherwise, it searches over all models. Non-stepwise selection can be very slow, especially for seasonal models.
trace
If TRUE, the list of ARIMA models considered will be reported.
approximation
If TRUE, estimation is via conditional sums of squares and the information criteria used for model selection are approximated. The final model is still computed using maximum likelihood estimation. Approximation should be used
xreg
Optionally, a vector or matrix of external regressors, which must have the same number of rows as x.
test
Type of unit root test to use. See ndiffs for details.
seasonal.test
This determines which seasonal unit root test is used. If seasonal.test="ch", the Canova-Hansen test is used. If seasonal.test="ocsb" (the default), the OCSB test is used.
allowdrift
If TRUE, models with drift terms are considered.
lambda
Box-Cox transformation parameter. Ignored if NULL. Otherwise, data transformed before model is estimated.

Value

Details

Non-stepwise selection can be slow, especially for seasonal data. Non-seasonal differences chosen using the KPSS test. Seasonal differences chosen using a variation on the Canova-Hansen test. Stepwise algorithm outlined in Hyndman and Khandakar (2008).

References

Canova, B.E. and Hansen, F. (1995) "Are seasonal patterns constant over time? A test for seasonal stability", Journal of Business & Economic Statistics, 13(3), 237-252. Hyndman, R.J. and Khandakar, Y. (2008) "Automatic time series forecasting: The forecast package for R", Journal of Statistical Software, 26(3). Osborn, D.R., Chui, A.P.L., Smith, J.P., Birchenhall, C.R. (1988) "Seasonality and the order of integration in consumption", Oxford Bulletin of Economics and Statistics, 50(4). Osborn, D.R. (1990) "Seasonality and the order of integration in consumption", International Journal of Forecasting, 6(1990), Pages 327-336.

See Also

Arima

Examples

Run this code
fit <- auto.arima(WWWusage)
plot(forecast(fit,h=20))

Run the code above in your browser using DataLab