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
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