class_docstr: State space representation of a time series process, with Kalman filter
  and smoother.
  
  Parameters
  ----------
  k_endog : {array_like, int}
      The observed time-series process :math:`y` if array like or the
      number of variables in the process if an integer.
  k_states : int
      The dimension of the unobserved state process.
  k_posdef : int, optional
      The dimension of a guaranteed positive definite covariance matrix
      describing the shocks in the measurement equation. Must be less than
      or equal to `k_states`. Default is `k_states`.
  results_class : class, optional
      Default results class to use to save filtering output. Default is
      `SmootherResults`. If specified, class must extend from
      `SmootherResults`.
  **kwargs
      Keyword arguments may be used to provide default values for state space
      matrices, for Kalman filtering options, or for Kalman smoothing
      options. See `Representation` for more details.
docstr: Apply the Kalman smoother to the statespace model.
  
  Parameters
  ----------
  smoother_output : int, optional
      Determines which Kalman smoother output calculate. Default is all
      (including state, disturbances, and all covariances).
  results : class or object, optional
      If a class, then that class is instantiated and returned with the
      result of both filtering and smoothing.
      If an object, then that object is updated with the smoothing data.
      If None, then a SmootherResults object is returned with both
      filtering and smoothing results.
  run_filter : bool, optional
      Whether or not to run the Kalman filter prior to smoothing. Default
      is True.
  prefix : str
      The prefix of the datatype. Usually only used internally.
  
  Returns
  -------
  SmootherResults object
docstr_tok: ["Apply","the","Kalman","smoother","to","the","statespace","model",".","Parameters","--","--","--","--","--","smoother_output",":","int",",","optional","Determines","which","Kalman","smoother","output","calculate",".","Default","is","all","(","including","state",",","disturbances",",","and","all","covariances",")",".","results",":","class","or","object",",","optional","If","a","class",",","then","that","class","is","instantiated","and","returned","with","the","result","of","both","filtering","and","smoothing",".","If","an","object",",","then","that","object","is","updated","with","the","smoothing","data",".","If","None",",","then","a","SmootherResults","object","is","returned","with","both","filtering","and","smoothing","results",".","run_filter",":","bool",",","optional","Whether","or","not","to","run","the","Kalman","filter","prior","to","smoothing",".","Default","is","True",".","prefix",":","str","The","prefix","of","the","datatype",".","Usually","only","used","internally",".","Returns","--","--","--","-","SmootherResults","object"]
code: def smooth(
      self,
      smoother_output=None,
      smooth_method=None,
      results=None,
      run_filter=True,
      prefix=None,
      complex_step=False,
      update_representation=True,
      update_filter=True,
      update_smoother=True,
      **kwargs,
  ):
      """
      Apply the Kalman smoother to the statespace model.
  
      Parameters
      ----------
      smoother_output : int, optional
          Determines which Kalman smoother output calculate. Default is all
          (including state, disturbances, and all covariances).
      results : class or object, optional
          If a class, then that class is instantiated and returned with the
          result of both filtering and smoothing.
          If an object, then that object is updated with the smoothing data.
          If None, then a SmootherResults object is returned with both
          filtering and smoothing results.
      run_filter : bool, optional
          Whether or not to run the Kalman filter prior to smoothing. Default
          is True.
      prefix : str
          The prefix of the datatype. Usually only used internally.
  
      Returns
      -------
      SmootherResults object
      """
  
      # Run the filter
      kfilter = self._filter(**kwargs)
  
      # Create the results object
      results = self.results_class(self)
      if update_representation:
          results.update_representation(self)
      if update_filter:
          results.update_filter(kfilter)
      else:
          # (even if we don't update all filter results, still need to
          # update this)
          results.nobs_diffuse = kfilter.nobs_diffuse
  
      # Run the smoother
      if smoother_output is None:
          smoother_output = self.smoother_output
      smoother = self._smooth(
          smoother_output, results=results, **kwargs
      )
  
      # Update the results
      if update_smoother:
          results.update_smoother(smoother)
  
      return results
  
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 8 for calling the KalmanSmoother obj's underlying member method code with example usage: obj.smooth(smoother_output, smooth_method, results, run_filter, prefix, complex_step, update_representation, update_filter, update_smoother) and returns: results