LostTech.TensorFlow : API Documentation

Type WishartFull

Namespace tensorflow.contrib.distributions

Parent _WishartLinearOperator

Interfaces IWishartFull

The matrix Wishart distribution on positive definite matrices.

This distribution is defined by a scalar degrees of freedom `df` and a symmetric, positive definite scale matrix.

Evaluation of the pdf, determinant, and sampling are all `O(k^3)` operations where `(k, k)` is the event space shape.

#### Mathematical Details

The probability density function (pdf) is,

```none pdf(X; df, scale) = det(X)**(0.5 (df-k-1)) exp(-0.5 tr[inv(scale) X]) / Z Z = 2**(0.5 df k) |det(scale)|**(0.5 df) Gamma_k(0.5 df) ```

where: * `df >= k` denotes the degrees of freedom, * `scale` is a symmetric, positive definite, `k x k` matrix, * `Z` is the normalizing constant, and, * `Gamma_k` is the [multivariate Gamma function]( https://en.wikipedia.org/wiki/Multivariate_gamma_function).

#### Examples
Show Example
import tensorflow_probability as tfp
            tfd = tfp.distributions 

# Initialize a single 3x3 Wishart with Full factored scale matrix and 5 # degrees-of-freedom.(*) df = 5 scale =... # Shape is [3, 3]; positive definite. dist = tfd.WishartFull(df=df, scale=scale)

# Evaluate this on an observation in R^3, returning a scalar. x =... # A 3x3 positive definite matrix. dist.prob(x) # Shape is [], a scalar.

# Evaluate this on a two observations, each in R^{3x3}, returning a length two # Tensor. x = [x0, x1] # Shape is [2, 3, 3]. dist.prob(x) # Shape is [2].

# Initialize two 3x3 Wisharts with Full factored scale matrices. df = [5, 4] scale =... # Shape is [2, 3, 3]. dist = tfd.WishartFull(df=df, scale=scale)

# Evaluate this on four observations. x = [[x0, x1], [x2, x3]] # Shape is [2, 2, 3, 3]; xi is positive definite. dist.prob(x) # Shape is [2, 2].

# (*) - To efficiently create a trainable covariance matrix, see the example # in tfd.matrix_diag_transform.


Public properties

object allow_nan_stats get;

object allow_nan_stats_dyn get;

TensorShape batch_shape get;

object batch_shape_dyn get;

bool cholesky_input_output_matrices get;

object cholesky_input_output_matrices_dyn get;

object df get;

object df_dyn get;

object dimension get;

object dimension_dyn get;

object dtype get;

object dtype_dyn get;

TensorShape event_shape get;

object event_shape_dyn get;

string name get;

object name_dyn get;

IDictionary<object, object> parameters get;

object parameters_dyn get;

object PythonObject get;

object reparameterization_type get;

object reparameterization_type_dyn get;

object scale_operator get;

object scale_operator_dyn get;

object validate_args get;

object validate_args_dyn get;