'Kalman filtering
Parameters
params : array_like
Array of parameters at which to evaluate the loglikelihood
function.
transformed : boolean, optional
Whether or not `params` is already transformed. Default is True.
return_ssm : boolean,optional
Whether or not to return only the state space output or a full
results object. Default is to return a full results object.
cov_type : str, optional
See `MLEResults.fit` for a description of covariance matrix types
for results object.
cov_kwds : dict or None, optional
See `MLEResults.get_robustcov_results` for a description required
keywords for alternative covariance estimators
**kwargs
Additional keyword arguments to pass to the Kalman filter. See
`KalmanFilter.filter` for more details.'

def filter(self, params, transformed=True, complex_step=False, cov_type=None, cov_kwds=None, return_ssm=False, results_class=None, results_wrapper_class=None, **kwargs):

    params = np.array(params, ndmin=1)
    if (not transformed):
        params = self.transform_params(params)
    self.update(params, transformed=True, complex_step=complex_step)
    self.data.param_names = self.param_names
    if complex_step:
        kwargs['inversion_method'] = (INVERT_UNIVARIATE | SOLVE_LU)
    result = self.ssm.filter(complex_step=complex_step, **kwargs)
    if (not return_ssm):
        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 = MLEResults
        if (results_wrapper_class is None):
            results_wrapper_class = MLEResultsWrapper
        result = results_wrapper_class(results_class(self, params, result, **result_kwargs))
    return result
