Allow offset and exposure to be used together with log link; raise excep... #1635

Merged
merged 1 commit into from May 20, 2014

Projects

None yet

3 participants

@kshedden
Contributor

...tion if exposure is used when the ink is not the log

@coveralls

Coverage Status

Coverage remained the same when pulling e625801 on kshedden:glm_offset5 into b52bc09 on statsmodels:master.

@josef-pkt
Member

I just saw that there is also a bug in predict.
It shouldn't use the stored offset and exposure if exog is given. Should result in shape mismatch if predict exog doesn't have nobs rows.

@kshedden
Contributor

Should we add arguments for offset and exposure and/or warn? It seems
dangerous to silently ignore them.

On Tue, May 20, 2014 at 11:33 PM, Josef Perktold
notifications@github.comwrote:

I just saw that there is also a bug in predict.
It shouldn't use the stored offset and exposure if exog is given. Should
result in shape mismatch if predict exog doesn't have nobs rows.


Reply to this email directly or view it on GitHubhttps://github.com/statsmodels/statsmodels/pull/1635#issuecomment-43642175
.

@josef-pkt
Member

Yes, I think we need to include the offset and exposure arguments in the same way as in discrete_model CountModel.predict.

aside: CountModel.predict uses a user specified offset and exposure, even if the estimation didn't use it. I don't see a problem with this. Could be useful if we want to "manipulate" the prediction.

@kshedden
Contributor

Should I add this to the glm_offset5 PR, or start a new one?

On Wed, May 21, 2014 at 12:00 AM, Josef Perktold
notifications@github.comwrote:

Yes, I think we need to include the offset and exposure arguments in the
same way as in discrete_model CountModel.predict.

aside: CountModel.predict uses a user specified offset and exposure, even
if the estimation didn't use it. I don't see a problem with this. Could be
useful if we want to "manipulate" the prediction.


Reply to this email directly or view it on GitHubhttps://github.com/statsmodels/statsmodels/pull/1635#issuecomment-43645725
.

@josef-pkt
Member

I think I could merge this as is. Only the commit message is wrong.

Then you can start a new branch from updated master

@josef-pkt josef-pkt merged commit e0fed32 into statsmodels:master May 20, 2014

1 check passed

continuous-integration/travis-ci The Travis CI build passed
Details
@josef-pkt
Member

merged, thank Kerby.

@kshedden kshedden deleted the kshedden:glm_offset5 branch Jun 9, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment