powered by
Computes \(\log(\sum_i \exp(x_i))\) in a numerically stable way by subtracting the maximum value before exponentiation.
logsumexp(x)
A single numeric value: the log-sum-exp of x.
x
A numeric vector.
logsumexp(c(1000, 1001, 1002))
Run the code above in your browser using DataLab