Skip to content

Commit 5a2265f

Browse files
Update continuous.py
1 parent 8baf68b commit 5a2265f

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

pymc/distributions/continuous.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3012,7 +3012,13 @@ def cdf_difference(x):
30123012
derivative = norm.pdf(x) - 2 * alpha * norm.pdf(alpha * x)
30133013
x -= derivative
30143014

3015-
return mu + sigma * x
3015+
res = mu + sigma * x
3016+
res = check_icdf_value(res, prob)
3017+
return check_parameters(
3018+
res,
3019+
sigma > 0,
3020+
msg="sigma > 0"
3021+
)
30163022

30173023

30183024
class Triangular(BoundedContinuous):
@@ -3377,8 +3383,13 @@ def cdf_derivative(x):
33773383
+ (x / sigma**2) * pt.exp(-x**2 / (2 * sigma**2)) * ive(0, x * nu / sigma**2)) * nu / sigma**2
33783384

33793385
approx_icdf = newton(cdf, x0, fprime=cdf_derivative, tol=tol, maxiter=max_iter)
3380-
3381-
return approx_icdf
3386+
res = approx_icdf
3387+
res = check_icdf_value(res, prob)
3388+
return check_parameters(
3389+
res,
3390+
sigma > 0,
3391+
msg="sigma > 0"
3392+
)
33823393

33833394
class Logistic(Continuous):
33843395
r"""

0 commit comments

Comments
 (0)