glm Binomial loglike 0log0 error
Bug #680077 reported by
joep
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
statsmodels |
Fix Released
|
High
|
Unassigned |
Bug Description
reported by Sol 2010-11-22
>>> sm.GLM(
Traceback (most recent call last):
File "<pyshell#37>", line 3, in <module>
family=
File "c:\josef\
returned a nan. This could be a boundary problem and should be reported."
ValueError: The first guess on the deviance function returned a nan. This could be a boundary problem and should be reported.
Changed in statsmodels: | |
importance: | Undecided → High |
milestone: | none → 0.3.0 |
status: | New → Fix Committed |
Changed in statsmodels: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
see http:// bazaar. launchpad. net/~josef- pktd/statsmodel s/statsmodels- josef-experimen tal-gsoc/ revision/ 2194
I added 1e-200 to all instances of a*log(b) that looked like `a` and `b` could be zero.
The test cases of Sol, with either zero successes or zero failures finish now without raising an exception.
I will attach the new test script that also includes now the zero failure case.
The only disadvantage, I can see is that we create an additional temporary array, but that might be unavoidable in any case.
Ready for review