[SciPy-dev] scipy.stats: sf for symmetric distributions.

Charles R Harris charlesr.harris@gmail....
Sat Sep 19 23:00:19 CDT 2009


On Wed, Sep 16, 2009 at 3:25 PM, Pauli Virtanen <pav@iki.fi> wrote:

> ke, 2009-09-16 kello 17:01 -0400, David Warde-Farley kirjoitti:
> > On 16-Sep-09, at 3:53 PM, David Warde-Farley wrote:
> >
> > > incidentally, this breaks two
> > > ttest tests because they differ in the 17th decimal place, how sure
> > > are you of those hard-coded numbers?).
> >
> > I just did the integral with Sage and requested 100 bits of precision,
> > more than we need, and got
> >
> > sage: thepdf
> > 1/4*sqrt(2)/(1/2*x^2 + 1)^(3/2)
> > sage: n(2 * integral(thepdf, x, -infinity, -1), prec=100)
> > 0.42264973081037423549085121950
>
> Btw, this integral evaluates to
>
>        1 - 1/sqrt(3)
>
>
Playing tricks gives the form 2/(3 + sqrt(3)), which is less susceptible to
round off errors.

In [6]: 2/(3 + sqrt(3))
Out[6]: 0.42264973081037427

In [8]: 2/(3 + sqrt(float96(3)))
Out[8]: 0.42264973081037423547

Hmm, looks like the precision of the sqrt might be the limiting factor.

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/scipy-dev/attachments/20090919/e9cbf3f7/attachment.html 


More information about the Scipy-dev mailing list