LogExpFunctions.jl icon indicating copy to clipboard operation
LogExpFunctions.jl copied to clipboard

Add logmeanexp

Open itsdfish opened this issue 1 year ago • 1 comments

Hi,

I noticed that R and Python have logmeanexp. I think this would be a simple, yet useful addition. I would be willing to make a PR. The basic function would be

function logmeanexp(X::AbstractArray{<:Number})
    return logsumexp(X) - log(length(X))
end

Some additional logic would be needed to handled the dims keyword.

itsdfish avatar Feb 18 '24 18:02 itsdfish

Is there a universally accepted definition of logmeanexp? I had to think about what it means.

tpapp avatar Dec 11 '24 14:12 tpapp