MarkovSwitchingARResult.regime_uncertainty#
- property MarkovSwitchingARResult.regime_uncertainty: float[source]#
Mean posterior entropy, normalized so
0is sharp and1is flat.Averages the Shannon entropy of each date’s smoothed distribution and divides by
log K. A value near zero means the regimes are cleanly separated and the model is effectively dating a deterministic partition; a value near one means the data barely distinguish the regimes at all, which no coefficient table will tell you.Example
Separated regimes against white noise forced into two:
>>> import numpy as np >>> rng = np.random.default_rng(0) >>> s = (np.arange(600) // 150) % 2 >>> y = np.where(s == 1, 2.0, -2.0) + 0.5 * rng.standard_normal(600) >>> sharp = MarkovSwitchingAR(y, order=1).fit(seed=0, n_init=2) >>> flat = MarkovSwitchingAR(rng.standard_normal(600), order=1).fit(seed=0, n_init=2) >>> bool(sharp.regime_uncertainty < 0.01), bool(flat.regime_uncertainty > 0.05) (True, True)