Description Usage Arguments Value
Given a sequence of numbers [\log(x_1), \log(x_2), ..., \log(x_n)], computes \log(∑_{i = 1}^n x_i).
For adding two numbers that are given in log space we use the expression max(x, y) + log1p(exp(-abs(x - y)))
which is a good approximation if x
and y
are of the same order of magnitude, but if they
are of very different sizes just returns the maximum of the two. To prevent adding numbers of very different
magnitude we iteratively add the numbers pairwise. Because of numerical issues with doing this, the order
of the input values can affect the result.
1 | log_sum_of_logs(log_values)
|
log_values |
Sequence of numbers in log space [\log(x_1), \log(x_2), ..., \log(x_n)]. |
\log(∑_{i = 1}^n x_i).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.