TVPVARSVResult.stability_path#

TVPVARSVResult.stability_path()[source]#

Largest companion-root modulus of the posterior mean VAR at each date.

The time-varying analogue of a stability check, and the honest form of it: a drifting model can wander through locally explosive parameter regions and back, and this path is where that shows.

Return type:

NDArray[double]

Returns:

An array of length nobs.

Example

>>> import numpy as np
>>> rng = np.random.default_rng(0)
>>> y = np.zeros((140, 2))
>>> for t in range(1, 140):
...     y[t] = 0.5 * y[t - 1] + rng.standard_normal(2)
>>> res = TVPVAR(y, order=1, training=40).fit(n_draws=40, n_burn=15, seed=0)
>>> roots = res.stability_path()
>>> roots.shape, bool(np.all((0.2 < roots) & (roots < 0.9)))
((99,), True)
>>> first = np.abs(np.linalg.eigvals(res.coefficients_at(0)[0])).max()
>>> bool(np.isclose(roots[0], first))
True