GVARResult.linkage_condition#

property GVARResult.linkage_condition: float[source]#

Condition number of the contemporaneous linkage matrix.

Large values mean two units’ foreign aggregates are nearly the same combination of global variables, so the solve that closes the system is ill-posed and the global coefficients are sensitive to noise in the unit estimates. A weight matrix with a few dominant trading partners shared across many units is the usual cause. The summary flags the system when this exceeds 1e8.

Example

>>> import numpy as np
>>> from cultivars.multivariate.reduced_form.vector_autoregression import VARX
>>> y = np.random.default_rng(0).standard_normal((200, 2))
>>> units = [VARX(y[:, [i]], y[:, [1 - i]], order=1).fit() for i in (0, 1)]
>>> swap = np.array([[0.0, 1.0], [1.0, 0.0]])
>>> names = ("us", "eu")
>>> res = GVAR(units, swap, variable_labels=["p", "p"], unit_names=names).solve()
>>> bool(res.linkage_condition < 2.0)
True
>>> cond = np.linalg.cond(res.contemporaneous)
>>> bool(np.isclose(res.linkage_condition, cond))
True