Re: [Rcpp-devel] Generalized Linear Model funcitonality inside Inline

2012-01-13 Thread Douglas Bates
On Fri, Jan 13, 2012 at 8:53 AM, Jason LaCombe wrote: > Hi Everyone, > I’m trying to perform the following task more efficiently in Rcpp, and am > running into some trouble… > Here’s a simplified example of the sort of R code I’m trying to optimize, > for Y a binary random variable, X a categori

Re: [Rcpp-devel] Generalized Linear Model funcitonality inside Inline

2012-01-13 Thread Jeffrey Pollock
One way of speeding that up would be to use `glm.fit` instead of `glm`. It just means you'll have to calculate a few extra variables outside the loop (which `glm` will be calculating every time you call it). On Fri, Jan 13, 2012 at 2:53 PM, Jason LaCombe < [email protected]> wrote:

[Rcpp-devel] Generalized Linear Model funcitonality inside Inline

2012-01-13 Thread Jason LaCombe
Hi Everyone, I'm trying to perform the following task more efficiently in Rcpp, and am running into some trouble... Here's a simplified example of the sort of R code I'm trying to optimize, for Y a binary random variable, X a categorical variable with 3 classes: For(I in 1:10) { glm(X~Y,