Skip to content

Commit

Permalink
improve numerical stability for kuma sample
Browse files Browse the repository at this point in the history
  • Loading branch information
xukai92 committed Apr 28, 2019
1 parent 27a65a6 commit 3a52b96
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/distributions/beta.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ end
function _u2logkumaraswamysample(T, u, kuma::BatchKumaraswamy)
_one = one(T)
_eps = eps(T)
return log.(_one .- exp.(log.(u) ./ kuma.b)) ./ kuma.a
return log.(_one .- exp.(log.(u .+ _eps) ./ kuma.b)) ./ kuma.a
end

"""
Expand Down

0 comments on commit 3a52b96

Please sign in to comment.