pyGAM icon indicating copy to clipboard operation
pyGAM copied to clipboard

add negative binomial and correspong log link

Open dswah opened this issue 7 years ago • 10 comments

negative binomial is good for modeling counts where there are more zeros than expected by a poisson model

http://dept.stat.lsa.umich.edu/~kshedden/Courses/Stat600/Notes/glm.pdf http://www.biostat.umn.edu/~dipankar/bmtry711.11/lecture_13.pdf

dswah avatar Jul 25 '17 07:07 dswah

Any chance there has been progress on this front? Negative binomial distribution modeling would be super useful! (Great package by the way!)

adrianveres avatar Mar 29 '18 04:03 adrianveres

If nobody is working on this, would be happy to make a first contribution.

owlas avatar Aug 06 '18 11:08 owlas

@owlas no one is working on this :) your contribution is most welcome. please let me know if you need any help or clarification.

dswah avatar Aug 06 '18 11:08 dswah

@dswah using the current IRLS algorithm it's only possible to solve 1-parameter distributions correct?

Would an acceptable first alternative for the NegativeBinomial be to specify the dispersion parameter as a given just as with the Binomial objective: https://github.com/dswah/pyGAM/blob/a93c904e47f458a2ccec47e3284e307fdea97fa5/pygam/distributions.py#L229-L246

owlas avatar Aug 06 '18 15:08 owlas

I suppose the only solution to determine the dispersion would be to grid search over a range of values.

owlas avatar Aug 06 '18 15:08 owlas

@owlas good point. yes, i think it is good first step to keep the dispersion parameter as a given for now.

dswah avatar Aug 06 '18 23:08 dswah

Hi, just wondering how this is going... @owlas if you have done something even incomplete, do you have it on a personal fork? thanks!

fransua avatar Feb 04 '20 09:02 fransua

Hey @fransua - thanks for bumping me.

I haven't got round to this. I'll get to work! Do you mind if I open a PR in the next 2 weeks?

owlas avatar Feb 04 '20 11:02 owlas

@owlas sure, it would be great!

fransua avatar Feb 11 '20 00:02 fransua

Interesting, looking forward for adding neg binomial

ramdhan1989 avatar Jun 13 '20 03:06 ramdhan1989