def score(self, params, *args, **kwargs):
        params = np.array(params, ndmin=1)

        # We were given one positional argument if this was called by a Scipy
        # optimization routine
        if len(args) > 0:
            argnames = ['transformed', 'method', 'approx_complex_step',
                        'approx_centered']
            # the fit() method will pass a dictionary
            if isinstance(args[0], dict):
                flags = args[0]
                flags['method'] = flags.get('score_method', 'approx')
            # otherwise, a user may have just used positional arguments...
            else:
                flags = dict(zip(argnames, args))
            transformed = flags.get('transformed', True)
            method = flags.get('method', 'approx')
            approx_complex_step = flags.get('approx_complex_step', None)
            approx_centered = flags.get('approx_centered', True)

            for name, value in flags.items():
                if name in kwargs:
                    raise TypeError("score() got multiple values for keyword"
                                    " argument '%s'" % name)
        else:
            transformed = kwargs.pop('transformed', True)
            method = kwargs.pop('method', 'approx')
            approx_complex_step = kwargs.pop('approx_complex_step', None)
            approx_centered = kwargs.pop('approx_centered', False)

        if approx_complex_step is None:
            approx_complex_step = not self.ssm._complex_endog
        if approx_complex_step and self.ssm._complex_endog:
            raise ValueError('Cannot use complex step derivatives when data'
                             ' or parameters are complex.')

        if not transformed:
            transform_score = self.transform_jacobian(params)
            params = self.transform_params(params)

        if method == 'harvey':
            score = self._score_harvey(
                params, approx_complex_step=approx_complex_step, **kwargs)
        elif method == 'approx' and approx_complex_step:
            score = self._score_complex_step(params, **kwargs)
        elif method == 'approx':
            score = self._score_finite_difference(
                params, approx_centered=approx_centered, **kwargs)
        else:
            raise NotImplementedError('Invalid score method.')

        if not transformed:
            score = np.dot(transform_score, score)

        return score
Compute the score function at params.
dataset/ETHPy150Open statsmodels/statsmodels/statsmodels/tsa/statespace/mlemodel.py/MLEModel.score