Skip to content

BUG/REF: fix GLM null, init keywords - #4601

Merged
josef-pkt merged 1 commit into
statsmodels:masterfrom
josef-pkt:bug_binomial_null
May 7, 2018
Merged

josef-pkt merged 1 commit into
statsmodels:masterfrom
josef-pkt:bug_binomial_null

Conversation

@josef-pkt

@josef-pkt josef-pkt commented May 7, 2018 •

Copy link
Copy Markdown
Member

closes #4597
this fixes GLM.null and consequently null_deviance, llnull if exposure is used independent of family, and if offset is used in the binomial count case.

There are some unit tests for null_deviance, More unit test in my penalized #4576 where I initially ran into this bug.

more general:
see #4599
fixes recreating models for Binomial count, by addin n_trials to __init__ kwargs and init keys
This will fix most likely other bugs, or adds support for cases that are not supported yet,
e.g. fit_constrained and fit_regularized for Binomial counts #4600
but I didn't check and test those cases yet.

If current unit tests work with these changes, then I might add some more unit tests.

@josef-pkt josef-pkt added comp-genmod type-bug-wrong serious bugs that silently return incorrect numbers backport-0.9.0 labels May 7, 2018
@josef-pkt josef-pkt added this to the 0.9 milestone May 7, 2018
@josef-pkt

Copy link
Copy Markdown
Member Author

travisci has currently problems accessing pypi files for pip install, i.e. build stops when downloading pytest.

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.0002%) to 82.869% when pulling 6389e85 on josef-pkt:bug_binomial_null into 3d87728 on statsmodels:master.

1 similar comment
@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.0002%) to 82.869% when pulling 6389e85 on josef-pkt:bug_binomial_null into 3d87728 on statsmodels:master.

@codecov-io

Copy link
Copy Markdown

Codecov Report

Merging #4601 into master will increase coverage by <.01%.
The diff coverage is 85.71%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4601      +/-   ##
==========================================
+ Coverage   80.26%   80.26%   +<.01%     
==========================================
  Files         564      564              
  Lines       85592    85593       +1     
  Branches     9679     9678       -1     
==========================================
+ Hits        68702    68703       +1     
+ Misses      14662    14661       -1     
- Partials     2228     2229       +1
Impacted Files Coverage Δ
statsmodels/genmod/tests/test_glm.py 98.73% <100%> (ø) ⬆️
statsmodels/genmod/generalized_linear_model.py 89.54% <83.33%> (ø) ⬆️
statsmodels/stats/descriptivestats.py 24.13% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3d87728...6389e85. Read the comment docs.

@josef-pkt

Copy link
Copy Markdown
Member Author

All green now, I restarted travis jobs after pypi problems were solved.

This needs mention in release notes for bug-wrong.

I'm merging this as is, and prepare another PR for Binomial count with fit_constrained which uses this fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp-genmod type-bug-wrong serious bugs that silently return incorrect numbers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: GLM null uses log transformed exposure instead of exposure

3 participants