MarkovSwitchingARResult.unconditional_mean#
- property MarkovSwitchingARResult.unconditional_mean: float | None[source]#
Ergodic mean of the process, or
Noneif it is not defined.Computed as the ergodic-probability-weighted average of each regime’s own unconditional mean
c_j / (1 - sum phi_j). ReturnsNonewhen any regime is non-stationary, since that regime has no unconditional mean to average in, and when the autoregressive sum sits at one.Example
On a draw from a stationary chain the ergodic mean sits near the sample mean:
>>> import numpy as np >>> rng = np.random.default_rng(0) >>> p = np.array([[0.97, 0.03], [0.05, 0.95]]) >>> s = np.zeros(1500, dtype=int) >>> for t in range(1, 1500): ... s[t] = np.searchsorted(np.cumsum(p[s[t - 1]]), rng.random()) >>> y = np.array([-1.0, 1.5])[s] + 0.5 * rng.standard_normal(1500) >>> res = MarkovSwitchingAR(y, order=1, n_regimes=2).fit(seed=0) >>> bool(abs(res.unconditional_mean - y.mean()) < 0.15) True