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

2019-05-11 Thread Wang, Zhu
Thanks Michael. I also need an intercept-only negative binomial model with unknown scale parameter. So my thought was on borrowing some codes that already existed. I think Ivan's solution is an excellent one and can be extended to other scenarios. Best, Zhu On May 11, 2019, at 9:48 AM,

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

2019-05-11 Thread Michael Weylandt
On Sat, May 11, 2019 at 8:28 AM Wang, Zhu wrote: > > I am open to whatever suggestions but I am not aware a simple closed-form > solution for my original question. > > It would help if you could clarify your original question a bit more, but for at least the main three GLMs, there are closed

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

2019-05-11 Thread Wang, Zhu
Ivan's answer is very impressive. Michael, I am open to whatever suggestions but I am not aware a simple closed-form solution for my original question. Thanks, Zhu > On May 11, 2019, at 8:01 AM, Michael Weylandt > wrote: > > This is very cool, but I wonder if it isn't over-kill for the

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

2019-05-11 Thread Ivan Krylov
On Fri, 10 May 2019 16:17:42 + "Wang, Zhu" wrote: > Are there any examples or links for me to follow through more closely? Calling R functions from C++ is described at and elsewhere in Rcpp documentation. An example follows:

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

2019-05-11 Thread Michael Weylandt
This is very cool, but I wonder if it isn't over-kill for the larger problem. In general, calculating the coefficient of an intercept-only GLM is just calculating (a transformation of) the MLE of a univariate exponential family distribution. (Things may be a bit trickier if the GLM also involves