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

David Warde-Farley dwf@cs.toronto....
Wed Sep 16 19:14:59 CDT 2009


On 16-Sep-09, at 6:40 PM, josef.pktd@gmail.com wrote:

> David,
> Since you have multi-precision available with sage, could you check
> the precision of the normal cdf in the lower tail?
>
> In http://projects.scipy.org/scipy/ticket/962 there was a discussion
> about using the truncated normal in the tails. In the last comment
> there, I mentioned that it would be possible to use the lower tail if
> the precision of scipy.special in this case is high enough. But I
> wasn't able to verify how good the normal cdf really is.
>
> These numbers are in the range 1e-20 to 1e-80, so here precision  
> really matters.
>
Apparently the 'mpmath' package (easy_install'able) does arbitrary  
precision, and has a built-in normal cdf:

Out[34]:  
mpf 
('7.6198530241605260659733432515993083635040332779569605780353524e-24')

In [35]: mpmath.functions.ncdf(-10.2)
Out[35]:  
mpf 
('9.9136251225600715794942192071914050771727823887948971717481189e-25')

In [36]: mpmath.functions.ncdf(-20)
Out[36]:  
mpf 
('2.7536241186062336950756227808574653328074977347593305676993728e-89')

In [37]: mpmath.functions.npdf(-20.2) / mpmath.functions.ncdf(-20)
Out[37]:  
mpf('0.35995251388497550054560007939076980260015643935329865252047705')


Looks pretty good to me.

David


More information about the Scipy-dev mailing list