maxbiostat / truncation_tests

Preliminary code to test truncation algorithms for infinite series and their applications in Statistics.
GNU General Public License v3.0
2 stars 1 forks source link

Resist the temptation of implementing a naive streaming log_sum_exp #7

Closed maxbiostat closed 2 years ago

maxbiostat commented 3 years ago

The original implementation of the algorithms had a streaming structure doing

ans <- log_sum_exp(c(ans, lterm))

This naive implementation loses precision fast. See: http://www.nowozin.net/sebastian/blog/streaming-log-sum-exp-computation.html

maxbiostat commented 2 years ago

Resolved in sumR.