[SciPy-User] log pdf, cdf, etc

Chris Strickland christophermarkstrickland at gmail.com
Fri May 28 23:34:50 EDT 2010


On Sat, May 29, 2010 at 12:53 PM, <josef.pktd at gmail.com> wrote:

>
> I don't think for many use cases log(stats.t.pdf) or many other
> distributions the performance and accuracy hit would be large enough
> to make it useless. At least, I haven't seen any other comments in
> this direction.
>
> On of the main use cases for me of stats.distributions are all the
> statistical test distributions, t, F, chi2 and so on. Howver, in
> statsmodels we have a mixture of calls to the pdf/cdf of
> stats.distributions and reimplementations of loglikelhood functions,
> where the scipy version is also just used for testing.
>
> The main use for me is in specifying (log) prior distributions, (log)
posterior distributions and log-likelihood functions. There is simply no way
around using the log pdf in the vast majority of cases in MCMC analysis.
Whilst it is trivial for me to simply write functions when I need them it
would obviously benefit the statistical community as a whole if the option
was available in the excellent set of distributions that are available as a
part of Scipy.


R's license, GPL, is incompatible with the license of scipy, BSD.
> While they are allowed to look at our code, code that goes into scipy
> cannot be based on GPL licensed code.
>
> Fair enough. Still at least for the normal cdf we could simply use the
references in the R code to write a Scipy version.


> If never seen it mentioned before that there is a direct function for
> log(norm.cdf). Which functions and packages in R implement the
> logarithm of the cdf of these distributions?
>

pnorm it is in the stats package for the log of the normal CDF. Kind of
essential for distributions like the powernormal as well that use the normal
cdf as a part of their pdf.

>
> The cdf for several distributions (including normal) is implement in
> Fortran or C in scipy.special, and I've never seen a log version for
> them.
>
> I looked at some of the distributions, and logpdf could be more
> efficiently calculated in many of them and very often also logcdf
>
> I opened a ticket for this
> http://projects.scipy.org/scipy/ticket/1184
>
> I also saw that there are still smaller, numerical improvements
> possible in several distributions.
>
> Thanks,
>
> Josef
>
> ______________________________________________
> SciPy-User mailing list
> SciPy-User at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20100529/c44fec94/attachment.html>


More information about the SciPy-User mailing list