MarkovSwitchingARResult._series#

MarkovSwitchingARResult._series()[source]#

Aligned per-observation output, widened by the regime posterior.

Uses the two-argument super deliberately. @dataclass(slots=True) builds a new class object and rebinds the name to it, so the __class__ cell that zero-argument super() closes over still points at the original, pre-slots class – which no subclass inherits from.

Return type:

dict[str, NDArray[double]]

Returns:

The observed/fitted/residual triple, one smoothed-probability column per regime, and the pointwise most likely regime. The filtered and predicted posteriors are reachable through probabilities() rather than widening this by 2K columns.

Example

>>> import numpy as np
>>> rng = np.random.default_rng(0)
>>> res = MarkovSwitchingAR(rng.standard_normal(300), order=1).fit(seed=0, n_init=2)
>>> list(res._series())
['observed', 'fitted', 'resid', 'smoothed_prob_0', 'smoothed_prob_1', 'regime']