@@ -352,42 +352,49 @@ class MvStudentT(Continuous):
352
352
nu : tensor_like of float
353
353
Degrees of freedom, should be a positive scalar.
354
354
Sigma : tensor_like of float, optional
355
- Covariance matrix. Use `cov ` in new code.
355
+ Scale matrix. Use `scale ` in new code.
356
356
mu : tensor_like of float, optional
357
357
Vector of means.
358
- cov : tensor_like of float, optional
359
- The covariance matrix.
358
+ scale : tensor_like of float, optional
359
+ The scale matrix.
360
360
tau : tensor_like of float, optional
361
361
The precision matrix.
362
362
chol : tensor_like of float, optional
363
- The cholesky factor of the covariance matrix.
363
+ The cholesky factor of the scale matrix.
364
364
lower : bool, default=True
365
365
Whether the cholesky fatcor is given as a lower triangular matrix.
366
366
"""
367
367
rv_op = mv_studentt
368
368
369
369
@classmethod
370
- def dist (cls , nu , Sigma = None , mu = None , cov = None , tau = None , chol = None , lower = True , ** kwargs ):
370
+ def dist (cls , nu , Sigma = None , mu = None , scale = None , tau = None , chol = None , lower = True , ** kwargs ):
371
+ if kwargs .get ("cov" ) is not None :
372
+ warnings .warn (
373
+ "Use the scale argument to specify the scale matrix."
374
+ "cov will be removed in future versions." ,
375
+ FutureWarning ,
376
+ )
377
+ scale = kwargs .pop ("cov" )
371
378
if Sigma is not None :
372
- if cov is not None :
373
- raise ValueError ("Specify only one of cov and Sigma" )
374
- cov = Sigma
379
+ if scale is not None :
380
+ raise ValueError ("Specify only one of scale and Sigma" )
381
+ scale = Sigma
375
382
nu = at .as_tensor_variable (floatX (nu ))
376
383
mu = at .as_tensor_variable (floatX (mu ))
377
- cov = quaddist_matrix (cov , chol , tau , lower )
384
+ scale = quaddist_matrix (scale , chol , tau , lower )
378
385
# Aesara is stricter about the shape of mu, than PyMC used to be
379
- mu = at .broadcast_arrays (mu , cov [..., - 1 ])[0 ]
386
+ mu = at .broadcast_arrays (mu , scale [..., - 1 ])[0 ]
380
387
381
- return super ().dist ([nu , mu , cov ], ** kwargs )
388
+ return super ().dist ([nu , mu , scale ], ** kwargs )
382
389
383
- def moment (rv , size , nu , mu , cov ):
390
+ def moment (rv , size , nu , mu , scale ):
384
391
moment = mu
385
392
if not rv_size_is_none (size ):
386
393
moment_size = at .concatenate ([size , [mu .shape [- 1 ]]])
387
394
moment = at .full (moment_size , moment )
388
395
return moment
389
396
390
- def logp (value , nu , mu , cov ):
397
+ def logp (value , nu , mu , scale ):
391
398
"""
392
399
Calculate log-probability of Multivariate Student's T distribution
393
400
at specified value.
@@ -401,7 +408,7 @@ def logp(value, nu, mu, cov):
401
408
-------
402
409
TensorVariable
403
410
"""
404
- quaddist , logdet , ok = quaddist_parse (value , mu , cov )
411
+ quaddist , logdet , ok = quaddist_parse (value , mu , scale )
405
412
k = floatX (value .shape [- 1 ])
406
413
407
414
norm = gammaln ((nu + k ) / 2.0 ) - gammaln (nu / 2.0 ) - 0.5 * k * at .log (nu * np .pi )
0 commit comments