MarkovSwitchingDFMResult.expected_durations#

MarkovSwitchingDFMResult.expected_durations()[source]#

Expected regime durations 1 / (1 - p_jj), low state first.

Return type:

NDArray[double]

Returns:

A (2,) array in periods.

Example

>>> import numpy as np
>>> res = MarkovSwitchingDFMResult(
...     panel=np.zeros((80, 3)), series_names=("ip", "emp", "sales"),
...     loadings=np.array([1.0, 0.8, 1.2]), idiosyncratic_var=np.full(3, 0.3),
...     phi=0.6, sigma_v=0.5, mu=np.array([-1.5, 0.5]),
...     regime_transition=np.array([[0.8, 0.2], [0.05, 0.95]]),
...     factor=np.zeros(80), filtered_prob=np.full((80, 2), 0.5),
...     smoothed_prob=np.tile([0.1, 0.9], (80, 1)), means=np.zeros(3),
...     scales=np.ones(3), llf=-100.0, n_params=11, converged=True,
... )
>>> res.expected_durations().round(1)
array([ 5., 20.])