FunctionalCoefficientVARResult.stability_curve#

FunctionalCoefficientVARResult.stability_curve()[source]#

Largest companion-root modulus of the local system along the grid.

A functional-coefficient process can be locally explosive over part of the state space and globally stable – excursions into the explosive region get pulled back – so a modulus above one here is a prompt to look, not a verdict.

Return type:

NDArray[double]

Returns:

An array of length G, aligned with grid.

Example

>>> import numpy as np
>>> rng = np.random.default_rng(0)
>>> y = np.zeros((250, 2))
>>> for t in range(1, 250):
...     a = 0.8 * np.tanh(y[t - 1, 0])
...     y[t, 0] = a * y[t - 1, 0] + 0.5 * rng.standard_normal()
...     y[t, 1] = 0.4 * y[t - 1, 1] + 0.5 * rng.standard_normal()
>>> res = FunctionalCoefficientVAR(y, order=1, transition_variable="y1").fit(
...     bandwidth=1.2, n_grid=21
... )
>>> roots = res.stability_curve()
>>> roots.shape, bool(np.all(roots < 1.0)), bool(roots[-1] > roots[10])
((21,), True, True)