[Rcpp-devel] Generalized Linear Model funcitonality inside Inline
Jeffrey Pollock
jeffpollock9 at gmail.com
Fri Jan 13 16:05:05 CET 2012
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 <
jlacombe at naturesourcegenetics.com> 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 categorical variable with 3 classes:**
> **
>
> ** **
>
> For(I in 1:100000)****
>
> {****
>
> glm(X~Y, family=”binomial”);****
>
> }****
>
> ** **
>
> This seems like an excellent candidate for Rcpp--I simply wish to evaluate
> the ‘for’ loop in c++ to reduce the computational overhead.****
>
> ** **
>
> What I would like to *avoid* is having to re-write code for explicitly
> evaluating a generalized linear model in c++. Any quick-and-dirty solution
> is acceptable. Two approaches that I have tried and been unsuccessful with
> are:****
>
> ** **
>
> -Attempting to expose the C glm methods from the R stats package****
>
> -Working with the RcppModels package [having trouble with this due to my
> inability to find documentation, not that there isn’t some out there]****
>
> ** **
>
> Any thoughts, references, or corrections to my above approaches would be
> appreciated.****
>
> ** **
>
> Thanks,****
>
> ** **
>
> Jason****
>
> ** **
>
> ** **
>
> _______________________________________________
> Rcpp-devel mailing list
> Rcpp-devel at lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20120113/f28d2e23/attachment-0001.htm>
More information about the Rcpp-devel
mailing list