VECMResult._from_fit#
- classmethod VECMResult._from_fit(fit, model)[source]#
Assemble the public result from the internal fit and its model.
- Parameters:
fit (
_VectorErrorCorrectionFit) – The packed reduced-rank fit.model (
_VectorErrorCorrectionModel[Self]) – The model that produced it, read for the sample, the labels, the order, the rank and the Johansen case.
- Return type:
Self- Returns:
A populated result, with
trendmapped from the Johansen case to the levels convention through_LEVELS_TREND.
Example
>>> import numpy as np >>> rng = np.random.default_rng(0) >>> common = np.cumsum(rng.standard_normal(200)) >>> y = np.column_stack([common, common + rng.standard_normal(200)]) >>> model = VECM(y, order=2, rank=1, cointegration_trend="restricted_constant") >>> res = VECMResult._from_fit(model._fit_family(), model) >>> res.cointegration_trend, res.trend, res.beta.shape ('restricted_constant', 'c', (3, 1))