Skip to content

Commit 8ec1f08

Browse files
ricardoV94twiecki
authored andcommitted
Use PyTensor StudentT RV
1 parent ec70d86 commit 8ec1f08

File tree

1 file changed

+2
-16
lines changed

1 file changed

+2
-16
lines changed

pymc/distributions/continuous.py

+2-16
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
lognormal,
4949
normal,
5050
pareto,
51+
t,
5152
triangular,
5253
uniform,
5354
vonmises,
@@ -1733,21 +1734,6 @@ def icdf(value, mu, sigma):
17331734
Lognormal = LogNormal
17341735

17351736

1736-
class StudentTRV(RandomVariable):
1737-
name = "studentt"
1738-
ndim_supp = 0
1739-
ndims_params = [0, 0, 0]
1740-
dtype = "floatX"
1741-
_print_name = ("StudentT", "\\operatorname{StudentT}")
1742-
1743-
@classmethod
1744-
def rng_fn(cls, rng, nu, mu, sigma, size=None) -> np.ndarray:
1745-
return np.asarray(stats.t.rvs(nu, mu, sigma, size=size, random_state=rng))
1746-
1747-
1748-
studentt = StudentTRV()
1749-
1750-
17511737
class StudentT(Continuous):
17521738
r"""
17531739
Student's T log-likelihood.
@@ -1812,7 +1798,7 @@ class StudentT(Continuous):
18121798
with pm.Model():
18131799
x = pm.StudentT('x', nu=15, mu=0, lam=1/23)
18141800
"""
1815-
rv_op = studentt
1801+
rv_op = t
18161802

18171803
@classmethod
18181804
def dist(cls, nu, mu=0, *, sigma=None, lam=None, **kwargs):

0 commit comments

Comments
 (0)