Internal function, logsum (copied from coloc package)
logsum(x)
x | numeric vector |
---|
max(x) + log(sum(exp(x - max(x))))
This function calculates the log of the sum of the exponentiated logs taking out the max, i.e. insuring that the sum is not Inf
ie, you want sum(x), but have x already stored in logs. log(sum(exp(x))) might fail, but logsum(x) should work.
#> [1] 4.007333