Skip to content

Commit

Permalink
fix logpdf complex error for RDM
Browse files Browse the repository at this point in the history
  • Loading branch information
itsdfish committed Mar 10, 2024
1 parent 8a42af7 commit 4091d6d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/RDM.jl
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ function pdf(d::WaldA, rt::Float64)
t = rt - τ
α = (k - t * ν) / (t)
β = (A + k - t * ν) / (t)
return (-ν * Φ(α) + 1 / (t) * ϕ(α) + ν * Φ(β) - 1 / (t) * ϕ(β)) / A
dens = (-ν * Φ(α) + 1 / (t) * ϕ(α) + ν * Φ(β) - 1 / (t) * ϕ(β)) / A
return max(eps(), dens)
end

logpdf(d::WaldA, rt::Float64) = log(pdf(d, rt))
Expand Down

0 comments on commit 4091d6d

Please sign in to comment.