Re: [Rcpp-devel] Using sugar expressions for evaluating deviance residuals

2010-08-16 Thread Douglas Bates
On Mon, Aug 16, 2010 at 11:47 AM, Romain Francois wrote: > Le 16/08/10 15:33, Douglas Bates a écrit : >> >> On Mon, Aug 16, 2010 at 8:10 AM, Romain Francois >>  wrote: >>> >>> Nothing really conclusive here ... >>> >>> I've added a preliminary version of SUGAR_BLOCK_3 (only for the case >>> where

Re: [Rcpp-devel] Using sugar expressions for evaluating deviance residuals

2010-08-16 Thread Romain Francois
Le 16/08/10 15:33, Douglas Bates a écrit : On Mon, Aug 16, 2010 at 8:10 AM, Romain Francois wrote: Nothing really conclusive here ... I've added a preliminary version of SUGAR_BLOCK_3 (only for the case where all inputs are vectors) so that one can write : incl8<- ' inline double y_log_y(dou

Re: [Rcpp-devel] Using sugar expressions for evaluating deviance residuals

2010-08-16 Thread Romain Francois
Le 16/08/10 15:33, Douglas Bates a écrit : On Mon, Aug 16, 2010 at 8:10 AM, Romain Francois wrote: Nothing really conclusive here ... I've added a preliminary version of SUGAR_BLOCK_3 (only for the case where all inputs are vectors) so that one can write : incl8<- ' inline double y_log_y(dou

Re: [Rcpp-devel] Using sugar expressions for evaluating deviance residuals

2010-08-16 Thread Douglas Bates
On Mon, Aug 16, 2010 at 8:10 AM, Romain Francois wrote: > Nothing really conclusive here ... > > I've added a preliminary version of SUGAR_BLOCK_3 (only for the case where > all inputs are vectors) so that one can write : > > incl8 <- ' > inline double y_log_y(double y, double mu) { >    return y

Re: [Rcpp-devel] Using sugar expressions for evaluating deviance residuals

2010-08-16 Thread Romain Francois
Nothing really conclusive here ... I've added a preliminary version of SUGAR_BLOCK_3 (only for the case where all inputs are vectors) so that one can write : incl8 <- ' inline double y_log_y(double y, double mu) { return y ? y*log(y/mu) : 0.; } inline double yMu(double y, double mu) {

Re: [Rcpp-devel] Using sugar expressions for evaluating deviance residuals

2010-08-15 Thread Douglas Bates
On Sun, Aug 15, 2010 at 10:34 AM, Douglas Bates wrote: > On Sun, Aug 15, 2010 at 3:39 AM, Romain Francois > wrote: >> Hi, >> >> Could you provide some minimal example using inline, etc ... > > I enclose a comparison of several different versions that I wrote. > Interestingly the old code, called

Re: [Rcpp-devel] Using sugar expressions for evaluating deviance residuals

2010-08-15 Thread Douglas Bates
On Sun, Aug 15, 2010 at 3:39 AM, Romain Francois wrote: > Hi, > > Could you provide some minimal example using inline, etc ... I enclose a comparison of several different versions that I wrote. Interestingly the old code, called by fx3, does reasonably well, although I'm not sure if this is a fai

Re: [Rcpp-devel] Using sugar expressions for evaluating deviance residuals

2010-08-15 Thread Romain Francois
Hi, Could you provide some minimal example using inline, etc ... Here are a few hints in the meantime. In the next version of Rcpp, I've added a few things that help generating sugar functions. This is how for example the sugar version of choose is currently implemented : SUGAR_BLOCK_2(choos

[Rcpp-devel] Using sugar expressions for evaluating deviance residuals

2010-08-14 Thread Douglas Bates
In profiling code for generalized linear mixed models for binary responses I found that a substantial portion of the execution time was being spend in evaluating the R functions for inverse links and for the deviance residuals. As I result I wrote C code (in $RSRC/src/library/stats/src/family.c) o