Skip to content

Commit

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

"""
Expand Down

0 comments on commit bc4823b

Please sign in to comment.