Skip to content

Commit e92fa8a

Browse files
authored
Merge branch 'pymc-devs:main' into distributions_parameter
2 parents 6b4b71f + b7764dd commit e92fa8a

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

pymc/distributions/continuous.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1385,6 +1385,15 @@ def logcdf(value, mu):
13851385
msg="lam >= 0",
13861386
)
13871387

1388+
def icdf(value, mu):
1389+
res = -mu * pt.log(1 - value)
1390+
res = check_icdf_value(res, value)
1391+
return check_icdf_parameters(
1392+
res,
1393+
mu >= 0,
1394+
msg="mu >= 0",
1395+
)
1396+
13881397

13891398
class Laplace(Continuous):
13901399
r"""

tests/distributions/test_continuous.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,11 @@ def test_exponential(self):
438438
{"lam": Rplus},
439439
lambda value, lam: st.expon.logcdf(value, 0, 1 / lam),
440440
)
441+
check_icdf(
442+
pm.Exponential,
443+
{"lam": Rplus},
444+
lambda q, lam: st.expon.ppf(q, loc=0, scale=1 / lam),
445+
)
441446

442447
def test_laplace(self):
443448
check_logp(

0 commit comments

Comments
 (0)