Skip to content

Commit

Permalink
Made some options explicit in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
langmore authored and josef-pkt committed Sep 14, 2012
1 parent 2685d0e commit aa44c81
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions statsmodels/discrete/tests/test_discrete.py
Expand Up @@ -388,15 +388,17 @@ def setupClass(self):
self.data.exog = sm.add_constant(self.data.exog, prepend=True)
self.alpha = 3 * np.array([0, 1, 1, 1])
self.res1 = Logit(self.data.endog, self.data.exog).fit(
method="l1", alpha=self.alpha, disp=0, acc=1e-10)
method="l1", alpha=self.alpha, disp=0, acc=1e-10, maxiter=500,
trim_params=True, trim_tol='auto')

def test_cvxopt(self):
"""
Compares resutls from csxopt to the standard slsqp
"""
if has_cvxopt:
res3 = Logit(self.data.endog, self.data.exog).fit(
method="l1_cvxopt_cp", alpha=self.alpha, disp=0, abstol=1e-10)
method="l1_cvxopt_cp", alpha=self.alpha, disp=0, abstol=1e-10,
trim_params=True, trim_tol='auto', maxiter=100)
assert_almost_equal(self.res1.params, res3.params, DECIMAL_4)
else:
raise SkipTest("Skipped test_cvxopt since cvxopt is not available")
Expand All @@ -410,7 +412,7 @@ def setupClass(cls):
cls.alpha = 3 * np.array([0, 1, 1, 1])
cls.res1 = Logit(data.endog, data.exog).fit(
method="l1", alpha=cls.alpha, disp=0, trim_params=True,
trim_tol=1e-5, acc=1e-10)
trim_tol=1e-5, acc=1e-10, maxiter=500)
res2 = DiscreteL1()
res2.logit()
cls.res2 = res2
Expand All @@ -422,7 +424,8 @@ def setupClass(cls):
data = sm.datasets.spector.load()
data.exog = sm.add_constant(data.exog, prepend=True)
cls.res1 = Logit(data.endog, data.exog).fit(
method="l1", alpha=0, disp=0, acc=1e-15)
method="l1", alpha=0, disp=0, acc=1e-15, maxiter=100,
trim_params=True, trim_tol='auto')
cls.res2 = Logit(data.endog, data.exog).fit(disp=0, tol=1e-15)

def test_logit_l1_alpha_zero(self):
Expand Down

0 comments on commit aa44c81

Please sign in to comment.