Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAINT: Cor nearest factor tests #1851

Merged
merged 2 commits into from Jul 29, 2014

Conversation

Projects
None yet
3 participants
@kshedden
Copy link
Contributor

kshedden commented Jul 29, 2014

Change bare asserts to numpy asserts.

@coveralls

This comment has been minimized.

Copy link

coveralls commented Jul 29, 2014

Coverage Status

Coverage remained the same when pulling 7374fbb on kshedden:cor_nearest_maint into 48f7a21 on statsmodels:master.

@kshedden kshedden changed the title Cor nearest maint MAINT: Cor nearest factor tests Jul 29, 2014

@@ -293,7 +293,7 @@ def project(x):
x = np.random.normal(size=dm)
rslt = _spg_optim(obj, grad, x, project)
xnew = rslt.params
assert(obj(xnew) < 1e-4)
assert_almost_equal(obj(xnew), 0, decimal=3)

This comment has been minimized.

Copy link
@josef-pkt

josef-pkt Jul 29, 2014

Member

assert_allclose allows better control over tolerance
i.e, atol=5e-3 and rtol=0 or irrelevant in this case

I think assert_almost_equal is now only interesting in the case when we have reference numbers with a printed precision given by the number of decimals.

@josef-pkt

This comment has been minimized.

Copy link
Member

josef-pkt commented Jul 29, 2014

I'm merging this to see what the results on Ubuntu are.
Trying out the test case on my computer, the tests would pass at atol=5e-5.

If we loose a lot of precision on some machines, then there might be some other problems in the code.

josef-pkt added a commit that referenced this pull request Jul 29, 2014

Merge pull request #1851 from kshedden/cor_nearest_maint
TST: Cor nearest factor tests

@josef-pkt josef-pkt merged commit 15975a7 into statsmodels:master Jul 29, 2014

2 checks passed

continuous-integration/appveyor AppVeyor build succeeded
Details
continuous-integration/travis-ci The Travis CI build passed
Details

@josef-pkt josef-pkt added the PR label Aug 11, 2014

@josef-pkt josef-pkt added the type-test label Aug 24, 2014

@josef-pkt josef-pkt added this to the 0.6 milestone Aug 24, 2014

PierreBdR pushed a commit to PierreBdR/statsmodels that referenced this pull request Sep 2, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.