logsumexp {BayesCPclust} | R Documentation |
Transfor a vector with over- or underflow
Description
Transfor a vector with over- or underflow
Usage
logsumexp(x, min_x = Inf)
Arguments
x |
A vector with numbers |
min_x |
A numerical value to represent the minimum value to perform comparison with the actual minimum value of 'x' |
Value
'logsumexp' returns each element of the vector 'x' transformed using the Log-Sum-Exp trick.
Examples
# Transforming all elements in a vector using the Log-Sum-Exp trick
x <- c(1, 2, 3, 4, 5, 6)
logsumexp(x)
[Package BayesCPclust version 0.1.0 Index]