gRowLogSums: Sum the up the rows in log space.

Description Usage Arguments Details Value Author(s) See Also

View source: R/04operations.R

Description

Sum up the rows in log space.

Usage

1
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

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.

Value

Returns a vector with a value for each row.

Author(s)

Nathan Morris

See Also

%lgspadd%-methods


njm18/gmatrix documentation built on May 23, 2019, 7:07 p.m.