View source: R/utils-Numerics.R
logSumExp | R Documentation |
Funktion to compute log(sum(exp(x))
logSumExp(x, mean = F)
x |
values at log scale |
mean |
logical, determines whether the mean should be used instead of the sum |
This function computes log(sum(exp(x)), using the offset trick to avoid numeric overflow, see, e.g. http://jblevins.org/notes/log-sum-exp. The mean option allows calculating logMeanExp
Florian Hartig
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.