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

BUG: Fix problems with predict handling offset and exposure #1679

Merged
merged 1 commit into from
May 21, 2014

Conversation

kshedden
Copy link
Contributor

This PR accomplishes three things in GLM.predict:

  1. predict should ignore offset and exposure if exog is provided.
  2. If offset or exposure are explicitly provided, they should override any offset or exposure that were part of the fit.
  3. exposure is not allowed unless the link is the log function

@kshedden
Copy link
Contributor Author

Rephrasing #1 for clarity:

  1. predict should ignore offset and exposure from the fit if exog is provided

Also note that offset and exposure are new arguments.

offset = 0.

if exposure is not None and not isinstance(self.family.link,
families.links.Log):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a comment and to add link to #1509 possible problems with instance checks

@josef-pkt
Copy link
Member

looks good to me

josef-pkt added a commit that referenced this pull request May 21, 2014
BUG: Fix problems with predict handling offset and exposure in GLM
@josef-pkt josef-pkt merged commit ede3157 into statsmodels:master May 21, 2014
@kshedden kshedden deleted the glm_predict_offset branch June 9, 2014 02:01
PierreBdR pushed a commit to PierreBdR/statsmodels that referenced this pull request Sep 2, 2014
BUG: Fix problems with predict handling offset and exposure in GLM
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants