code: def __init__(self, model, kfilter, smoother_output):
      # Save values
      self.model = model
      self.kfilter = kfilter
      self._kfilter = model._kalman_filter
      self.smoother_output = smoother_output
  
      # Create storage
      self.scaled_smoothed_estimator = None
      self.scaled_smoothed_estimator_cov = None
      self.smoothing_error = None
      self.smoothed_state = None
      self.smoothed_state_cov = None
      self.smoothed_state_disturbance = None
      self.smoothed_state_disturbance_cov = None
      self.smoothed_measurement_disturbance = None
      self.smoothed_measurement_disturbance_cov = None
  
      # Intermediate values
      self.tmp_L = np.zeros(
          (model.k_states, model.k_states, model.nobs),
          dtype=kfilter.dtype,
      )
  
      if smoother_output & (SMOOTHER_STATE | SMOOTHER_DISTURBANCE):
          self.scaled_smoothed_estimator = np.zeros(
              (model.k_states, model.nobs + 1), dtype=kfilter.dtype
          )
          self.smoothing_error = np.zeros(
              (model.k_endog, model.nobs), dtype=kfilter.dtype
          )
      if smoother_output & (
          SMOOTHER_STATE_COV | SMOOTHER_DISTURBANCE_COV
      ):
          self.scaled_smoothed_estimator_cov = np.zeros(
              (model.k_states, model.k_states, model.nobs + 1),
              dtype=kfilter.dtype,
          )
  
      # State smoothing
      if smoother_output & SMOOTHER_STATE:
          self.smoothed_state = np.zeros(
              (model.k_states, model.nobs), dtype=kfilter.dtype
          )
      if smoother_output & SMOOTHER_STATE_COV:
          self.smoothed_state_cov = np.zeros(
              (model.k_states, model.k_states, model.nobs),
              dtype=kfilter.dtype,
          )
  
      # Disturbance smoothing
      if smoother_output & SMOOTHER_DISTURBANCE:
          self.smoothed_state_disturbance = np.zeros(
              (model.k_posdef, model.nobs), dtype=kfilter.dtype
          )
          self.smoothed_measurement_disturbance = np.zeros(
              (model.k_endog, model.nobs), dtype=kfilter.dtype
          )
      if smoother_output & SMOOTHER_DISTURBANCE_COV:
          self.smoothed_state_disturbance_cov = np.zeros(
              (model.k_posdef, model.k_posdef, model.nobs),
              dtype=kfilter.dtype,
          )
          self.smoothed_measurement_disturbance_cov = np.zeros(
              (model.k_endog, model.k_endog, model.nobs),
              dtype=kfilter.dtype,
          )
  
file_path: statsmodels/statsmodels/tsa/statespace/_pykalman_smoother.py
imports: import numpy
label_desc: Use image node_id 1 to create a new _KalmanSmoother object  with example: obj = _KalmanSmoother(model, kfilter, smoother_output)