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]#
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 lastqinnovations 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.
Falsemeans 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 ofA_1, ..., A_p.ma_coefficients –
(q, k, k)stack ofM_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 whosefit()returns this record.VARResult– theq = 0case, 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))
Attributes#
The |
|
The |
|
The |
|
Order of the stage-one autoregression whose residuals proxied the innovations. |
|
Whether the third pass ran; |
|
Standard errors, keyed identically to |
|
Covariance of the coefficient matrix, sampling or posterior. |
|
The |
|
AIC, BIC, and HQIC derived from the likelihood and parameter count. |
|
Whether every moving-average root lies inside the unit circle. |
|
Whether every companion eigenvalue lies inside the unit circle. |
|
Number of endogenous variables. |
|
Moving-average order |
|
Every coefficient, keyed |
|
Two-sided p-values against zero, keyed identically to |
|
Normal test statistics against zero, keyed identically to |
Methods#
|
Engle's LM test for conditional heteroskedasticity in one equation. |
|
Rank this result against others by an information criterion. |
|
Confidence bounds for every coefficient. |
|
The coefficients of one equation, keyed by regressor. |
|
Forecast-error variance decomposition. |
|
Deterministic multi-step forecasts from the end of the sample. |
|
Variance shares from the generalized responses, normalized to sum to one. |
|
Pesaran-Shin impulse responses, which do not depend on variable order. |
|
Wald test that one variable's lags are jointly zero in another equation. |
Attribute each observation to the shocks that produced it. |
|
|
Declare an identification scheme and return the structural view. |
Eigenvalue verdict for the moving-average companion matrix. |
|
|
Impulse responses to a one-standard-deviation shock. |
|
Test this result as the restricted model against a nesting one. |
|
Moving-average matrices |
|
Jarque-Bera test on one equation's residuals. |
|
Multivariate Ljung-Box test for residual autocorrelation. |
|
Run every residual test and collect them into one table. |
|
A fresh sample path from the fitted system. |
Eigenvalue verdict for the companion matrix. |
|
Orthogonalized innovations |
|
|
The estimation summary, renderable as text, HTML, or a dataframe. |