MarkovSwitchingARResult._series#
- MarkovSwitchingARResult._series()[source]#
Aligned per-observation output, widened by the regime posterior.
Uses the two-argument
superdeliberately.@dataclass(slots=True)builds a new class object and rebinds the name to it, so the__class__cell that zero-argumentsuper()closes over still points at the original, pre-slots class – which no subclass inherits from.- Return type:
- 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 by2Kcolumns.
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']