VECMResult.to_var#

VECMResult.to_var()[source]#

The levels autoregressive matrices this specification implies.

Return type:

NDArray[double]

Returns:

A (p, k, k) stack from A_1 = I + Pi + Gamma_1, A_i = Gamma_i - Gamma_{i-1}, and A_p = -Gamma_{p-1}. This is coefficients, named so that the conversion is discoverable from the econometrics rather than only from the attribute list.

Example

>>> import numpy as np
>>> rng = np.random.default_rng(0)
>>> common = np.cumsum(rng.standard_normal(300))
>>> y = np.column_stack([common, 2 * common + rng.standard_normal(300)])
>>> res = VECM(y, order=2, rank=1).fit()
>>> first, second = res.to_var()
>>> bool(np.allclose(first, np.eye(2) + res.cointegrating_matrix + res.gamma[0]))
True
>>> bool(np.allclose(second, -res.gamma[0]))
True