Re: R-beta: problem with locfit

Clive Loader (clive@bell-labs.com)
Thu, 26 Mar 1998 10:27:17 -0500


Date: Thu, 26 Mar 1998 10:27:17 -0500
From: Clive Loader <clive@bell-labs.com>
To: r-help@stat.math.ethz.ch
Subject: Re: R-beta: problem with locfit

guido@sirio.stat.unipd.it wrote:
> 
> I installed the locfit package under Linux (gcc 2.7.2). Installation
> was ok but
....
> > m <- locfit(y~x,cens=cens,family="gamma")
> /usr/local/src/R-0.61.1/bin/R.binary: can't resolve symbol 'igamma'

> Perhaps, a better possibility is to define igamma and ibeta using
> the R pgamma and pbeta function. However, I have not tried it.

placing (in the locfit/src/family.c file)

extern double pgamma(), pbeta();
#define igamma(x,p) pgamma(x,p,1.0)
#define ibeta(x,a,b) pbeta(x,a,b)

seems to solve the problem. (Big plus of R over S: pgamma() etc. can be
called directly,
instead of cribbing source code!).


A second problem is that the R (0.61.1) model.extract() function differs
from the
S version, and the cens argument won't be interpreted properly. Adding
the following
modified model.extract() to the locfit/R/lfrsup.r file should work...

model.extract <-
function (frame, component)
{
        component <- as.character(substitute(component))
        rval <- switch(component, response = model.response(frame),
                offset = model.offset(frame), weights =
frame$"(weights)",
                start = frame$"(start)", cens=frame$"(cens)",
                base=frame$"(base)")
        if (length(rval) == nrow(frame))
                names(rval) <- attr(frame, "row.names")
        else if (is.matrix(rval) && nrow(rval) == nrow(frame)) {
                t1 <- dimnames(rval)
                dimnames(rval) <- list(attr(frame, "row.names"),
                        t1[[2]])
        }
        return(rval)
}


Regards,
Clive.
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._