ARMAResult#

class cultivars.univariate.box_jenkins.ARMAResult(*, endog, fittedvalues, resid, llf, nobs, n_params, order, seasonal_order, trend, k_exog, ar_params, ma_params, seasonal_ar_params, seasonal_ma_params, beta, sigma2)[source]

Bases: _SummaryMixin, _SeriesMixin, _ComparisonMixin, _StationarityMixin, _InvertibilityMixin

A fitted (seasonal) ARIMA, optionally with exogenous regressors.

The estimates of the multiplicative seasonal model on the differenced series \(w_t = \Delta^d \Delta_s^D y_t\),

\[\phi(L)\,\Phi(L^s)\,\bigl(w_t - x_t'\beta\bigr) = \theta(L)\,\Theta(L^s)\,\varepsilon_t, \qquad \varepsilon_t \sim N(0, \sigma^2),\]

where \(x_t\) stacks the deterministic terms and the exogenous regressors, so that \(\beta\) shifts the observation and the ARMA structure describes what is left. One record serves ARMA, ARIMA, SARIMA and SARIMAX: the orders and the seasonal block are fields, and the polynomials a diagnostic reads are always the multiplied ones, \(\phi(L)\Phi(L^s)\) for stationarity and \(\theta(L)\Theta(L^s)\) for invertibility, because either factor alone can pass while their product has an explosive root. Composes five capabilities: rendering, frame interop, criterion-named comparison, and the stationarity and invertibility assessments.

Variables:
  • endog – The full observed series.

  • fittedvalues – One-step fitted values on the differenced modeling series.

  • resid – One-step residuals on the differenced modeling series.

  • llf – Maximized exact log-likelihood.

  • nobs – Observations after differencing.

  • n_params – Free parameter count, including the innovation variance.

  • order – Non-seasonal (p, d, q).

  • seasonal_order – Seasonal (P, D, Q, s).

  • trend – Deterministic specification.

  • k_exog – Number of exogenous regressors.

  • ar_params – Non-seasonal AR coefficients.

  • ma_params – Non-seasonal MA coefficients.

  • seasonal_ar_params – Seasonal AR coefficients.

  • seasonal_ma_params – Seasonal MA coefficients.

  • beta – Coefficients on the deterministic and exogenous block.

  • sigma2 – Innovation variance.

Note

beta is an observation intercept, not a term inside the autoregression: under trend="c" its first entry is the mean of the differenced series, \(E[w_t] = \beta_0\), where the const of ARResult is the recursion’s intercept with mean \(c / (1 - \sum\phi_i)\). The two agree only at \(\phi = 0\); compare them through the implied mean, not the coefficient. The fitted and residual paths live on the differenced scale and have nobs rows, d + sD fewer than endog. Standard errors are not yet reported by this estimator.

See also

References

Box, G. E. P., Jenkins, G. M., Reinsel, G. C., & Ljung, G. M. (2015). Time Series Analysis: Forecasting and Control, 5th ed. Wiley.

Durbin, J., & Koopman, S. J. (2012). Time Series Analysis by State Space Methods, 2nd ed., chapter 3. Oxford University Press.

Example

>>> rng = np.random.default_rng(0)
>>> e = rng.standard_normal(600)
>>> y = np.zeros(600)
>>> for t in range(1, 600):
...     y[t] = 0.6 * y[t - 1] + e[t] + 0.4 * e[t - 1]
>>> res = ARMA(y, order=(1, 1)).fit()
>>> res.order, res.seasonal_order, res.nobs, res.n_params
((1, 0, 1), (0, 0, 0, 0), 600, 4)
>>> list(res.params)
['const', 'ar.L1', 'ma.L1', 'sigma2']
>>> bool(abs(res.ar_params[0] - 0.6) < 0.1), bool(abs(res.ma_params[0] - 0.4) < 0.1)
(True, True)
>>> res.is_stationary, res.is_invertible
(True, True)

A seasonal fit is judged on the multiplied polynomial, whose length is \(p + sP\):

>>> s = np.zeros(600)
>>> for t in range(13, 600):
...     s[t] = 0.5 * s[t - 1] + 0.4 * s[t - 12] - 0.2 * s[t - 13] + e[t]
>>> seasonal = SARIMA(s, order=(1, 0, 0), seasonal_order=(1, 0, 0, 12)).fit()
>>> list(seasonal.params), seasonal._stationarity_ar().shape
(['const', 'ar.L1', 'ar.S.L12', 'sigma2'], (13,))

Private methods#

_comparison_label()

Specification label used when this result appears in a ranking.

_from_fit(fit, model)

Assemble the public result from a raw fit and its specification.

_invertibility_ma()

The multiplied polynomial \(\theta(L)\,\Theta(L^s)\), sign-corrected.

_notes()

Closing diagnostics, omitting any that the specification makes vacuous.

_specification()

Compact specification label, widening only as the model does.

_stationarity_ar()

The multiplied polynomial \(\phi(L)\,\Phi(L^s)\).

_summary_table()

Structured summary rendered by every display path.