'Apply the Kim smoother and Hamilton filter
Parameters
params : array_like
Array of parameters at which to perform filtering.
transformed : boolean, optional
Whether or not `params` is already transformed. Default is True.
cov_type : str, optional
See `fit` for a description of covariance matrix types
for results object.
cov_kwds : dict or None, optional
See `fit` for a description of required keywords for alternative
covariance estimators
return_raw : boolean,optional
Whether or not to return only the raw Hamilton filter output or a
full results object. Default is to return a full results object.
results_class : type, optional
A results class to instantiate rather than
`MarkovSwitchingResults`. Usually only used internally by
subclasses.
results_wrapper_class : type, optional
A results wrapper class to instantiate rather than
`MarkovSwitchingResults`. Usually only used internally by
subclasses.
Returns
MarkovSwitchingResults'

def smooth(self, params, transformed=True, cov_type=None, cov_kwds=None, return_raw=False, results_class=None, results_wrapper_class=None):

    params = np.array(params, ndmin=1)
    if (not transformed):
        params = self.transform_params(params)
    self.data.param_names = self.param_names
    names = ['regime_transition', 'initial_probabilities', 'conditional_likelihoods', 'filtered_marginal_probabilities', 'predicted_joint_probabilities', 'joint_likelihoods', 'filtered_joint_probabilities']
    result = Bunch(**dict(zip(names, self._filter(params))))
    out = self._smooth(params, result.filtered_marginal_probabilities, result.predicted_joint_probabilities, result.filtered_joint_probabilities)
    result['smoothed_joint_probabilities'] = out[0]
    result['smoothed_marginal_probabilities'] = out[1]
    result = KimSmootherResults(self, result)
    if (not return_raw):
        result_kwargs = {}
        if (cov_type is not None):
            result_kwargs['cov_type'] = cov_type
        if (cov_kwds is not None):
            result_kwargs['cov_kwds'] = cov_kwds
        if (results_class is None):
            results_class = MarkovSwitchingResults
        if (results_wrapper_class is None):
            results_wrapper_class = MarkovSwitchingResultsWrapper
        result = results_wrapper_class(results_class(self, params, result, **result_kwargs))
    return result
