ARIMA#

class cultivars.univariate.box_jenkins.ARIMA(endog, *, order, trend='c')[source]#

ARIMA(p, d, q): non-seasonal differencing, no seasonal block, no regressors.

The model \(\phi(L)\,(1 - L)^d\,(y_t - \mu_t) = \theta(L)\,\varepsilon_t\), with \(\mu_t\) the deterministic terms of trend on the differenced scale, so that under trend="c" and d = 1 the constant is the drift of the levels. Reach for ARIMAX when there are exogenous regressors. Splitting the two is what makes either name informative: a reader of a call site knows from ARIMA alone that the fit has no external drivers.

Parameters:
  • endog (ArrayLike) – The endogenous series.

  • order (tuple[int, int, int]) – (p, d, q).

  • trend (str) – Deterministic specification.

Raises:
  • SpecificationError – If the order has the wrong length or a negative entry, or the trend is unrecognized.

  • DimensionError – If the series is too short for the specification.

See also

  • ARIMAX – with exogenous regressors.

  • SARIMA – with a seasonal block.

  • ARMA – the d = 0 case stated as such.

  • adf() – how to choose d.

Example

A random walk with drift is an ARIMA(0, 1, 0) whose constant is the drift:

>>> import numpy as np
>>> rng = np.random.default_rng(0)
>>> levels = np.cumsum(0.3 + rng.standard_normal(500))
>>> res = ARIMA(levels, order=(0, 1, 0)).fit()
>>> res.nobs, round(float(res.beta[0]), 1)
(499, 0.3)

Attributes#

endog

The validated endogenous series.

exog

The validated exogenous regressors, or None.

order

The non-seasonal order (p, d, q).

seasonal_order

The seasonal order (P, D, Q, s).

trend

The deterministic specification.

Methods#

fit()

Estimate by exact maximum likelihood.