KimSmootherResult#
- class cultivars.state_space.regime_switching.KimSmootherResult(*, smoothed_prob, smoothed_joint_prob)[source]#
Output of the Kim backward smoother.
The backward pass turns the filtered probabilities into probabilities given the whole sample. With \(\xi_{t \mid T}(j) = \Pr(S_t = j \mid y_{1:T})\),
\[\Pr(S_t = i, S_{t+1} = j \mid y_{1:T}) = \xi_{t \mid t}(i)\, P_{ij}\, \frac{\xi_{t+1 \mid T}(j)}{\xi_{t+1 \mid t}(j)}, \qquad \xi_{t \mid T}(i) = \sum_{j=1}^{K} \Pr(S_t = i, S_{t+1} = j \mid y_{1:T}),\]started from \(\xi_{T \mid T}\), the last filtered vector.
smoothed_probholds the marginals andsmoothed_joint_probthe pairwise terms. The joint terms are what an EM step needs: their sum over \(t\) is the expected number of \(i \to j\) transitions, which is the sufficient statistic for the transition matrix.- Variables:
smoothed_prob (
NDArray[double]) – Full-sample regime probabilities \(\Pr(S_t = j \mid y_{1:T})\), shape(T, K).smoothed_joint_prob (
NDArray[double]) – Consecutive-pair probabilities \(\Pr(S_t = i, S_{t+1} = j \mid y_{1:T})\), shape(T - 1, K, K); entry[t]links period \(t\) to \(t + 1\). Empty whenT == 1. These are the expected-transition weights of the EM M-step.
See also
KimSmootherResult– the public name of this class.MarkovSwitchingSSM.smooth()– returns an instance.MarkovSwitchingSSM.smooth_densities()– returns an instance.RegimeSwitchingLinearSSM.smooth()– returns an instance._kim_smoother()– returns an instance.
Attributes#
Full-sample regime probabilities \(\Pr(S_t = j \mid y_{1:T})\), shape |
|
Consecutive-pair probabilities \(\Pr(S_t = i, S_{t+1} = j \mid y_{1:T})\), shape |