[SciPy-user] probability tools in scipy

Jouni K. Seppänen jks@iki...
Tue Mar 6 15:37:07 CST 2007


Thomas Nelson <thn@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