Repository navigation
BUG: GLM score and hessian - #4620
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4620 +/- ##
==========================================
+ Coverage 80.28% 80.29% +0.01%
==========================================
Files 564 564
Lines 85664 85693 +29
Branches 9681 9684 +3
==========================================
+ Hits 68772 68811 +39
+ Misses 14664 14656 -8
+ Partials 2228 2226 -2
Continue to review full report at Codecov.
|
|
This looked good to me. Math makes sense, I think. Why did it get closed? |
|
I was reading on my ipad, so maybe I accidentally hit the close button. |
|
everything was green, but I canceled the ci builds after reopening. |
…s#4616 partial cleanup in test_glm
|
this PR sets now scale=1 during gradient optimization. |
|
@josef-pkt This looks really good. Before this, I was never able to use the scipy optimizers without But now it seems to work well. The models I'm running are large-ish. 11.9M records, 53 df model. The Curiously, I think the As for |
|
another cross check enabling a disabled discrete test comparing Probit with GLM, I get difference in hessian at MLE of Probit: So, now they agree, and I should have gotten more suspicious when it didn't agree when I added GLM.hessian. |
|
This should be finished and ready to merge when green |
|
all green, merging @thequackdaddy Thanks for checking. |
BUG: GLM score and hessian
| # assert_allclose(res1.bse * res1.scale, res2.bse, rtol=1e-13) | ||
| # else: | ||
| # assert_allclose(res1.bse, res2.bse, rtol=1e-13) | ||
| rtol = getattr(res1, 'rtol', 1e-13) |
There was a problem hiding this comment.
should this be getting cls.rtol? That is the attribute that is set down on L514.
There was a problem hiding this comment.
Yes, that's a mistake.
However, why do the tests not fail if rtol is 1e-13?
Essentially this means that GLM and the corresponding discrete model agree on very high precision with the same optimizer newton. 1e-13 should be much stricter than convergence tolerance.
fix bugs in GLM score and hessian
first commit are only unit tests to see the results with current code
bugfixes will follow
closes #4616 closes #4614