0

Can someone please suggest how to fit a distribution from exponential family with variance greater than mean to build GLM model in python.

In R, quasipoisson seemed to work well. But I couldn't find a similar distribution in python.

glm_fit1 <- glm(data = msdata, 
    family = quasipoisson(link = "log")...

This was the code used in R. But I want to build the model in python.

James Z
  • 12,209
  • 10
  • 24
  • 44
  • Unfortunately, the most common implementation of GLMs in python ([statsmodels'](https://www.statsmodels.org/stable/glm.html)) does not not account for quasi-likelihood methods. You may try alternatives such as stated by this [github comment](https://github.com/statsmodels/statsmodels/issues/4942#issuecomment-414128677), but discussing those is out of scope of SO. – amiasato Jun 29 '21 at 12:21
  • you can use a negative binomial if your variance is larger than your mean. this should be close enough to the poisson. what is the end goal? – StupidWolf Jul 25 '21 at 16:07

0 Answers0