VECMResult.to_var#
- VECMResult.to_var()[source]#
The levels autoregressive matrices this specification implies.
- Return type:
- Returns:
A
(p, k, k)stack fromA_1 = I + Pi + Gamma_1,A_i = Gamma_i - Gamma_{i-1}, andA_p = -Gamma_{p-1}. This iscoefficients, 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