28.2 Wishart distribution, Cholesky Parameterization
The Cholesky parameterization of the Wishart distribution uses a Cholesky factor for both the variate and the parameter. If S and W are positive definite matrices with Cholesky factors LS and LW (i.e., S=LSL⊤S and W=LWL⊤W), then the Cholesky parameterization is defined so that LW∼WishartCholesky(ν,LS) if and only if W∼Wishart(ν,S).
28.2.1 Probability density function
If K∈N, ν∈(K−1,∞), and LS,LW∈RK×K are lower triangular matrixes with positive diagonal elements, then the Cholesky parameterized Wishart density is WishartCholesky(LW∣ν,LS)=Wishart(LWL⊤W∣ν,LSL⊤S)|Jf−1|, where Jf−1 is the Jacobian of the (inverse) transform of the variate, f−1(LW)=LWL⊤W. The log absolute determinant is log|Jf−1|=Klog(2)+K∑k=1(K−k+1)log(LW)k,k.
The probability functions will raise errors if ν≤K−1 or if LS and LW are not Cholesky factors (square, lower-triangular matrices with positive diagonal elements) of the same size.
28.2.2 Stan functions
real
wishart_cholesky_lpdf
(matrix L_W | real nu, matrix L_S)
Return the log of the Wishart density for lower-triangular Cholesky factor L_W
given degrees of freedom nu
and lower-triangular Cholesky factor of the
scale matrix L_S
.
Available since 2.30
real
wishart_cholesky_lupdf
(matrix L_W | real nu, matrix L_S)
Return the log of the Wishart density for lower-triangular Cholesky factor of L_W
given degrees of freedom nu
and lower-triangular Cholesky factor of the
scale matrix L_S
dropping constant additive terms.
Available since 2.30
matrix
wishart_cholesky_rng
(real nu, matrix L_S)
Generate the Cholesky factor of a Wishart variate with degrees of freedom nu
and
lower-triangular Cholesky factor of the scale matrix L_S
; may only be used in
transformed data and generated quantities blocks
Available since 2.30