VARXResult.to_varx#

VARXResult.to_varx()[source]#

This unit’s equations in levels, as a global system consumes them.

A repackaging rather than a conversion: a VARX is already written in levels, so the only work is splitting the exogenous stack into its contemporaneous head and its lagged tail.

Return type:

_ConditionalLevels

Returns:

A _ConditionalLevels with phi the endogenous stack, impact equal to B_0 and exog_lags equal to B_1, ..., B_s.

Example

>>> import numpy as np
>>> rng = np.random.default_rng(0)
>>> y, x = rng.standard_normal((120, 2)), rng.standard_normal((120, 1))
>>> res = VARX(y, x, order=1, exog_order=2).fit()
>>> levels = res.to_varx()
>>> levels.impact.shape, levels.exog_lags.shape, levels.exog_names
((2, 1), (2, 2, 1), ('x1',))
>>> bool(np.allclose(levels.impact, res.exog_coefficients[0]))
True