class_docstr: Results from applying the Kalman smoother and/or filter to a state space
  model.
  
  Parameters
  ----------
  model : Representation
      A Statespace representation
  
  Attributes
  ----------
  nobs : int
      Number of observations.
  k_endog : int
      The dimension of the observation series.
  k_states : int
      The dimension of the unobserved state process.
  k_posdef : int
      The dimension of a guaranteed positive definite covariance matrix
      describing the shocks in the measurement equation.
  dtype : dtype
      Datatype of representation matrices
  prefix : str
      BLAS prefix of representation matrices
  shapes : dictionary of name:tuple
      A dictionary recording the shapes of each of the representation
      matrices as tuples.
  endog : ndarray
      The observation vector.
  design : ndarray
      The design matrix, :math:`Z`.
  obs_intercept : ndarray
      The intercept for the observation equation, :math:`d`.
  obs_cov : ndarray
      The covariance matrix for the observation equation :math:`H`.
  transition : ndarray
      The transition matrix, :math:`T`.
  state_intercept : ndarray
      The intercept for the transition equation, :math:`c`.
  selection : ndarray
      The selection matrix, :math:`R`.
  state_cov : ndarray
      The covariance matrix for the state equation :math:`Q`.
  missing : array of bool
      An array of the same size as `endog`, filled with boolean values that
      are True if the corresponding entry in `endog` is NaN and False
      otherwise.
  nmissing : array of int
      An array of size `nobs`, where the ith entry is the number (between 0
      and k_endog) of NaNs in the ith row of the `endog` array.
  time_invariant : bool
      Whether or not the representation matrices are time-invariant
  initialization : str
      Kalman filter initialization method.
  initial_state : array_like
      The state vector used to initialize the Kalamn filter.
  initial_state_cov : array_like
      The state covariance matrix used to initialize the Kalamn filter.
  filter_method : int
      Bitmask representing the Kalman filtering method
  inversion_method : int
      Bitmask representing the method used to invert the forecast error
      covariance matrix.
  stability_method : int
      Bitmask representing the methods used to promote numerical stability in
      the Kalman filter recursions.
  conserve_memory : int
      Bitmask representing the selected memory conservation method.
  tolerance : float
      The tolerance at which the Kalman filter determines convergence to
      steady-state.
  loglikelihood_burn : int
      The number of initial periods during which the loglikelihood is not
      recorded.
  converged : bool
      Whether or not the Kalman filter converged.
  period_converged : int
      The time period in which the Kalman filter converged.
  filtered_state : ndarray
      The filtered state vector at each time period.
  filtered_state_cov : ndarray
      The filtered state covariance matrix at each time period.
  predicted_state : ndarray
      The predicted state vector at each time period.
  predicted_state_cov : ndarray
      The predicted state covariance matrix at each time period.
  kalman_gain : ndarray
      The Kalman gain at each time period.
  forecasts : ndarray
      The one-step-ahead forecasts of observations at each time period.
  forecasts_error : ndarray
      The forecast errors at each time period.
  forecasts_error_cov : ndarray
      The forecast error covariance matrices at each time period.
  loglikelihood : ndarray
      The loglikelihood values at each time period.
  collapsed_forecasts : ndarray
      If filtering using collapsed observations, stores the one-step-ahead
      forecasts of collapsed observations at each time period.
  collapsed_forecasts_error : ndarray
      If filtering using collapsed observations, stores the one-step-ahead
      forecast errors of collapsed observations at each time period.
  collapsed_forecasts_error_cov : ndarray
      If filtering using collapsed observations, stores the one-step-ahead
      forecast error covariance matrices of collapsed observations at each
      time period.
  standardized_forecast_error : ndarray
      The standardized forecast errors
  smoother_output : int
      Bitmask representing the generated Kalman smoothing output
  scaled_smoothed_estimator : ndarray
      The scaled smoothed estimator at each time period.
  scaled_smoothed_estimator_cov : ndarray
      The scaled smoothed estimator covariance matrices at each time period.
  smoothing_error : ndarray
      The smoothing error covariance matrices at each time period.
  smoothed_state : ndarray
      The smoothed state at each time period.
  smoothed_state_cov : ndarray
      The smoothed state covariance matrices at each time period.
  smoothed_state_autocov : ndarray
      The smoothed state lago-one autocovariance matrices at each time
      period: :math:`Cov(\alpha_{t+1}, \alpha_t)`.
  smoothed_measurement_disturbance : ndarray
      The smoothed measurement at each time period.
  smoothed_state_disturbance : ndarray
      The smoothed state at each time period.
  smoothed_measurement_disturbance_cov : ndarray
      The smoothed measurement disturbance covariance matrices at each time
      period.
  smoothed_state_disturbance_cov : ndarray
      The smoothed state disturbance covariance matrices at each time period.
docstr: Update the smoother results
  
  Parameters
  ----------
  smoother : KalmanSmoother
      The model object from which to take the updated values.
  
  Notes
  -----
  This method is rarely required except for internal usage.
docstr_tok: ["Update","the","smoother","results","Parameters","--","--","--","--","--","smoother",":","KalmanSmoother","The","model","object","from","which","to","take","the","updated","values",".","Notes","--","--","-","This","method","is","rarely","required","except","for","internal","usage","."]
code: def update_smoother(self, smoother):
      """
      Update the smoother results
  
      Parameters
      ----------
      smoother : KalmanSmoother
          The model object from which to take the updated values.
  
      Notes
      -----
      This method is rarely required except for internal usage.
      """
      # Copy the appropriate output
      attributes = []
  
      # Since update_representation will already have been called, we can
      # use the boolean options smoother_* and know they match the smoother
      # itself
      if self.smoother_state or self.smoother_disturbance:
          attributes.append("scaled_smoothed_estimator")
      if self.smoother_state_cov or self.smoother_disturbance_cov:
          attributes.append("scaled_smoothed_estimator_cov")
      if self.smoother_state:
          attributes.append("smoothed_state")
      if self.smoother_state_cov:
          attributes.append("smoothed_state_cov")
      if self.smoother_state_autocov:
          attributes.append("smoothed_state_autocov")
      if self.smoother_disturbance:
          attributes += [
              "smoothing_error",
              "smoothed_measurement_disturbance",
              "smoothed_state_disturbance",
          ]
      if self.smoother_disturbance_cov:
          attributes += [
              "smoothed_measurement_disturbance_cov",
              "smoothed_state_disturbance_cov",
          ]
  
      has_missing = np.sum(self.nmissing) > 0
      for name in self._smoother_attributes:
          if name == "smoother_output":
              pass
          elif name in attributes:
              if name in [
                  "smoothing_error",
                  "smoothed_measurement_disturbance",
              ]:
                  vector = getattr(smoother, name, None)
                  if vector is not None and has_missing:
                      vector = np.array(
                          reorder_missing_vector(
                              vector, self.missing, prefix=self.prefix
                          )
                      )
                  else:
                      vector = np.array(vector, copy=True)
                  setattr(self, name, vector)
              elif name == "smoothed_measurement_disturbance_cov":
                  matrix = getattr(smoother, name, None)
                  if matrix is not None and has_missing:
                      matrix = reorder_missing_matrix(
                          matrix,
                          self.missing,
                          reorder_rows=True,
                          reorder_cols=True,
                          prefix=self.prefix,
                      )
                      # In the missing data case, we want to set the missing
                      # components equal to their unconditional distribution
                      copy_index_matrix(
                          self.obs_cov,
                          matrix,
                          self.missing,
                          index_rows=True,
                          index_cols=True,
                          inplace=True,
                          prefix=self.prefix,
                      )
                  else:
                      matrix = np.array(matrix, copy=True)
                  setattr(self, name, matrix)
              else:
                  setattr(
                      self,
                      name,
                      np.array(
                          getattr(smoother, name, None), copy=True
                      ),
                  )
          else:
              setattr(self, name, None)
  
      self.innovations_transition = np.array(
          smoother.innovations_transition, copy=True
      )
  
      # Diffuse objects
      self.scaled_smoothed_diffuse_estimator = None
      self.scaled_smoothed_diffuse1_estimator_cov = None
      self.scaled_smoothed_diffuse2_estimator_cov = None
      if self.nobs_diffuse > 0:
          self.scaled_smoothed_diffuse_estimator = np.array(
              smoother.scaled_smoothed_diffuse_estimator, copy=True
          )
          self.scaled_smoothed_diffuse1_estimator_cov = np.array(
              smoother.scaled_smoothed_diffuse1_estimator_cov, copy=True
          )
          self.scaled_smoothed_diffuse2_estimator_cov = np.array(
              smoother.scaled_smoothed_diffuse2_estimator_cov, copy=True
          )
  
      # Adjustments
  
      # For r_t (and similarly for N_t), what was calculated was
      # r_T, ..., r_{-1}. We only want r_0, ..., r_T
      # so exclude the appropriate element so that the time index is
      # consistent with the other returned output
      # r_t stored such that scaled_smoothed_estimator[0] == r_{-1}
      start = 1
      end = None
      if "scaled_smoothed_estimator" in attributes:
          self.scaled_smoothed_estimator_presample = (
              self.scaled_smoothed_estimator[:, 0]
          )
          self.scaled_smoothed_estimator = (
              self.scaled_smoothed_estimator[:, start:end]
          )
      if "scaled_smoothed_estimator_cov" in attributes:
          self.scaled_smoothed_estimator_cov_presample = (
              self.scaled_smoothed_estimator_cov[:, :, 0]
          )
          self.scaled_smoothed_estimator_cov = (
              self.scaled_smoothed_estimator_cov[:, :, start:end]
          )
  
      # Clear the smoothed forecasts
      self._smoothed_forecasts = None
      self._smoothed_forecasts_error = None
      self._smoothed_forecasts_error_cov = None
  
      # Note: if we concentrated out the scale, need to adjust the
      # loglikelihood values and all of the covariance matrices and the
      # values that depend on the covariance matrices
      if self.filter_concentrated and self.model._scale is None:
          self.smoothed_state_cov *= self.scale
          self.smoothed_state_autocov *= self.scale
          self.smoothed_state_disturbance_cov *= self.scale
          self.smoothed_measurement_disturbance_cov *= self.scale
          self.scaled_smoothed_estimator_presample /= self.scale
          self.scaled_smoothed_estimator /= self.scale
          self.scaled_smoothed_estimator_cov_presample /= self.scale
          self.scaled_smoothed_estimator_cov /= self.scale
          self.smoothing_error /= self.scale
  
      # Cache
      self.__smoothed_state_autocovariance = {}
  
imports: import numpy
  from types import SimpleNamespace
  from statsmodels.tsa.statespace.representation import OptionWrapper
  from statsmodels.tsa.statespace.kalman_filter import KalmanFilter, FilterResults
  from statsmodels.tsa.statespace.tools import reorder_missing_matrix, reorder_missing_vector, copy_index_matrix
  from statsmodels.tsa.statespace import tools, initialization
label_desc: Use image node_id 2 for calling the SmootherResults obj's underlying member method code with example usage: obj.update_smoother(smoother) without return types