-
Notifications
You must be signed in to change notification settings - Fork 226
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Log pdf support? #525
Comments
+1 on this. When using the log-likelihood method, you need the logpdf instead of the pdf. Many common distributions are of the exponential family, so the logpdf is calculated naturally internally, and code that computes the log-likelihood then effectively does the superfluous log(exp(logpdf)). The logpdf is also needed when the log-likelihood method is applied to additive models of the form pdf = z pdf_A + (1-z) pdf_B. There is a numerically stable way to compute log(exp(x1) + exp(x2)) (see https://numpy.org/doc/stable/reference/generated/numpy.logaddexp.html#numpy.logaddexp) where x1 and x2 are logpdf values. |
A fast, numerically stable log-sum-exp seems like the natural place to start with this. I don't have much context for this problem; are there enough terms that it should it be parallelized? |
Is the linked PR the first step of what you are looking for @HDembinski? Like you said it's not overly difficult to add logpdf support by distribution. |
@mborland : I think the hard part is getting the ULPs plots for all of these correct . . . but I think this is indeed a good start. |
Yes, although the arcsine distribution is not the first that comes to mind. Ideal targets are the normal, poisson, exponential, beta, gamma, ... |
I was wondering whether there is, or there are plans to add, an interface to compute the
logpdf
s to the random distributions.This would allow to more accurately manipulate probabilities without the need to first apply a log function to the output of the
pdf
andcdf
functions.The text was updated successfully, but these errors were encountered: