PanelVARResult.unit_effects#

property PanelVARResult.unit_effects: dict[str, NDArray[float64]][source]#

Each unit’s intercept vector.

Raises:

SpecificationError – If the model was fitted without unit effects, in which case there are no unit intercepts to return and an empty mapping would read as though every unit had a zero one.

Example

>>> import numpy as np
>>> rng = np.random.default_rng(0)
>>> units = [rng.standard_normal((60, 2)) + shift for shift in (0.0, 5.0)]
>>> res = PanelVAR(units, order=1).fit()
>>> effects = res.unit_effects
>>> sorted(effects), bool(np.all(effects["unit2"] > effects["unit1"] + 2.0))
(['unit1', 'unit2'], True)
>>> pooled = PanelVAR(units, order=1, effects="none", trend="c").fit()
>>> pooled.unit_effects
Traceback (most recent call last):
cultivars.exceptions.SpecificationError: this model was fitted with effects='none', ...