MarkovSwitchingSSM#

cultivars.state_space.regime_switching.MarkovSwitchingSSM[source]#

alias of _MarkovSwitchingStateSpace

Attributes#

ar_params

Per-regime autoregressive coefficients, shape (K, p).

initial_prob

Distribution of the regime at the first modelled observation.

intercepts

Per-regime intercepts.

k_endog

Observed dimension; one, since the chain drives a scalar series.

k_states

the number of regimes.

n_regimes

The number of regimes, named as the chain rather than as a dimension.

order

Autoregressive order of the per-regime observation equation.

transition

The row-stochastic regime transition matrix.

variances

Per-regime innovation variances.

Methods#

conditional_means(lags)

Per-regime conditional means E[y_t | S_t = j, lags].

density_matrix(target, lags)

The (T_eff, K) log-density matrix the recursions consume.

effective_sample(y)

Split a series into the modelled target and its lag block.

filter(y)

Filter a series, returning regime probabilities and the likelihood.

filter_densities(log_density)

Run the Hamilton filter over an already-built density matrix.

log_densities(target, means)

Gaussian log conditional densities, one column per regime.

loglikelihood(y)

The exact log-likelihood of a series under this system.

smooth(y)

Filter, then smooth, returning full-sample regime probabilities.

smooth_densities(filtered)

Run the Kim smoother over a completed forward pass.