Learn R Programming

gmatrix (version 0.3)

gRowLogSums: Sum the up the rows in log space.

Description

Sum up the rows in log space.

Usage

gRowLogSums(x, startCol=1, endCol=ncol(x))

Arguments

x
A matrix
startCol
May be used to perform the log sum on only selected columns
endCol
May be used to perform the log sum on only selected columns

Value

Returns a vector with a value for each row.

Details

Calculates for each row vector v the value log(sum(exp(v))) in a way that avoids overflow. This function may be useful for mixture models. This function is only efficient for a large number of rows and a smaller number of columns.

See Also

%lgspadd%-methods