# statsmodels.tsa.statespace.kalman_smoother.SmootherResults.get_smoothed_decomposition¶

SmootherResults.get_smoothed_decomposition(decomposition_of='smoothed_state', state_index=None)[source]

Decompose smoothed output into contributions from observations

Parameters
decomposition_of{“smoothed_state”, “smoothed_signal”}

The object to perform a decomposition of. If it is set to “smoothed_state”, then the elements of the smoothed state vector are decomposed into the contributions of each observation. If it is set to “smoothed_signal”, then the predictions of the observation vector based on the smoothed state vector are decomposed. Default is “smoothed_state”.

state_indexarray_like, optional

An optional index specifying a subset of states to use when constructing the decomposition of the “smoothed_signal”. For example, if state_index=[0, 1] is passed, then only the contributions of observed variables to the smoothed signal arising from the first two states will be returned. Note that if not all states are used, the contributions will not sum to the smoothed signal. Default is to use all states.

Returns
data_contributionsarray

Contributions of observations to the decomposed object. If the smoothed state is being decomposed, then data_contributions are shaped (nobs, k_states, nobs, k_endog), where the (t, m, j, p)-th element is the contribution of the p-th observation at time j to the m-th state at time t. If the smoothed signal is being decomposed, then data_contributions are shaped (nobs, k_endog, nobs, k_endog), where the (t, k, j, p)-th element is the contribution of the p-th observation at time j to the smoothed prediction of the k-th observation at time t.

obs_intercept_contributionsarray

Contributions of the observation intercept to the decomposed object. If the smoothed state is being decomposed, then obs_intercept_contributions are shaped (nobs, k_states, nobs, k_endog), where the (t, m, j, p)-th element is the contribution of the p-th observation intercept at time j to the m-th state at time t. If the smoothed signal is being decomposed, then obs_intercept_contributions are shaped (nobs, k_endog, nobs, k_endog), where the (t, k, j, p)-th element is the contribution of the p-th observation at time j to the smoothed prediction of the k-th observation at time t.

state_intercept_contributionsarray

Contributions of the state intercept to the decomposed object. If the smoothed state is being decomposed, then state_intercept_contributions are shaped (nobs, k_states, nobs, k_states), where the (t, m, j, l)-th element is the contribution of the l-th state intercept at time j to the m-th state at time t. If the smoothed signal is being decomposed, then state_intercept_contributions are shaped (nobs, k_endog, nobs, k_endog), where the (t, k, j, l)-th element is the contribution of the p-th observation at time j to the smoothed prediction of the k-th observation at time t.

prior_contributionsarray

Contributions of the prior to the decomposed object. If the smoothed state is being decomposed, then prior_contributions are shaped (nobs, k_states, k_states), where the (t, m, l)-th element is the contribution of the l-th element of the prior mean to the m-th state at time t. If the smoothed signal is being decomposed, then prior_contributions are shaped (nobs, k_endog, k_states), where the (t, k, l)-th element is the contribution of the l-th element of the prior mean to the smoothed prediction of the k-th observation at time t.

Notes

Denote the smoothed state at time $$t$$ by $$\alpha_t$$. Then the smoothed signal is $$Z_t \alpha_t$$, where $$Z_t$$ is the design matrix operative at time $$t$$.