Skip to content

Commit c98b214

Browse files
Sayam753ricardoV94
andcommitted
Add suggestions
Co-authored-by: Ricardo <[email protected]>
1 parent eb3901d commit c98b214

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

pymc3/distributions/multivariate.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -316,8 +316,8 @@ class MvStudentT(Continuous):
316316
317317
Parameters
318318
----------
319-
nu: int
320-
Degrees of freedom.
319+
nu: float
320+
Degrees of freedom, should be a positive scalar.
321321
Sigma: matrix
322322
Covariance matrix. Use `cov` in new code.
323323
mu: array
@@ -339,8 +339,8 @@ def dist(cls, nu, Sigma=None, mu=None, cov=None, tau=None, chol=None, lower=True
339339
if cov is not None:
340340
raise ValueError("Specify only one of cov and Sigma")
341341
cov = Sigma
342-
nu = at.as_tensor_variable(nu)
343-
mu = at.as_tensor_variable(mu)
342+
nu = at.as_tensor_variable(floatX(nu))
343+
mu = at.as_tensor_variable(floatX(mu))
344344
cov = quaddist_matrix(cov, chol, tau, lower)
345345
return super().dist([nu, mu, cov], **kwargs)
346346

@@ -361,7 +361,7 @@ def logp(value, nu, mu, cov):
361361
quaddist, logdet, ok = quaddist_parse(value, mu, cov)
362362
k = floatX(value.shape[-1])
363363

364-
norm = gammaln((nu + k) / 2.0) - gammaln(nu / 2.0) - 0.5 * k * floatX(np.log(nu * np.pi))
364+
norm = gammaln((nu + k) / 2.0) - gammaln(nu / 2.0) - 0.5 * k * at.log(nu * np.pi)
365365
inner = -(nu + k) / 2.0 * at.log1p(quaddist / nu)
366366
return bound(norm + inner - logdet, ok)
367367

0 commit comments

Comments
 (0)