File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
src/univariate/continuous Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -102,7 +102,7 @@ function cdf(d::InverseGaussian, x::Real)
102
102
# 2λ/μ and normlogcdf(-u*(v+1)) are similar magnitude, opp. sign
103
103
# truncating to [0, 1] as an additional precaution
104
104
# Ref https://github.com/JuliaStats/Distributions.jl/issues/1873
105
- z = clamp (normcdf (u * (v - 1 )) + exp (2 λ / μ + normlogcdf (- u * (v + 1 )), 0 , 1 ) )
105
+ z = clamp (normcdf (u * (v - 1 )) + exp (2 λ / μ + normlogcdf (- u * (v + 1 ))) , 0 , 1 )
106
106
107
107
# otherwise `NaN` is returned for `+Inf`
108
108
return isinf (x) && x > 0 ? one (z) : z
@@ -116,7 +116,7 @@ function ccdf(d::InverseGaussian, x::Real)
116
116
# 2λ/μ and normlogcdf(-u*(v+1)) are similar magnitude, opp. sign
117
117
# truncating to [0, 1] as an additional precaution
118
118
# Ref https://github.com/JuliaStats/Distributions.jl/issues/1873
119
- z = clamp (normccdf (u * (v - 1 )) - exp (2 λ / μ + normlogcdf (- u * (v + 1 )), 0 , 1 ) )
119
+ z = clamp (normccdf (u * (v - 1 )) - exp (2 λ / μ + normlogcdf (- u * (v + 1 ))) , 0 , 1 )
120
120
121
121
# otherwise `NaN` is returned for `+Inf`
122
122
return isinf (x) && x > 0 ? zero (z) : z
You can’t perform that action at this time.
0 commit comments