Learn R Programming

BayesianTools (version 0.1.8)

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

Description

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

Usage

logSumExp(x, mean = F)

Arguments

x

values at log scale

mean

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

Author

Florian Hartig

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