{ } Raw JSON

bundles / scipy 1.17.1 / scipy / stats / _multivariate / multivariate_t_gen

class

scipy.stats._multivariate:multivariate_t_gen

source: /scipy/stats/_multivariate.py :5036

Signature

class   multivariate_t_gen ( seed = None )

Members

Summary

A multivariate t-distributed random variable.

Extended Summary

The loc parameter specifies the location. The shape parameter specifies the positive semidefinite shape matrix. The df parameter specifies the degrees of freedom.

In addition to calling the methods below, the object itself may be called as a function to fix the location, shape matrix, and degrees of freedom parameters, returning a "frozen" multivariate t-distribution random.

Parameters

%(_mvt_doc_default_callparams)s
%(_doc_random_state)s

Methods

pdf(x, loc=None, shape=1, df=1, allow_singular=False)

Probability density function.

logpdf(x, loc=None, shape=1, df=1, allow_singular=False)

Log of the probability density function.

cdf(x, loc=None, shape=1, df=1, allow_singular=False, *,

maxpts=None, lower_limit=None, random_state=None) Cumulative distribution function.

rvs(loc=None, shape=1, df=1, size=1, random_state=None)

Draw random samples from a multivariate t-distribution.

entropy(loc=None, shape=1, df=1)

Differential entropy of a multivariate t-distribution.

marginal(dimensions, loc=None, shape=1, df=1, allow_singular=False)

Return a marginal multivariate t-distribution.

Notes

%(_mvt_doc_callparams_note)s The matrix shape must be a (symmetric) positive semidefinite matrix. The determinant and inverse of shape are computed as the pseudo-determinant and pseudo-inverse, respectively, so that shape does not need to have full rank.

The probability density function for multivariate_t is

where is the dimension of , is the -dimensional location, the -dimensional shape matrix, and is the degrees of freedom.

Examples

The object may be called (as a function) to fix the `loc`, `shape`, `df`, and `allow_singular` parameters, returning a "frozen" multivariate_t random variable:
import numpy as np
from scipy.stats import multivariate_t
rv = multivariate_t([1.0, -0.5], [[2.1, 0.3], [0.3, 1.5]], df=2)
Create a contour plot of the PDF.
import matplotlib.pyplot as plt
x, y = np.mgrid[-1:3:.01, -2:1.5:.01]
pos = np.dstack((x, y))
fig, ax = plt.subplots(1, 1)
ax.set_aspect('equal')
plt.contourf(x, y, rv.pdf(pos))

Aliases

  • scipy.stats._multivariate.multivariate_t_gen