def setupClass(cls): from results.results_discrete import Anes data = sm.datasets.anes96.load() cls.data = data exog = data.exog exog = sm.add_constant(exog, prepend=False) cls.res1 = MNLogit(data.endog, exog).fit(method="newton", disp=0) res2 = Anes() res2.mnlogit_basezero() cls.res2 = res2
def setupClass(cls): from results.results_discrete import Anes data = sm.datasets.anes96.load() exog = data.exog exog[:, 0] = np.log(exog[:, 0] + .1) exog = np.column_stack((exog[:, 0], exog[:, 2], exog[:, 5:8])) exog = sm.add_constant(exog) cls.res1 = MNLogit(data.endog, exog).fit(method="newton", disp=0) res2 = Anes() res2.mnlogit_basezero() cls.res2 = res2
def setupClass(cls): from results.results_discrete import Anes data = sm.datasets.anes96.load() exog = data.exog exog[:,0] = np.log(exog[:,0] + .1) exog = np.column_stack((exog[:,0],exog[:,2], exog[:,5:8])) exog = sm.add_constant(exog) cls.res1 = MNLogit(data.endog, exog).fit(method="newton", disp=0) res2 = Anes() res2.mnlogit_basezero() cls.res2 = res2
def setupClass(cls): from results.results_discrete import Anes data = sm.datasets.anes96.load() cls.data = data exog = data.exog exog = sm.add_constant(exog, prepend=False) mymodel = MNLogit(data.endog, exog) cls.res1 = mymodel.fit(method="lbfgs", disp=0, maxiter=50000, #m=12, pgtol=1e-7, factr=1e3, # 5 failures #m=20, pgtol=1e-8, factr=1e2, # 3 failures #m=30, pgtol=1e-9, factr=1e1, # 1 failure m=40, pgtol=1e-10, factr=5e0, loglike_and_score=mymodel.loglike_and_score) res2 = Anes() res2.mnlogit_basezero() cls.res2 = res2