ssfortran.FilterResults#
- class ssfortran.FilterResults(llf, llf_obs, nobs_diffuse, k_diffuse, t_steady, predicted_state, predicted_state_cov, predicted_diffuse_state_cov, filtered_state, filtered_state_cov, forecasts, forecasts_error, forecasts_error_cov, forecasts_error_diffuse_cov, forecasts_error_cov_inv, kalman_gain, standardized_forecasts_error, diagnostic_start)#
Output of the Kalman filter (DK §4.3, §5.2).
Arrays have time as the last axis and 0-based periods: column
tofpredicted_stateis \(a_{t+1}\) in DK’s 1-based notation, and its last column is the one-step prediction past the sample.- Attributes:
- llffloat
Log likelihood (DK eq. 7.2); the diffuse log likelihood (DK §7.2.2) with diffuse states.
- llf_obsndarray, shape (n,)
Contribution of each period to llf.
- nobs_diffuseint
Number of periods with a diffuse state (DK’s d).
- k_diffuseint
Rank of the diffuse part of the initial variance.
- t_steadyint
First period (1-based) that used the steady-state shortcut, or 0.
- predicted_statendarray, shape (m, n+1)
\(a_t = E(\alpha_t | y_1, \dots, y_{t-1})\).
- predicted_state_covndarray, shape (m, m, n+1)
\(P_t\), or \(P_{*,t}\) in diffuse periods.
- predicted_diffuse_state_covndarray, shape (m, m, n+1)
\(P_{\infty,t}\); zero after the diffuse periods.
- filtered_statendarray, shape (m, n)
\(a_{t|t}\) (DK eq. 4.24).
- filtered_state_covndarray, shape (m, m, n)
\(P_{t|t}\).
- forecastsndarray, shape (p, n)
One-step predictions \(d_t + Z_t a_t\).
- forecasts_errorndarray, shape (p, n)
Innovations \(v_t\); NaN where y is missing.
- forecasts_error_covndarray, shape (p, p, n)
\(F_t\), in the original coordinates also in univariate periods.
- forecasts_error_diffuse_covndarray, shape (p, p, n)
\(F_{\infty,t} = Z_t P_{\infty,t} Z_t'\).
- forecasts_error_cov_invndarray, shape (p, p, n)
\(F_t^{-1}\) over the observed elements, zero-padded; NaN in periods processed element by element.
- kalman_gainndarray, shape (m, p, n)
\(K_t = T_t P_t Z_t' F_t^{-1}\); NaN in periods processed element by element.
- standardized_forecasts_errorndarray, shape (p, n)
\(L_t^{-1} v_t\) with \(F_t = L_t L_t'\) (DK §7.5); NaN where missing or diffuse.
- diagnostic_startint
First 0-based period after the burn-in and the diffuse periods.