View source: R/distributions.r
log_sum_exp | R Documentation |
Numerically stable computation of log sums of exponentiated values.
log_sum_exp( x )
x |
vector of values |
This function is used by WAIC
to compute the log average probability used in the formula for WAIC. In that context, a vector of log-probabilities is passed to log_sum_exp
, obviating the need to explicitly exponentiate. This helps to avoid rounding errors that occur when working with direct probabilities.
Richard McElreath
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.