Learn R Programming

rethinking (version 2.13)

log_sum_exp: Rethinking utility functions

Description

Numerically stable computation of log sums of exponentiated values.

Usage

log_sum_exp( x )

Arguments

x

vector of values

Details

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.