[SciPy-user] probability tools in scipy

Jouni K. Seppänen jks at iki.fi
Tue Mar 6 16:37:07 EST 2007


Thomas Nelson <thn at cs.utexas.edu> writes:

> normalcdf(lo,hi,mu,sigma)
> that returns the probability that
> lo < X < hi
> where X is a normal random variable with mean = mu and standard deviation 
> = sigma. 

Look at scipy.stats.norm.cdf. I think this is one way to define your
function:

def normalcdf(lo, hi, mu, sigma):
    return numpy.dot([-1, 1], scipy.stats.norm.cdf([lo, hi], mu, sigma))

-- 
Jouni K. Seppänen
http://www.iki.fi/jks




More information about the SciPy-User mailing list