PanelVARResult._from_fit#

classmethod PanelVARResult._from_fit(fit, model)[source]#

Assemble the public result from the internal fit and its model.

Parameters:
  • fit (_VectorAutoRegressionFit) – The packed least-squares fit on the stacked design.

  • model (_PanelVectorAutoRegressionModel) – The model that produced it, read for the stacked sample, the labels, the unit layout, the effects and the order.

Return type:

Self

Returns:

A populated result.

Example

>>> import numpy as np
>>> panel = np.random.default_rng(0).standard_normal((3, 40, 2))
>>> model = PanelVAR(panel, order=1, unit_names=["a", "b", "c"])
>>> res = PanelVARResult._from_fit(model._fit_family(), model)
>>> res.unit_names, res.effects, res.deterministic.shape
(('a', 'b', 'c'), 'unit', (3, 2))