logsum: logsum

Description Usage Arguments Details Value Author(s)

View source: R/priors.R View source: R/functions_moloc.R

Description

Internal function, logsum

Internal function, logsum

Usage

1
2
3
logsum(x)

logsum(x)

Arguments

x

numeric vector

Details

This function calculates the log of the sum of the exponentiated logs taking out the max, i.e. insuring that the sum is not Inf

Value

max(x) + log(sum(exp(x - max(x))))

Author(s)

Claudia Giambartolomei, Vincent Plagnol

Claudia Giambartolomei


clagiamba/moloc documentation built on Jan. 25, 2021, 2:43 a.m.