'Update the filter results
Parameters
kalman_filter : statespace.kalman_filter.KalmanFilter
The model object from which to take the updated values.
Notes
This method is rarely required except for internal usage.'

def update_filter(self, kalman_filter):

    self.initial_state = np.array(kalman_filter.model.initial_state, copy=True)
    self.initial_state_cov = np.array(kalman_filter.model.initial_state_cov, copy=True)
    self.filter_method = kalman_filter.filter_method
    self.inversion_method = kalman_filter.inversion_method
    self.stability_method = kalman_filter.stability_method
    self.conserve_memory = kalman_filter.conserve_memory
    self.filter_timing = kalman_filter.filter_timing
    self.tolerance = kalman_filter.tolerance
    self.loglikelihood_burn = kalman_filter.loglikelihood_burn
    self.converged = bool(kalman_filter.converged)
    self.period_converged = kalman_filter.period_converged
    self.filtered_state = np.array(kalman_filter.filtered_state, copy=True)
    self.filtered_state_cov = np.array(kalman_filter.filtered_state_cov, copy=True)
    self.predicted_state = np.array(kalman_filter.predicted_state, copy=True)
    self.predicted_state_cov = np.array(kalman_filter.predicted_state_cov, copy=True)
    has_missing = (np.sum(self.nmissing) > 0)
    if ((not self._compatibility_mode) and (not (self.memory_no_std_forecast or self.invert_lu or self.solve_lu or self.filter_collapsed))):
        if has_missing:
            self._standardized_forecasts_error = np.array(reorder_missing_vector(kalman_filter.standardized_forecast_error, self.missing, prefix=self.prefix))
        else:
            self._standardized_forecasts_error = np.array(kalman_filter.standardized_forecast_error, copy=True)
    else:
        self._standardized_forecasts_error = None
    if (not self._compatibility_mode):
        if (has_missing and ((not self.memory_no_gain) and (not self.filter_collapsed))):
            self._kalman_gain = np.array(reorder_missing_matrix(kalman_filter.kalman_gain, self.missing, reorder_cols=True, prefix=self.prefix))
            self.tmp1 = np.array(reorder_missing_matrix(kalman_filter.tmp1, self.missing, reorder_cols=True, prefix=self.prefix))
            self.tmp2 = np.array(reorder_missing_vector(kalman_filter.tmp2, self.missing, prefix=self.prefix))
            self.tmp3 = np.array(reorder_missing_matrix(kalman_filter.tmp3, self.missing, reorder_rows=True, prefix=self.prefix))
            self.tmp4 = np.array(reorder_missing_matrix(kalman_filter.tmp4, self.missing, reorder_cols=True, reorder_rows=True, prefix=self.prefix))
        else:
            self._kalman_gain = np.array(kalman_filter.kalman_gain, copy=True)
            self.tmp1 = np.array(kalman_filter.tmp1, copy=True)
            self.tmp2 = np.array(kalman_filter.tmp2, copy=True)
            self.tmp3 = np.array(kalman_filter.tmp3, copy=True)
            self.tmp4 = np.array(kalman_filter.tmp4, copy=True)
    else:
        self._kalman_gain = None
    self.forecasts = np.array(kalman_filter.forecast, copy=True)
    self.forecasts_error = np.array(kalman_filter.forecast_error, copy=True)
    self.forecasts_error_cov = np.array(kalman_filter.forecast_error_cov, copy=True)
    self.llf_obs = np.array(kalman_filter.loglikelihood, copy=True)
    self.missing_forecasts = None
    self.missing_forecasts_error = None
    self.missing_forecasts_error_cov = None
    if (np.sum(self.nmissing) > 0):
        self.missing_forecasts = np.copy(self.forecasts)
        self.missing_forecasts_error = np.copy(self.forecasts_error)
        self.missing_forecasts_error_cov = np.copy(self.forecasts_error_cov)
    self.collapsed_forecasts = None
    self.collapsed_forecasts_error = None
    self.collapsed_forecasts_error_cov = None
    if self.filter_collapsed:
        self.collapsed_forecasts = self.forecasts[:self.k_states, :]
        self.collapsed_forecasts_error = self.forecasts_error[:self.k_states, :]
        self.collapsed_forecasts_error_cov = self.forecasts_error_cov[:self.k_states, :self.k_states, :]
        self.forecasts = np.zeros((self.k_endog, self.nobs))
        self.forecasts_error = np.zeros((self.k_endog, self.nobs))
        self.forecasts_error_cov = np.zeros((self.k_endog, self.k_endog, self.nobs))
    if (not (self.memory_no_forecast or self.memory_no_predicted)):
        for t in range(self.nobs):
            design_t = (0 if (self.design.shape[2] == 1) else t)
            obs_cov_t = (0 if (self.obs_cov.shape[2] == 1) else t)
            obs_intercept_t = (0 if (self.obs_intercept.shape[1] == 1) else t)
            if (self.nmissing[t] > 0):
                mask = (~ self.missing[:, t].astype(bool))
                self.forecasts[:, t] = (np.dot(self.design[:, :, design_t], self.predicted_state[:, t]) + self.obs_intercept[:, obs_intercept_t])
                self.forecasts_error[:, t] = np.nan
                self.forecasts_error[(mask, t)] = (self.endog[(mask, t)] - self.forecasts[(mask, t)])
                self.forecasts_error_cov[:, :, t] = (np.dot(np.dot(self.design[:, :, design_t], self.predicted_state_cov[:, :, t]), self.design[:, :, design_t].T) + self.obs_cov[:, :, obs_cov_t])
            elif self.filter_collapsed:
                self.forecasts[:, t] = (np.dot(self.design[:, :, design_t], self.predicted_state[:, t]) + self.obs_intercept[:, obs_intercept_t])
                self.forecasts_error[:, t] = (self.endog[:, t] - self.forecasts[:, t])
                self.forecasts_error_cov[:, :, t] = (np.dot(np.dot(self.design[:, :, design_t], self.predicted_state_cov[:, :, t]), self.design[:, :, design_t].T) + self.obs_cov[:, :, obs_cov_t])
