Skip to content
Prev 3990 / 12125 Next

[R-pkg-devel] How to obtain intercept of intercept-only glm in Fortran?

Thanks Michael. I agree that it is possible to simplify the codes.

Best,

Zhu 

-----Original Message-----
From: Michael Weylandt <michael.weylandt at gmail.com> 
Sent: Monday, May 20, 2019 3:41 PM
To: Wang, Zhu <wangz1 at uthscsa.edu>
Cc: Ivan Krylov <krylov.r00t at gmail.com>; R-package-devel at r-project.org
Subject: Re: [R-pkg-devel] How to obtain intercept of intercept-only glm in Fortran?

Negative binomial is a bit trickier since it's a two parameter family without a closed-form MLE.

For the probability parameter, you can use the closed form MLE at https://en.wikipedia.org/wiki/Negative_binomial_distribution#Maximum_likelihood_estimation

For the number of samples, you'll need to use an iterative method to solve the score equation (see the above link).

It's probably easier to code this up yourself rather than calling into R, but if you do call into R, I'd look into using the `fitdistr` function instead of a full regression method, as demonstrated at https://stat.ethz.ch/pipermail/r-help/2012-October/338458.html

Michael
On Sat, May 11, 2019 at 11:10 AM Wang, Zhu <wangz1 at uthscsa.edu> wrote: