MarkovSwitchingARResult._from_fit#

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

Assemble the public result from a raw fit and its specification.

Parameters:
  • fit (_MarkovSwitchingFit) – The raw estimator output.

  • model (_MarkovSwitchingModel[MarkovSwitchingARResult]) – The specification, read for the series, the orders and the switching flags.

Return type:

MarkovSwitchingARResult

Returns:

The assembled result.

Example

>>> import numpy as np
>>> rng = np.random.default_rng(0)
>>> model = MarkovSwitchingAR(rng.standard_normal(300), order=2, n_regimes=2)
>>> fit = model._fit_family(max_iter=50, tol=1e-6, n_init=2, screen_iter=5, seed=0)
>>> res = MarkovSwitchingARResult._from_fit(fit, model)
>>> res.order, res.n_regimes, res.ar_params.shape, res.nobs
(2, 2, (2, 2), 298)