Skip to content

Commit 618e537

Browse files
added icdf for asymmetric laplace distribution
1 parent 2c355f1 commit 618e537

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

pymc/distributions/continuous.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1641,7 +1641,14 @@ def logp(value, b, kappa, mu):
16411641
kappa > 0,
16421642
msg="b > 0, kappa > 0",
16431643
)
1644-
1644+
def icdf(p, mu, b, kappa):
1645+
if b <= 0:
1646+
raise ValueError("Scale Parameter sigma must be positive")
1647+
if p <= 0.5:
1648+
res = mu - (b / kappa) * pt.log(2 * p)
1649+
if p > 0.5:
1650+
res = mu + (b / kappa) * pt.log(2 * (1 - p))
1651+
return res
16451652

16461653
class LogNormal(PositiveContinuous):
16471654
r"""

0 commit comments

Comments
 (0)