24 Correlation Matrix Distributions

The correlation matrix distributions have support on the (Cholesky factors of) correlation matrices. A Cholesky factor \(L\) for a \(K \times K\) correlation matrix \(\Sigma\) of dimension \(K\) has rows of unit length so that the diagonal of \(L L^{\top}\) is the unit \(K\)-vector. Even though models are usually conceptualized in terms of correlation matrices, it is better to operationalize them in terms of their Cholesky factors. If you are interested in the posterior distribution of the correlations, you can recover them in the generated quantities block via

 generated quantities {
   corr_matrix[K] Sigma;
   Sigma = multiply_lower_tri_self_transpose(L);