Skip to content

Commit a6cc0ba

Browse files
committed
continuous.py updated
1 parent b9c335e commit a6cc0ba

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

pymc3/distributions/continuous.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1673,6 +1673,12 @@ class AsymmetricLaplace(Continuous):
16731673
\left({\frac{\\b}{\kappa + 1/\kappa}}\right)\,e^{-(x)\\b\,s\kappa ^{s}}}
16741674
where s = sgn(x)
16751675
1676+
Parameters
1677+
----------
1678+
b:
1679+
Scale parameter (b > 0)
1680+
kappa:
1681+
Symmetry parameter (kappa > 0)
16761682
16771683
See also: https://en.wikipedia.org/wiki/Asymmetric_Laplace_distribution
16781684
"""
@@ -1735,8 +1741,11 @@ def logp(self, value):
17351741
-------
17361742
TensorVariable
17371743
"""
1738-
return tt.log(self.b / (self.kappa + (self.kappa ** -1))) + (
1739-
-value * self.b * tt.sgn(value) * (self.kappa ** tt.sgn(value))
1744+
return bound(
1745+
tt.log(self.b / (self.kappa + (self.kappa ** -1)))
1746+
+ (-value * self.b * tt.sgn(value) * (self.kappa ** tt.sgn(value))),
1747+
0 < self.b,
1748+
0 < self.kappa,
17401749
)
17411750

17421751

0 commit comments

Comments
 (0)