statsmodels.tsa.statespace.sarimax.SARIMAXResults.get_smoothed_decomposition¶
-
SARIMAXResults.get_smoothed_decomposition(decomposition_of=
'smoothed_state', state_index=None)¶ 将平滑输出分解为来自观测值的贡献
- Parameters:¶
- decomposition_of{“smoothed_state”, “smoothed_signal”}
要进行分解的对象。如果设置为“smoothed_state”,则平滑状态向量的元素将被分解为每个观测值的贡献。如果设置为“smoothed_signal”,则基于平滑状态向量的观测向量预测将被分解。默认值为“smoothed_state”。
- state_indexarray_like,
optional 一个可选的索引,用于指定在构建“smoothed_signal”分解时使用的部分状态。例如,如果传递了state_index=[0, 1],则只会返回由前两个状态引起的观测变量对平滑信号的贡献。请注意,如果未使用所有状态,则贡献总和将不等于平滑信号。默认情况下使用所有状态。
- Returns:¶
- data_contributions
pd.DataFrame 观测值对分解对象的贡献。如果正在分解平滑状态,那么 data_contributions 的形状为 (k_states x nobs, k_endog x nobs),索引为 pd.MultiIndex,对应于 state_to x date_to,列也为 pd.MultiIndex,对应于 variable_from x date_from。如果正在分解平滑信号,那么 data_contributions 的形状为 (k_endog x nobs, k_endog x nobs),索引和列均为 pd.MultiIndex,分别对应于 variable_to x date_to 和 variable_from x date_from。
- obs_intercept_contributions
pd.DataFrame 观测截距对分解对象的贡献。如果正在分解平滑状态,那么 obs_intercept_contributions 的形状为 (k_states x nobs, k_endog x nobs),具有对应于 state_to x date_to 的 pd.MultiIndex 索引和对应于 obs_intercept_from x date_from 的 pd.MultiIndex 列。如果正在分解平滑信号,那么 obs_intercept_contributions 的形状为 (k_endog x nobs, k_endog x nobs),具有对应于 variable_to x date_to 和 obs_intercept_from x date_from 的 pd.MultiIndex。
- state_intercept_contributions
pd.DataFrame 状态截距对分解对象的贡献。如果正在分解平滑状态,那么 state_intercept_contributions 的形状为 (k_states x nobs, k_states x nobs),具有一个 pd.MultiIndex 索引,对应于 state_to x date_to 和 pd.MultiIndex 列,对应于 state_intercept_from x date_from。如果正在分解平滑信号,那么 state_intercept_contributions 的形状为 (k_endog x nobs, k_states x nobs),具有 pd.MultiIndex, 对应于 variable_to x date_to 和 state_intercept_from x date_from。
- prior_contributions
pd.DataFrame 先验对分解对象的贡献。如果正在分解平滑状态,那么prior_contributions的形状为(nobs x k_states, k_states),具有与state_to x date_to对应的pd.MultiIndex索引,列对应于先验均值的元素(也称为“初始状态”)。如果正在分解平滑信号,那么prior_contributions的形状为(nobs x k_endog, k_states),具有与variable_to x date_to对应的pd.MultiIndex索引,列对应于先验均值的元素。
- data_contributions
注释
表示在时间 \(t\) 的平滑状态为 \(\alpha_t\)。那么 平滑信号为 \(Z_t \alpha_t\),其中 \(Z_t\) 是 在时间 \(t\) 起作用的设计矩阵。