VARMA#
- class cultivars.multivariate.reduced_form.moving_average.VARMA(endog, *, order, trend='c', names=None)[source]#
Vector autoregressive moving average, estimated by Hannan-Rissanen.
Three passes, each a least-squares solve. The first fits a long autoregression – order growing with the square root of the sample – whose residuals estimate the unobservable innovations. The second regresses the sample on its own lags and on lags of those estimated innovations, which is the VARMA equation with a generated regressor standing in for the truth. The third re-derives the innovations recursively from the second-stage parameters, so they are consistent with the model rather than with the long autoregression, and estimates once more. When the second-stage moving-average block is not invertible the recursion would diverge instead of converge, so the third pass is skipped and the result says so.
No numerical optimizer, no likelihood surface, no starting values: the estimator is deterministic and fast, at the cost of the (small, and documented) efficiency loss relative to exact maximum likelihood, and of standard errors that condition on the estimated innovations. Lag-order selection is refused, because \((p, q)\) pairs are not nested least-squares designs; fit the candidates and rank them through the comparison surface.
- Variables:
_endog – The validated
(nobs, k)panel._names – Variable labels.
_order – Autoregressive order
p._trend – Deterministic terms.
_prior – The base slot for a shrinkage prior, unused by this family.
_ma_order – Moving-average order
q.
See also
VARMAResult– the recordfit()returns.VAR– theq = 0model, one pass instead of three.ARMA– 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.
Lütkepohl, H. (2005). New Introduction to Multiple Time Series Analysis. Springer. Chapters 11-12.
Example
>>> import numpy as np >>> rng = np.random.default_rng(0) >>> u = rng.standard_normal((202, 2)) >>> y = np.zeros((202, 2)) >>> for t in range(1, 202): ... y[t] = 0.5 * y[t - 1] + u[t] + 0.4 * u[t - 1] >>> res = VARMA(y[2:], order=(1, 1)).fit() >>> res.forecast(3).shape (3, 2)
Attributes#
The validated sample. |
|
Whether a prior contributes anything to this estimate. |
|
Number of endogenous variables. |
|
Moving-average order |
|
Regressors per equation, including the innovation lags. |
|
Variable labels. |
|
Autoregressive order. |
|
The prior on the coefficients; |
|
Deterministic specification. |
Methods#
|
Estimate the system by the three Hannan-Rissanen passes. |
|
Unavailable: VARMA orders are not nested least-squares candidates. |