Qu

arima

Builtin index · Statistics & ML

result = arima(x, [p=1], [d=0], [q=0])

Input: x, p, d, q · Output: result

What it is

Fits an ARIMA(p, d, q) model to a length-N numeric vector x: d (integer, default 0) rounds of differencing, then an ARMA fit with p (integer, default 1) autoregressive lags and q (integer, default 0) moving-average lags. Estimated by Hannan-Rissanen — a long pure-AR pass to recover usable shock estimates, then one linear least-squares solve on the lagged series and those shocks — not exact maximum likelihood, so coefficients differ slightly from R's arima() on short series.

Overloads

One call shape — this function is not overloaded.

CodeInputOutputDescription
result = arima(x, [p=1], [d=0], [q=0])
x vectornot documented yet
p vector, optional (default 1)not documented yet
d vector, optional (default 0)not documented yet
q vector, optional (default 0)not documented yet
ar —length-p
ma —length-q
mu —the differenced series' mean
residuals —in the differenced series' space
Returns a fitted model Record with fields ar (length-p), ma (length-q), mu (the differenced series' mean), p, d, q, fitted and residuals (in the differenced series' space), plus history, shock_history and levels, which seed forecasting. arima(x, p=k, d=0, q=0) models the same thing ar_model(x, k) does, by a different estimator. Added in v0.3.0.

Examples

No documentation example calls this form yet. The Statistics & ML chapter is where one belongs.

How it works

arima(x, [p=1], [d=0], [q=0]) — ARIMA on a length-N series x: d rounds of differencing, then an ARMA(p, q) fit by Hannan–Rissanen (see arima_fit, which says plainly that this is not exact maximum likelihood and why that is the right trade here). .predict(n_ahead) is a forecast HORIZON, not a regression Xnew — the same non-regression predict meaning ar_model already has, and forecasts come back in the ORIGINAL series' units with the differencing undone. arima(x, p=k, d=0, q=0) is deliberately the same model ar_model(x, k) fits; the difference is that this one can also difference and carry an MA part.

From the note above this builtin in the interpreter, where the reasoning was written down as it was built.