distributions-io / todo

3 stars 1 forks source link

Log-Densities #1

Open Planeshifter opened 8 years ago

Planeshifter commented 8 years ago

For PDF / PMF and CDF modules, it would be good to have an option to request the logarithm of the density or probability instead. This functionality is e.g. useful for maximum likelihood estimation and Bayesian statistics.

kgryte commented 8 years ago

Why not just do log( pdf( x ) )? Any particular advantage for making it part of the API for those modules?

Planeshifter commented 8 years ago

Numerical accuracy. In some cases at least, it is possible to calculate the log-densities differently or alternatively forego exponentiating the end result. Hence, R and Julia both provide explicit functionality to calculate log-densities.