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

ENH/TST: GLM, discrete, saturated model, perfect prediction #3703

Open
josef-pkt opened this issue May 25, 2017 · 3 comments
Open

ENH/TST: GLM, discrete, saturated model, perfect prediction #3703

josef-pkt opened this issue May 25, 2017 · 3 comments

Comments

@josef-pkt
Copy link
Member

corner case behavior if we have a model with perfect prediction by design

(I thought I already have an issue, but don't find it right now.
trigger for issue right now: according to their documentation, SPSS handles zero cases in loglike and deviance separately, dropping terms instead of "fixing" them as we do)

examples:

  • contingency table, loglinear model with saturated exog
  • computing saturated reference case for deviance, (I needed to add an epsilon to avoid corners)
  • model with aggregated or averaged data using freq_weights or var_weights

Those would make good test cases for the currently open issues of zero division and similar in GLM families.

@josef-pkt
Copy link
Member Author

bump

I just ran into the same problem replicating two sample proportion tests with GLM Binomial PR #6675

see #2680 for disabling perfect separation exception when using irls

I also got a zero division warning (raised only once ?)

en = np.array([[count1, nobs1 - count1], [count2, nobs2 - count2]])
ex = np.array([[1., 1], [1, 0]])
mod_glm = GLM(en, ex, family=families.Binomial())
res_glm = mod_glm.fit(method='bfgs', tol=1e-10, max_start_irls=0)

@josef-pkt
Copy link
Member Author

exception when null model has perfect fit and scale=0
#7682 (comment)

@josef-pkt
Copy link
Member Author

PR #8552 added option to turn off/on the perfect separation/prediction check, default changed to no exception

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

No branches or pull requests

1 participant