Learn R Programming

dst (version 1.8.0)

logsum: Adding small probabilities

Description

Adding small probabilities

Usage

logsum(l1, l2)

Value

sum of probabilities exp(l1)+exp(l2)

Arguments

l1

log probabilities

l2

log probabilities

Author

Peiyuan Zhu

Examples

Run this code
# sum of two 1e-5
exp(logsum(log(1e-5),log(1e-5)))

Run the code above in your browser using DataLab