You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
GLM with Gamma family gives DomainWarning on v.0.8.0rc1 #3316
Running the example from the docs on statsmodels 0.8.0rc1 gives a DomainWarning:
/Users/xxx/miniconda3/envs/xxx/lib/python3.5/site-packages/statsmodels/genmod/generalized_linear_model.py:244: DomainWarning: The inverse_power link function does not respect the domain of the Gamma family.
DomainWarning)
We intentionally added the Warning. Even though the inverse power link is the canonical link function for gamma, it doesn't force the mean to be in the support of the distribution > 0. As a consequence there might be numerical problems for some datasets.
A common solution is to use the log link instead of inverse power link, which will force the mean prediction to be strictly positive.
We did not switch to log link as the default, but that might be better.
see #2208 especially last comment, and #2212 for the PR that changed this.
I'm adding the FAQ label
Reacted by Nelson Auner, Marc Kjerland and Christopher Daigle
It would be better to add an explanation to the notebook, and add log link as the recommended link.
Thanks for pointing this out. It is difficult to maintain and improve the documentation given that the documentation does not complain on changes in contrast to the unit tests.
Activity
josef-pkt commentedon Dec 12, 2016
We intentionally added the Warning. Even though the inverse power link is the canonical link function for gamma, it doesn't force the mean to be in the support of the distribution > 0. As a consequence there might be numerical problems for some datasets.
A common solution is to use the log link instead of inverse power link, which will force the mean prediction to be strictly positive.
We did not switch to log link as the default, but that might be better.
see #2208 especially last comment, and #2212 for the PR that changed this.
I'm adding the FAQ label
josef-pkt commentedon Dec 12, 2016
@yoavram The updated documentation and examples are at http://www.statsmodels.org/devel/examples/notebooks/generated/glm.html
which also shows the warning.
It would be better to add an explanation to the notebook, and add log link as the recommended link.
Thanks for pointing this out. It is difficult to maintain and improve the documentation given that the documentation does not complain on changes in contrast to the unit tests.
yoavram commentedon Dec 13, 2016
Thanks I appreciate your prompt and detailed answers. I did search the issues/PR but must have missed it.