Skip to content

Commit fbd2103

Browse files
farhanreynaldoricardoV94
authored andcommitted
use existing aesara laplace implementation
1 parent 37acea6 commit fbd2103

File tree

2 files changed

+2
-22
lines changed

2 files changed

+2
-22
lines changed

pymc3/distributions/continuous.py

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
halfcauchy,
3535
halfnormal,
3636
invgamma,
37+
laplace,
3738
logistic,
3839
lognormal,
3940
normal,
@@ -1469,21 +1470,6 @@ def logcdf(value, mu):
14691470
)
14701471

14711472

1472-
class LaplaceRV(RandomVariable):
1473-
name = "laplace"
1474-
ndim_supp = 0
1475-
ndims_params = [0, 0]
1476-
dtype = "floatX"
1477-
_print_name = ("Laplace", "\\operatorname{Laplace}")
1478-
1479-
@classmethod
1480-
def rng_fn(cls, rng, mu, b, size=None):
1481-
return stats.laplace.rvs(mu, b, size=size, random_state=rng)
1482-
1483-
1484-
laplace = LaplaceRV()
1485-
1486-
14871473
class Laplace(Continuous):
14881474
r"""
14891475
Laplace log-likelihood.
@@ -1534,7 +1520,7 @@ def dist(cls, mu, b, *args, **kwargs):
15341520
mu = at.as_tensor_variable(floatX(mu))
15351521

15361522
assert_negative_support(b, "b", "Laplace")
1537-
return super().dist([mu, b], **kwargs)
1523+
return super().dist([mu, b], *args, **kwargs)
15381524

15391525
def logp(value, mu, b):
15401526
"""

pymc3/tests/test_distributions_random.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1123,12 +1123,6 @@ def ref_rand(size, mu, lam, alpha):
11231123
ref_rand=ref_rand,
11241124
)
11251125

1126-
def test_laplace(self):
1127-
def ref_rand(size, mu, b):
1128-
return st.laplace.rvs(mu, b, size=size)
1129-
1130-
pymc3_random(pm.Laplace, {"mu": R, "b": Rplus}, ref_rand=ref_rand)
1131-
11321126
@pytest.mark.xfail(reason="This distribution has not been refactored for v4")
11331127
def test_laplace_asymmetric(self):
11341128
def ref_rand(size, kappa, b, mu):

0 commit comments

Comments
 (0)