Learn R Programming

matrixStats (version 0.12.2)

rowLogSumExps: Accurately computes the logarithm of the sum of exponentials across rows or columns

Description

Accurately computes the logarithm of the sum of exponentials across rows or columns.

Usage

rowLogSumExps(lx, na.rm=FALSE, dim.=dim(lx), ...)
 colLogSumExps(lx, na.rm=FALSE, dim.=dim(lx), ...)

Arguments

lx
A numeric NxK matrix. Typically lx are $log(x)$ values.
na.rm
If TRUE, any missing values are ignored, otherwise not.
dim.
An integer vector of length two specifying the dimension of x, also when not a mat
...
Not used.

Value

Benchmarking

These methods are implemented in native code and have been optimized for speed and memory.

See Also

To calculate the same on vectors, logSumExp().