VARMAResult#

class cultivars.multivariate.reduced_form.moving_average.VARMAResult(*, endog, names, order, trend, sigma_u, sigma_ml, resid, fittedvalues, design, llf, nobs, n_params, posterior=None, prior_label='none', coefficients, deterministic, ma_coefficients, long_order, refined)[source]

Bases: _VectorResult, _SummaryMixin, _ComparisonMixin, _VectorInferenceMixin, _VectorPropagationMixin

A fitted vector autoregressive moving average.

The system

\[y_t = D d_t + \sum_{i=1}^{p} A_i\, y_{t-i} + u_t + \sum_{j=1}^{q} M_j\, u_{t-j}, \qquad u_t \sim (0, \Sigma_u),\]

estimated by the three Hannan-Rissanen passes: a long autoregression whose residuals stand in for the unobserved \(u_t\), a regression of \(y_t\) on its own lags and on lags of those residuals, and – when the second-stage moving-average block is invertible – a re-derivation of the innovations through the model and one more regression. The record holds the final pass, with the regressor matrix carrying lagged innovations in its trailing columns.

The propagation surface is inherited with one override that changes everything downstream: ma_representation() runs the VARMA recursion \(\Psi_h = M_h + \sum_i A_i \Psi_{h-i}\) rather than powering the autoregressive companion, and since the impulse responses, both variance decompositions, and the historical decomposition all read the moving-average matrices rather than the companion, correcting the one method corrects them all. forecast() is the other override, because a VARMA forecast carries the last q innovations across the sample boundary.

Note

Two things the inherited surface says that need reading with care. The standard errors treat the lagged innovations in the design as observed regressors; they are conditional in the Hannan-Rissanen sense and modestly understate uncertainty, and the summary says so. And an unrestricted VARMA is not globally identified – distinct \((A, M)\) pairs generate the same second moments, and the echelon-form restrictions that resolve this are not imposed – so the coefficient tables describe one representative of an equivalence class, while the moving-average matrices, forecasts, impulse responses and variance decompositions of a stable, invertible representative are invariant across it. Fitted to a non-invertible truth, the estimator returns the invertible representative with the same autocovariances, which is the right answer to the question least squares can ask.

Variables:
  • endog – The sample.

  • names – Variable labels, in Cholesky order.

  • order – Autoregressive order p.

  • ma_order – Moving-average order q.

  • long_order – Order of the stage-one autoregression that recovered the innovations.

  • refined – Whether the third pass ran. False means the second-stage moving-average block was not invertible, so re-deriving residuals through it would have amplified rather than reduced the approximation error, and the second-stage estimate was kept.

  • trend – Deterministic specification.

  • coefficients – (p, k, k) stack of A_1, ..., A_p.

  • ma_coefficients – (q, k, k) stack of M_1, ..., M_q.

  • deterministic – Deterministic coefficients, one row per term.

  • sigma_u – Residual covariance with the degrees-of-freedom correction.

  • sigma_ml – Residual covariance divided by the effective sample.

  • resid – One-step innovations over the effective sample.

  • fittedvalues – One-step conditional means over the effective sample.

  • design – The regressor matrix of the final pass.

  • llf – Gaussian log-likelihood of the final pass.

  • nobs – Effective sample size.

  • n_params – Free parameters, covariance included.

See also

  • VARMA – the model whose fit() returns this record.

  • VARResult – the q = 0 case, estimated in one pass with exact least squares.

  • ARMAResult – the scalar counterpart, estimated by exact maximum likelihood.

References

Hannan, E. J., & Rissanen, J. (1982). Recursive estimation of mixed autoregressive-moving average order. Biometrika, 69(1), 81-94.

Dufour, J.-M., & Jouini, T. (2005). Asymptotic distribution of a simple linear estimator for VARMA models in echelon form. In Statistical Modeling and Analysis for Complex Data Problems (pp. 209-240). Springer.

Lütkepohl, H. (2005). New Introduction to Multiple Time Series Analysis. Springer. Chapters 11-12.

Example

A bivariate VARMA(1, 1) with a diagonal-dominant autoregression and a moving-average block that spills from the first innovation into the second equation. The three passes recover both stacks, the long autoregression sits at the square root of the sample, the refinement ran, and the moving-average matrices start from the identity with \(\Psi_1 = A_1 + M_1\):

>>> import numpy as np
>>> rng = np.random.default_rng(0)
>>> A = np.array([[0.5, 0.1], [0.0, 0.4]])
>>> M = np.array([[0.4, 0.0], [0.2, 0.3]])
>>> u = rng.standard_normal((402, 2))
>>> y = np.zeros((402, 2))
>>> for t in range(1, 402):
...     y[t] = A @ y[t - 1] + u[t] + M @ u[t - 1]
>>> res = VARMA(y[2:], order=(1, 1)).fit()
>>> bool(np.abs(res.coefficients[0] - A).max() < 0.15)
True
>>> bool(np.abs(res.ma_coefficients[0] - M).max() < 0.15)
True
>>> res.long_order, res.refined, res.is_stable, res.is_invertible
(20, True, True, True)
>>> psi = res.ma_representation(2)
>>> bool(np.allclose(psi[1], res.coefficients[0] + res.ma_coefficients[0]))
True
>>> res.forecast(3).shape, res.irf(4).shape
((3, 2), (5, 2, 2))

Private methods#

_comparison_label()

Short specification label for a ranking table.

_summary_table()

Build the structured summary.

_trailing_blocks()

The moving-average coefficients, in design order.

_trailing_labels()

Moving-average column names, innovation lag by innovation lag.