From c1ab2922764ac5f27a4a6c35fca15509cfcde663 Mon Sep 17 00:00:00 2001 From: quildtide <42811940+quildtide@users.noreply.github.com> Date: Fri, 9 Aug 2024 03:36:56 -0400 Subject: [PATCH] Fix missing parentheses --- src/univariate/continuous/inversegaussian.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/univariate/continuous/inversegaussian.jl b/src/univariate/continuous/inversegaussian.jl index 443f8fd5f..63cbe0928 100644 --- a/src/univariate/continuous/inversegaussian.jl +++ b/src/univariate/continuous/inversegaussian.jl @@ -102,7 +102,7 @@ function cdf(d::InverseGaussian, x::Real) # 2λ/μ and normlogcdf(-u*(v+1)) are similar magnitude, opp. sign # truncating to [0, 1] as an additional precaution # Ref https://github.com/JuliaStats/Distributions.jl/issues/1873 - z = clamp(normcdf(u * (v - 1)) + exp(2λ / μ + normlogcdf(-u * (v + 1)), 0, 1) + z = clamp(normcdf(u * (v - 1)) + exp(2λ / μ + normlogcdf(-u * (v + 1)), 0, 1)) # otherwise `NaN` is returned for `+Inf` return isinf(x) && x > 0 ? one(z) : z @@ -116,7 +116,7 @@ function ccdf(d::InverseGaussian, x::Real) # 2λ/μ and normlogcdf(-u*(v+1)) are similar magnitude, opp. sign # truncating to [0, 1] as an additional precaution # Ref https://github.com/JuliaStats/Distributions.jl/issues/1873 - z = clamp(normccdf(u * (v - 1)) - exp(2λ / μ + normlogcdf(-u * (v + 1)), 0, 1) + z = clamp(normccdf(u * (v - 1)) - exp(2λ / μ + normlogcdf(-u * (v + 1)), 0, 1)) # otherwise `NaN` is returned for `+Inf` return isinf(x) && x > 0 ? zero(z) : z