logsumexp: Transfor a vector with over- or underflow

View source: R/logsumexp.R

logsumexpR 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)

BayesCPclust documentation built on April 4, 2025, 5:19 a.m.