-
-
Notifications
You must be signed in to change notification settings - Fork 198
Closed
Labels
Milestone
Description
Summary:
The boundary conditions are off for negative infinite values. Currently, we have
log_sum_exp(log(0), log(0)) = nan
log_diff_exp(log(0), log(0)) = nan
log_diff_exp(log(1), log(1)) = nan
and they should all return negative infinity. For example,
log_sum_exp(log(0), log(0))
= log_sum_exp(-inf, -inf)
= log(exp(-inf) + exp(-inf))
= log(0 + 0)
= -inf
Now some care is going to have to be taken to manage the derivatives. We may not be able to chain rule through the resulting negative infinities for an expression like exp(log_sum_exp(log(0), log(0))). The more doc explaining what's going on in the math lib (and Stan doc itself), the better.
Originally reported by Dalton Hance on Discourse:
http://discourse.mc-stan.org/t/log-0-and-stan-arithmetic/2171
Current Version:
v2.17.0
jan-glx and maxbiostat