VECMXResult._from_fit#
- classmethod VECMXResult._from_fit(fit, model)[source]#
Assemble the public result from the internal fit and its model.
Annotated at the parent’s binding rather than narrowed to the conditional model, which would be a contravariance violation. Nothing is lost: the exogenous block lives on the shared base, because a closed system is the case where it happens to be empty.
- Parameters:
fit (
_VectorErrorCorrectionFit) – The packed reduced-rank fit, with itsimpactblock.model (
_VectorErrorCorrectionModel[Self]) – The model that produced it, read for both samples, both label sets, the order, the rank, the Johansen case and the contemporaneous flag.
- Return type:
Self- Returns:
A populated conditional result.
Example
>>> import numpy as np >>> rng = np.random.default_rng(0) >>> x = np.cumsum(rng.standard_normal((200, 1)), axis=0) >>> y = x + rng.standard_normal((200, 1)) >>> model = VECMX(y, x, order=1, rank=1, contemporaneous=False) >>> res = VECMXResult._from_fit(model._fit_family(), model) >>> res.contemporaneous, res.impact.shape, res.exog_names (False, (1, 0), ('x1',))