Probability Distributions and their Stories
Continuous Multivariate distributions
Multivariate Gaussian, a.k.a. Multivariate Normal, distribution
- Story. This is a generalization of the univariate Gaussian.
- Example. Finch beaks are measured for beak depth and beak length. The resulting distribution of depths and length is Gaussian distributed. In this case, the Gaussian is bivariate, with
and
.
- Parameters. There is one vector-valued parameter,
, and a matrix-valued parameter,
, referred to respectively as the mean and covariance matrix. The covariance matrix is symmetric and strictly positive definite.
- Support. The K-variate Gaussian distribution is supported on
.
- Probability density function.
- Usage The usage below assumes that mu is a length K array, Sigma is a K×K symmetric positive definite matrix, and L is a K×K lower-triangular matrix with strictly positive values on teh diagonal that is a Cholesky factor.
- Related distributions.
- The Multivariate Gaussian is a generalization of the univariate Gaussian.
- Notes.
- The covariance matrix may also be written as
, where
,
and entry,
in the correlation matrix C is
Furthermore, becauseis symmetric and strictly positive definite, it can be uniquely defined in terms of its Cholesky decomposition,
, which satisfies
. In practice, you will almost always use the Cholesky representation of the Multivariate Gaussian distribution in Stan.
Package | Syntax |
---|---|
NumPy | np.random.multivariate_normal(mu, Sigma) |
SciPy | scipy.stats.multivariate_normal(mu, Sigma) |
Stan | multi_normal(mu, Sigma) |
NumPy Cholesky | np.random.multivariate_normal(mu, np.dot(L, L.T)) |
SciPy Cholesky | scipy.stats.multivariate_normal(mu, np.dot(L, L.T)) |
Stan Cholesky | multi_normal_cholesky(mu, L) |