I declared the Cholesky factor of a correlation matrix by:
parameters{
...
cholesky_factor_corr[I] Cholesky_Omega;
...
}
In the transformed parameters block, I print it by using:
transformed parameters{
...
print(Cholesky_Omega);
...
}
However, the outputs of the print command show that some the values randomly drawn for Cholesky factor of correlation matrix (Cholesky_Omega) are [[1,0],[1,0]], whose diagonal entries are not strictly positive. In this case, if [[1,0],[1,0]] is multiplied by its transpose, the outcome matrix(which should be the correlation matrix) is not positive definite. But correlation matrix must be positive definite.
My question is do I need to constrain some elements in the declaration of Cholesky factor of correlation matrix to ensure that the randomly drawn Cholesky factors have stricly positive diagonal entries?
Hope Stan developers can see this and give advisable suggestions.