← Lab
invgaussmean
confirmedupstream bugPython · pyGAMSystems & data structuresJuly 25, 2026
the question
Does pyGAM's InvGaussDist.log_pdf compute an inverse-Gaussian density with the fitted mean mu?
what came out
pyGAM's InvGaussDist.log_pdf passes mu straight into scipy's invgauss shape argument with scale=1/gamma=phi, giving a density with mean mu*phi rather than mu. Off dispersion one the log-likelihood and AIC are wrong by hundreds of nats (loglik -1490.70 vs -1091.32). The sibling GammaDist.log_pdf is correct.
method & receipts
- Result: confirmed
- Reproducible — one script re-runs the whole thing from scratch.
- Tested — a correctness/benchmark suite ships alongside the code.
→ read the code and re-run it
github.com/v-code01/invgaussmean