|View source on GitHub|
tf.compat.v1.distributions.StudentT( df, loc, scale, validate_args=False, allow_nan_stats=True, name='StudentT' )
This distribution has parameters: degree of freedom
The probability density function (pdf) is,
pdf(x; df, mu, sigma) = (1 + y**2 / df)**(-0.5 (df + 1)) / Z where, y = (x - mu) / sigma Z = abs(sigma) sqrt(df pi) Gamma(0.5 df) / Gamma(0.5 (df + 1))
loc = mu,
scale = sigma, and,
Zis the normalization constant, and,
Gammais the gamma function.
The StudentT distribution is a member of the location-scale family, i.e., it can be constructed as,
X ~ StudentT(df, loc=0, scale=1) Y = loc + scale * X
scale has semantics more similar to standard deviation than
variance. However it is not actually the std. deviation; the Student's
t-distribution std. dev. is
scale sqrt(df / (df - 2)) when
df > 2.
Samples of this distribution are reparameterized (pathwise differentiable). The derivatives are computed using the approach described in (Figurnov et al., 2018).
Examples of initialization of one or a batch of distributions.
import tensorflow_probability as tfp tfd = tfp.distributions # Define a single scalar Student t distribution. single_dist = tfd.StudentT(df=3) # Evaluate the pdf at 1, returning a scalar Tensor. single_dist.prob(1.) # Define a batch of two scalar valued Student t's. # The first has degrees of freedom 2, mean 1, and scale 11. # The second 3, 2 and 22. multi_dist = tfd.StudentT(df=[2, 3], loc=[1, 2.], sc