Siginificant figures calculating zprob

Sarah Wang sarah_wang23 at hotmail.com
Mon Apr 5 01:09:08 EDT 2004


"Duncan Smith" <buzzard at urubu.freeserve.co.uk> wrote in message news:<c4p34l$ubt$1 at newsg4.svr.pol.co.uk>...
> "Sarah Wang" <sarah_wang23 at hotmail.com> wrote in message
> news:9405c70f.0404031852.155d17d5 at posting.google.com...
> > Hello everyone!
> >
> > I want to calculate zprob(the area under the normal curve)
> > with python and I managed to find a function from the
> > internet.
> >
> > But the problem is that the function calculates the result
> > with only a few significant figures. If I want to get the
> > 20th number of the result(z-prob) what should I do?
> 
> Why would you need this degree of precision?
>

I'm doing some exploration into the statistical part of "Six Sigma"
(as someone on the thread noted) with my most powerful exploratory
tool "Python Interactive Shell". :)

I just wanted to see myself if six sigma is really 3.4 defects per
million opportunities but got into the limit of float type's precision.

> I want
> > to get the confidence level of "6sigma" and all I get at the
> > moment is "1".
> >
> 
> How about posting the code?  Check out Gary Strangman's stats.py
> http://www.nmr.mgh.harvard.edu/Neural_Systems_Group/gary/python.html
> 
> Duncan

Well, actually I used Gary's code(zprob function) and it returned 1
for 6 sigma. The precision falls short.

As Paul rightly directed me, the wikipedia page explained that I was
looking for a wrong target. I should've computed 4.5 sigma instead.
Real 6 sigma is 2 per one billion. But my curiosity drove me to
experiment that rare probability. The python code was reaching far
short but Excel's normdist function did it nicely(it's significant digits
doesn't seem very long though).

Happily with help from Josiah, I could get both what I wanted(6sigma)
and what I did not wanted(4.5sigma) at the first place.

Thank you all.



More information about the Python-list mailing list