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 record fit() returns.

  • VAR – the q = 0 model, 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#

endog

The validated sample.

is_shrunk

Whether a prior contributes anything to this estimate.

k_endog

Number of endogenous variables.

ma_order

Moving-average order q.

n_regressors

Regressors per equation, including the innovation lags.

names

Variable labels.

order

Autoregressive order.

prior

The prior on the coefficients; NoPrior when unrestricted.

trend

Deterministic specification.

Methods#

fit()

Estimate the system by the three Hannan-Rissanen passes.

lag_order_selection([max_lags])

Unavailable: VARMA orders are not nested least-squares candidates.