Distributions over Unbounded Vectors
The unbounded vector probability distributions have support on all of
Multivariate normal distribution
Probability density function
If
Distribution statement
y ~
multi_normal
(mu, Sigma)
Increment target log probability density with multi_normal_lupdf(y | mu, Sigma)
.
Stan functions
The multivariate normal probability function is overloaded to allow the variate vector
real
multi_normal_lpdf
(vectors y | vectors mu, matrix Sigma)
The log of the multivariate normal density of vector(s) y given location vector(s) mu and covariance matrix Sigma
real
multi_normal_lupdf
(vectors y | vectors mu, matrix Sigma)
The log of the multivariate normal density of vector(s) y given location vector(s) mu and covariance matrix Sigma dropping constant additive terms
real
multi_normal_lpdf
(vectors y | row_vectors mu, matrix Sigma)
The log of the multivariate normal density of vector(s) y given location row vector(s) mu and covariance matrix Sigma
real
multi_normal_lupdf
(vectors y | row_vectors mu, matrix Sigma)
The log of the multivariate normal density of vector(s) y given location row vector(s) mu and covariance matrix Sigma dropping constant additive terms
real
multi_normal_lpdf
(row_vectors y | vectors mu, matrix Sigma)
The log of the multivariate normal density of row vector(s) y given location vector(s) mu and covariance matrix Sigma
real
multi_normal_lupdf
(row_vectors y | vectors mu, matrix Sigma)
The log of the multivariate normal density of row vector(s) y given location vector(s) mu and covariance matrix Sigma dropping constant additive terms
real
multi_normal_lpdf
(row_vectors y | row_vectors mu, matrix Sigma)
The log of the multivariate normal density of row vector(s) y given location row vector(s) mu and covariance matrix Sigma
real
multi_normal_lupdf
(row_vectors y | row_vectors mu, matrix Sigma)
The log of the multivariate normal density of row vector(s) y given location row vector(s) mu and covariance matrix Sigma dropping constant additive terms
Although there is a direct multi-normal RNG function, if more than one result is required, it’s much more efficient to Cholesky factor the covariance matrix and call multi_normal_cholesky_rng
; see section multi-variate normal, cholesky parameterization.
vector
multi_normal_rng
(vector mu, matrix Sigma)
Generate a multivariate normal variate with location mu and covariance matrix Sigma; may only be used in transformed data and generated quantities blocks
vector
multi_normal_rng
(row_vector mu, matrix Sigma)
Generate a multivariate normal variate with location mu and covariance matrix Sigma; may only be used in transformed data and generated quantities blocks
vectors
multi_normal_rng
(vectors mu, matrix Sigma)
Generate an array of multivariate normal variates with locations mu and covariance matrix Sigma; may only be used in transformed data and generated quantities blocks
vectors
multi_normal_rng
(row_vectors mu, matrix Sigma)
Generate an array of multivariate normal variates with locations mu and covariance matrix Sigma; may only be used in transformed data and generated quantities blocks
Multivariate normal distribution, precision parameterization
Probability density function
If
Distribution statement
y ~
multi_normal_prec
(mu, Omega)
Increment target log probability density with multi_normal_prec_lupdf(y | mu, Omega)
.
Stan functions
real
multi_normal_prec_lpdf
(vectors y | vectors mu, matrix Omega)
The log of the multivariate normal density of vector(s) y given location vector(s) mu and positive definite precision matrix Omega
real
multi_normal_prec_lupdf
(vectors y | vectors mu, matrix Omega)
The log of the multivariate normal density of vector(s) y given location vector(s) mu and positive definite precision matrix Omega dropping constant additive terms
real
multi_normal_prec_lpdf
(vectors y | row_vectors mu, matrix Omega)
The log of the multivariate normal density of vector(s) y given location row vector(s) mu and positive definite precision matrix Omega
real
multi_normal_prec_lupdf
(vectors y | row_vectors mu, matrix Omega)
The log of the multivariate normal density of vector(s) y given location row vector(s) mu and positive definite precision matrix Omega dropping constant additive terms
real
multi_normal_prec_lpdf
(row_vectors y | vectors mu, matrix Omega)
The log of the multivariate normal density of row vector(s) y given location vector(s) mu and positive definite precision matrix Omega
real
multi_normal_prec_lupdf
(row_vectors y | vectors mu, matrix Omega)
The log of the multivariate normal density of row vector(s) y given location vector(s) mu and positive definite precision matrix Omega dropping constant additive terms
real
multi_normal_prec_lpdf
(row_vectors y | row_vectors mu, matrix Omega)
The log of the multivariate normal density of row vector(s) y given location row vector(s) mu and positive definite precision matrix Omega
real
multi_normal_prec_lupdf
(row_vectors y | row_vectors mu, matrix Omega)
The log of the multivariate normal density of row vector(s) y given location row vector(s) mu and positive definite precision matrix Omega dropping constant additive terms
Multivariate normal distribution, Cholesky parameterization
Probability density function
If
Distribution statement
y ~
multi_normal_cholesky
(mu, L)
Increment target log probability density with multi_normal_cholesky_lupdf(y | mu, L)
.
Stan functions
real
multi_normal_cholesky_lpdf
(vectors y | vectors mu, matrix L)
The log of the multivariate normal density of vector(s) y given location vector(s) mu and lower-triangular Cholesky factor of the covariance matrix L
real
multi_normal_cholesky_lupdf
(vectors y | vectors mu, matrix L)
The log of the multivariate normal density of vector(s) y given location vector(s) mu and lower-triangular Cholesky factor of the covariance matrix L dropping constant additive terms
real
multi_normal_cholesky_lpdf
(vectors y | row_vectors mu, matrix L)
The log of the multivariate normal density of vector(s) y given location row vector(s) mu and lower-triangular Cholesky factor of the covariance matrix L
real
multi_normal_cholesky_lupdf
(vectors y | row_vectors mu, matrix L)
The log of the multivariate normal density of vector(s) y given location row vector(s) mu and lower-triangular Cholesky factor of the covariance matrix L dropping constant additive terms
real
multi_normal_cholesky_lpdf
(row_vectors y | vectors mu, matrix L)
The log of the multivariate normal density of row vector(s) y given location vector(s) mu and lower-triangular Cholesky factor of the covariance matrix L
real
multi_normal_cholesky_lupdf
(row_vectors y | vectors mu, matrix L)
The log of the multivariate normal density of row vector(s) y given location vector(s) mu and lower-triangular Cholesky factor of the covariance matrix L dropping constant additive terms
real
multi_normal_cholesky_lpdf
(row_vectors y | row_vectors mu, matrix L)
The log of the multivariate normal density of row vector(s) y given location row vector(s) mu and lower-triangular Cholesky factor of the covariance matrix L
real
multi_normal_cholesky_lupdf
(row_vectors y | row_vectors mu, matrix L)
The log of the multivariate normal density of row vector(s) y given location row vector(s) mu and lower-triangular Cholesky factor of the covariance matrix L dropping constant additive terms
vector
multi_normal_cholesky_rng
(vector mu, matrix L)
Generate a multivariate normal variate with location mu and lower-triangular Cholesky factor of the covariance matrix L; may only be used in transformed data and generated quantities blocks
vector
multi_normal_cholesky_rng
(row_vector mu, matrix L)
Generate a multivariate normal variate with location mu and lower-triangular Cholesky factor of the covariance matrix L; may only be used in transformed data and generated quantities blocks
vectors
multi_normal_cholesky_rng
(vectors mu, matrix L)
Generate an array of multivariate normal variates with locations mu and lower-triangular Cholesky factor of the covariance matrix L; may only be used in transformed data and generated quantities blocks
vectors
multi_normal_cholesky_rng
(row_vectors mu, matrix L)
Generate an array of multivariate normal variates with locations mu and lower-triangular Cholesky factor of the covariance matrix L; may only be used in transformed data and generated quantities blocks
Multivariate Gaussian process distribution
Probability density function
If
Distribution statement
y ~
multi_gp
(Sigma, w)
Increment target log probability density with multi_gp_lupdf(y | Sigma, w)
.
Stan functions
real
multi_gp_lpdf
(matrix y | matrix Sigma, vector w)
The log of the multivariate GP density of matrix y given kernel matrix Sigma and inverses scales w
real
multi_gp_lupdf
(matrix y | matrix Sigma, vector w)
The log of the multivariate GP density of matrix y given kernel matrix Sigma and inverses scales w dropping constant additive terms
Multivariate Gaussian process distribution, Cholesky parameterization
Probability density function
If
Distribution statement
y ~
multi_gp_cholesky
(L, w)
Increment target log probability density with multi_gp_cholesky_lupdf(y | L, w)
.
Stan functions
real
multi_gp_cholesky_lpdf
(matrix y | matrix L, vector w)
The log of the multivariate GP density of matrix y given lower-triangular Cholesky factor of the kernel matrix L and inverses scales w
real
multi_gp_cholesky_lupdf
(matrix y | matrix L, vector w)
The log of the multivariate GP density of matrix y given lower-triangular Cholesky factor of the kernel matrix L and inverses scales w dropping constant additive terms
Multivariate Student-t distribution
Probability density function
If
Distribution statement
y ~
multi_student_t
(nu, mu, Sigma)
Increment target log probability density with multi_student_t_lupdf(y | nu, mu, Sigma)
.
Stan functions
real
multi_student_t_lpdf
(vectors y | real nu, vectors mu, matrix Sigma)
The log of the multivariate Student-
real
multi_student_t_lupdf
(vectors y | real nu, vectors mu, matrix Sigma)
The log of the multivariate Student-
real
multi_student_t_lpdf
(vectors y | real nu, row_vectors mu, matrix Sigma)
The log of the multivariate Student-
real
multi_student_t_lupdf
(vectors y | real nu, row_vectors mu, matrix Sigma)
The log of the multivariate Student-
real
multi_student_t_lpdf
(row_vectors y | real nu, vectors mu, matrix Sigma)
The log of the multivariate Student-
real
multi_student_t_lupdf
(row_vectors y | real nu, vectors mu, matrix Sigma)
The log of the multivariate Student-
real
multi_student_t_lpdf
(row_vectors y | real nu, row_vectors mu, matrix Sigma)
The log of the multivariate Student-
real
multi_student_t_lupdf
(row_vectors y | real nu, row_vectors mu, matrix Sigma)
The log of the multivariate Student-
vector
multi_student_t_rng
(real nu, vector mu, matrix Sigma)
Generate a multivariate Student-
vector
multi_student_t_rng
(real nu, row_vector mu, matrix Sigma)
Generate a multivariate Student-
vectors
multi_student_t_rng
(real nu, vectors mu, matrix Sigma)
Generate an array of multivariate Student-
vectors
multi_student_t_rng
(real nu, row_vectors mu, matrix Sigma)
Generate an array of multivariate Student-
Multivariate Student-t distribution, Cholesky parameterization
Probability density function
Let
Distribution statement
y ~
multi_student_t_cholesky
(nu, mu, L)
Increment target log probability density with multi_student_t_cholesky_lupdf(y | nu, mu, L)
.
Stan functions
real
multi_student_t_cholesky_lpdf
(vectors y | real nu, vectors mu, matrix L)
The log of the multivariate Student-y
given degrees of freedom nu
, location vector or array of vectors mu
, and Cholesky factor of the scale matrix L
. For a definition of the arguments compatible with the vectors
type, see the probability vectorization section.
real
multi_student_t_cholesky_lupdf
(vectors y | real nu, vectors mu, matrix L)
The log of the multivariate Student-y
given degrees of freedom nu
, location vector or vector array mu
, and Cholesky factor of the scale matrix L
, dropping constant additive terms. For a definition of arguments compatible with the vectors
type, see the probability vectorization section.
vector
multi_student_t_cholesky_rng
(real nu, vector mu, matrix L)
Generate a multivariate Student-nu
, location mu
, and Cholesky factor of the scale matrix L
; may only be used in transformed data and generated quantities blocks.
array[] vector
multi_student_t_cholesky_rng
(real nu, array[] vector mu, matrix L)
Generate a multivariate Student-nu
, location array mu
, and Cholesky factor of the scale matrix L
; may only be used in transformed data and generated quantities blocks.
array[] vector
multi_student_t_cholesky_rng
(real nu, array[] row_vector mu, matrix L)
Generate an array of multivariate Student-nu
, location array mu
, and Cholesky factor of the scale matrix L
; may only be used in transformed data and generated quantities blocks.
Gaussian dynamic linear models
A Gaussian Dynamic Linear model is defined as follows, For
Distribution statement
y ~
gaussian_dlm_obs
(F, G, V, W, m0, C0)
Increment target log probability density with gaussian_dlm_obs_lupdf(y | F, G, V, W, m0, C0)
.
Stan functions
The following two functions differ in the type of their V, the first taking a full observation covariance matrix V and the second a vector V representing the diagonal of the observation covariance matrix. The sampling statement defined in the previous section works with either type of observation V.
real
gaussian_dlm_obs_lpdf
(matrix y | matrix F, matrix G, matrix V, matrix W, vector m0, matrix C0)
The log of the density of the Gaussian Dynamic Linear model with observation matrix y in which rows are variables and columns are observations, design matrix F, transition matrix G, observation covariance matrix V, system covariance matrix W, and the initial state is distributed normal with mean m0 and covariance C0.
real
gaussian_dlm_obs_lupdf
(matrix y | matrix F, matrix G, matrix V, matrix W, vector m0, matrix C0)
The log of the density of the Gaussian Dynamic Linear model with observation matrix y in which rows are variables and columns are observations, design matrix F, transition matrix G, observation covariance matrix V, system covariance matrix W, and the initial state is distributed normal with mean m0 and covariance C0. This function drops constant additive terms.
real
gaussian_dlm_obs_lpdf
(matrix y | matrix F, matrix G, vector V, matrix W, vector m0, matrix C0)
The log of the density of the Gaussian Dynamic Linear model with observation matrix y in which rows are variables and columns are observations, design matrix F, transition matrix G, observation covariance matrix with diagonal V, system covariance matrix W, and the initial state is distributed normal with mean m0 and covariance C0.
real
gaussian_dlm_obs_lupdf
(matrix y | matrix F, matrix G, vector V, matrix W, vector m0, matrix C0)
The log of the density of the Gaussian Dynamic Linear model with observation matrix y in which rows are variables and columns are observations, design matrix F, transition matrix G, observation covariance matrix with diagonal V, system covariance matrix W, and the initial state is distributed normal with mean m0 and covariance C0. This function drops constant additive terms.