logsumexp | R Documentation |
Calculation of the log of the sum of exponential of x, but avoids computational underflow / overflow
logsumexp(x)
x |
vector |
the logarithm of the sum of the exponentials of elements of x i.e. returns log(sum(exp(x)))
x <- c(1000.01, 1000.02) y1 <- log(sum(exp(x))) print(y1) y2 <- logsumexp(x) print(y2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.