Calculate the exponent of a vector (offset by the max), sum the elements, calculate the log, remove the offset.

logsumexp(x)

Arguments

x

numeric vector

Value

The LSE.

Examples

  logsumexp(1:10)