Re: [Rd] Re: [R-SIG-Mac] Bug running pbinom() in R-GUI?

From: <IandJMSmith_at_aol.com>
Date: Wed 23 Feb 2005 - 22:25:01 EST


Given TOMS708 has been incorporated into R and that the original pbeta_raw routine had more problems than just large shape parameters, why wasn’t it rewritten as

double pbeta_raw(double x, double pin, double qin, int lower_tail) {

    /* Use TOMS 708 */
    double x1 = 1 - x, w, wc;
    int ierr;
    bratio(pin, qin, x, x1, &w, &wc, &ierr);     return lower_tail ? w : wc;
}

Incidentally, in pbeta, I thought the point of the log_p parameter was to return the logged value particularly for cases where the non-logged version of pbeta_raw returns 0. It’s not difficult to modify bratio to do this, provided that’s allowed.

I think the other remarks made by Morten Welinder in PR#7153 still stand, namely several functions which called pbeta and have kludge code to compensate for its previous weaknesses could be significantly improved by removal of the kludges.

Ian Smith

P.S. the next logical step would be to replace pgamma with TOMS654, as pgamma suffers from the same problems which the old pbeta did.



R-devel@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Wed Feb 23 23:36:37 2005

This archive was generated by hypermail 2.1.8 : Thu 24 Feb 2005 - 01:34:03 EST