

@classmethod
def setupClass(cls):
    cls.kvars = 10
    cls.m = 7
    rand_data = sm.datasets.randhie.load()
    rand_exog = rand_data.exog.view(float).reshape(len(rand_data.exog), (- 1))
    rand_exog = sm.add_constant(rand_exog, prepend=True)
    exog_no_PSI = rand_exog[:, :cls.m]
    mod_unreg = sm.NegativeBinomial(rand_data.endog, exog_no_PSI, loglike_method='geometric')
    cls.res_unreg = mod_unreg.fit(method='newton', disp=False)
    alpha = ((10 * len(rand_data.endog)) * np.ones(cls.kvars))
    alpha[:cls.m] = 0
    mod_reg = sm.NegativeBinomial(rand_data.endog, rand_exog, loglike_method='geometric')
    cls.res_reg = mod_reg.fit_regularized(method='l1', alpha=alpha, disp=False, acc=1e-10, maxiter=2000, trim_mode='auto')
    assert_equal(mod_reg.loglike_method, 'geometric')

dataset/ETHPy150Open statsmodels/statsmodels/statsmodels/discrete/tests/test_discrete.py TestNegativeBinomialGeoL1Compatability.setupClass/original