[SciPy-User] log pdf, cdf, etc

Chris Strickland christopher.strickland at qut.edu.au
Thu May 27 07:22:54 EDT 2010


Hi, 

When using any of the distributions of scipy.stats there does not seem to be 
the ability (or at least I cannot figure out how) to have the function return 
the log of the pdf, cdf, sf, etc. For statistical analysis this is essential. 
For instance suppose we are interested in an exponential distribution for a 
random variable x with a hyperparameter lambda there needs to be an option 
that returns -log(lambda)-x/lambda. It is not sufficient (numerically) to 
calculate log(scipy.stats.expon.pdf(x,lambda)). 

Is there a way to do this using the distributions in scipy.stats? 

If there is not is it possible for me to suggest that this feature is added. 
There is such an excellent range of distributions, each with such an 
impressive range of options, it seems ashame to have to mostly manually code 
up the log of pdfs and often call the log of CDFs from R.  

Thanks,
Chris.



More information about the SciPy-User mailing list