Log Sum of Exponentials
Compute log( exp(x)+exp(y) )
without floating overflow or underflow
logsumexp(x, y)
x |
a numeric vector or matrix. |
y |
a numeric vector or matrix of same size as |
The computation uses logcosh()
.
Numeric vector or matrix of same dimensions as x
.
Gordon K Smyth
x <- y <- c(1e-8,1e-7,1e-6,1e-5,1e-4,1,3,50,800) logsumexp(x,y) log( exp(x)+exp(y) )
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.