def _deriv_score_obs_dendog(self, params):
    'derivative of score_obs w.r.t. endog\n\n        Parameters\n        ----------\n        params : ndarray\n            parameter at which score is evaluated\n\n        Returns\n        -------\n        derivative : ndarray_2d\n            The derivative of the score_obs with respect to endog.\n        '
    raise NotImplementedError
    from statsmodels.tools.numdiff import _approx_fprime_scalar
    endog_original = self.endog

    def f(y):
        if ((y.ndim == 2) and (y.shape[1] == 1)):
            y = y[:, 0]
        self.endog = y
        self.model_main.endog = y
        sf = self.score_obs(params)
        self.endog = endog_original
        self.model_main.endog = endog_original
        return sf
    ds = _approx_fprime_scalar(self.endog[:, None], f, epsilon=0.01)
    return ds
derivative of score_obs w.r.t. endog

Parameters
----------
params : ndarray
    parameter at which score is evaluated

Returns
-------
derivative : ndarray_2d
    The derivative of the score_obs with respect to endog.
def _deriv_score_obs_dendog(self, params):
    'derivative of score_obs w.r.t. endog\n\n        Parameters\n        ----------\n        params : ndarray\n            parameter at which score is evaluated\n\n        Returns\n        -------\n        derivative : ndarray_2d\n            The derivative of the score_obs with respect to endog.\n        '
    raise NotImplementedError
    from statsmodels.tools.numdiff import _approx_fprime_scalar
    endog_original = self.endog

    def f(y):
        if ((y.ndim == 2) and (y.shape[1] == 1)):
            y = y[:, 0]
        self.endog = y
        self.model_main.endog = y
        sf = self.score_obs(params)
        self.endog = endog_original
        self.model_main.endog = endog_original
        return sf
    ds = _approx_fprime_scalar(self.endog[:, None], f, epsilon=0.01)
    return ds