From tlumley at u.washington.edu  Thu Oct 11 16:21:32 2007
From: tlumley at u.washington.edu (Thomas Lumley)
Date: Thu, 11 Oct 2007 07:21:32 -0700 (PDT)
Subject: [Rd] pt inaccurate when x is close to 0 (PR#9945)
In-Reply-To: <470D0788.4080307@stats.uwo.ca>
References: <20071010143513.11DD128800A8@mail.pubhealth.ku.dk>
	<470D0788.4080307@stats.uwo.ca>
Message-ID: <Pine.LNX.4.64.0710110709380.24673@homer21.u.washington.edu>

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



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