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.
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel