Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

logsumexp

Log Sum of Exponentials


Description

Compute log( exp(x)+exp(y) ) without floating overflow or underflow

Usage

logsumexp(x, y)

Arguments

x

a numeric vector or matrix.

y

a numeric vector or matrix of same size as x.

Details

The computation uses logcosh().

Value

Numeric vector or matrix of same dimensions as x.

Author(s)

Gordon K Smyth

See Also

Examples

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) )

limma

Linear Models for Microarray Data

v3.46.0
GPL (>=2)
Authors
Gordon Smyth [cre,aut], Yifang Hu [ctb], Matthew Ritchie [ctb], Jeremy Silver [ctb], James Wettenhall [ctb], Davis McCarthy [ctb], Di Wu [ctb], Wei Shi [ctb], Belinda Phipson [ctb], Aaron Lun [ctb], Natalie Thorne [ctb], Alicia Oshlack [ctb], Carolyn de Graaf [ctb], Yunshun Chen [ctb], Mette Langaas [ctb], Egil Ferkingstad [ctb], Marcus Davy [ctb], Francois Pepin [ctb], Dongseok Choi [ctb]
Initial release
2020-10-19

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.