Utility function to help in fitting an automatically selected ARIMA model based on approximate Akaike Information Criterion (AIC) values.
Utility function to help in fitting an automatically selected ARIMA model based on approximate Akaike Information Criterion (AIC) values. The model search is based on the heuristic developed by Hyndman and Khandakar (2008) and described in http://www.jstatsoft .org/v27/i03/paper. In contrast to the algorithm in the paper, we use an approximation to the AIC, rather than an exact value. Note that if the maximum differencing order provided does not suffice to induce stationarity, the function returns a failure, with the appropriate message. Additionally, note that the heuristic only considers models that have parameters satisfying the stationarity/invertibility constraints. Finally, note that our algorithm is slightly more lenient than the original heuristic. For example, the original heuristic rejects models with parameters "close" to violating stationarity/invertibility. We only reject those that actually violate it.
This functionality is even less mature than some of the other model fitting functions here, so use it with caution.
time series to which to automatically fit an ARIMA model
limit for the AR order
limit for differencing order
limit for the MA order
an ARIMAModel
Given a time series, fit a non-seasonal ARIMA model of order (p, d, q), where p represents the autoregression terms, d represents the order of differencing, and q moving average error terms.
Given a time series, fit a non-seasonal ARIMA model of order (p, d, q), where p represents
the autoregression terms, d represents the order of differencing, and q moving average error
terms. If includeIntercept is true, the model is fitted with an intercept. In order to select
the appropriate order of the model, users are advised to inspect ACF and PACF plots, or compare
the values of the objective function. Finally, while the current implementation of
fitModel
verifies that parameters fit stationarity and invertibility requirements,
there is currently no function to transform them if they do not. It is up to the user
to make these changes as appropriate (or select a different model specification)
autoregressive order
differencing order
moving average order
time series to which to fit an ARIMA(p, d, q) model
if true the model is fit with an intercept term. Default is true
objective function and optimization method, current options are 'css-bobyqa', and 'css-cgd'. Both optimize the log likelihood in terms of the conditional sum of squares. The first uses BOBYQA for optimization, while the second uses conjugate gradient descent. Default is 'css-cgd'
A set of user provided initial parameters for optimization. If null (default), initialized using Hannan-Rissanen algorithm. If provided, order of parameter should be: intercept term, AR parameters (in increasing order of lag), MA parameters (in increasing order of lag)
ARIMA models allow modeling timeseries as a function of prior values of the series (i.e. autoregressive terms) and a moving average of prior error terms. ARIMA models are traditionally specified as ARIMA(p, d, q), where p is the autoregressive order, d is the differencing order, and q is the moving average order. Using the backshift (aka lag operator) B, which when applied to a Y returns the prior value, the ARIMA model can be specified as Y_t = c + \sum_{i=1}p \phi_i*Bi*Y_t + \sum_{i=1}q \theta_i*Bi*\epsilon_t + \epsilon_t where Y_i has been differenced as appropriate according to order
d
See https://en.wikipedia.org/wiki/Autoregressive_integrated_moving_average for more information on ARIMA. See https://en.wikipedia.org/wiki/Order_of_integration for more information on differencing integrated time series.