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        '
    from statsmodels.tools.numdiff import _approx_fprime_cs_scalar

    def f(y):
        if ((y.ndim == 2) and (y.shape[1] == 1)):
            y = y[:, 0]
        sf = self.score_factor(params, endog=y)
        return np.column_stack(sf)
    dsf = _approx_fprime_cs_scalar(self.endog[:, None], f)
    d1 = (dsf[:, :1] * self.exog)
    d2 = (dsf[:, 1:2] * self.exog_precision)
    return np.column_stack((d1, d2))
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        '
    from statsmodels.tools.numdiff import _approx_fprime_cs_scalar

    def f(y):
        if ((y.ndim == 2) and (y.shape[1] == 1)):
            y = y[:, 0]
        sf = self.score_factor(params, endog=y)
        return np.column_stack(sf)
    dsf = _approx_fprime_cs_scalar(self.endog[:, None], f)
    d1 = (dsf[:, :1] * self.exog)
    d2 = (dsf[:, 1:2] * self.exog_precision)
    return np.column_stack((d1, d2))