logSumExp: Funktion to compute log(sum(exp(x))

Description Usage Arguments Details Author(s)

View source: R/utils-Numerics.R

Description

Funktion to compute log(sum(exp(x))

Usage

1
logSumExp(x, mean = F)

Arguments

x

values at log scale

mean

logical, determines whether the mean should be used instead of the sum

Details

This function computes log(sum(exp(x)), using the offset trick to avoid numeric overflow, see, e.g. http://jblevins.org/notes/log-sum-exp. The mean option allows calculating logMeanExp

Author(s)

Florian Hartig


BayesianTools documentation built on Dec. 10, 2019, 1:08 a.m.