Re: [Rd] pt inaccurate when x is close to 0 (PR#9945)

From: Thomas Lumley <>
Date: Thu, 11 Oct 2007 07:21:32 -0700 (PDT)

On Wed, 10 Oct 2007, Duncan Murdoch wrote:>
> As Charles Berry told you when this was posted to R-help, it looks as
> though it is Mathematica that is inaccurate. For example, I would
> expect this plot to be smooth, and it is not in either R or Mathematica,
> but R is at least monotone:

I did check this on Maple by integrating the density function and got about 11-12 digits accuracy at df=88. I also tried replacing 1e-4 with an exactly-representable number (3/32768), with a similar accuracy level.

pbeta() claims 14-digit accuracy and is called by pt() with 1/(1+x^2/n) as its argument. I would have thought that the 1/(1+x^2/n) could easily be responsible for this sort of accuracy loss when x=1e-4. If so, it may not be easy to improve.

         -thomas mailing list Received on Thu 11 Oct 2007 - 14:25:08 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 25 Oct 2007 - 11:37:10 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.