Density and random generation for the LKJ distribution for the Cholesky factor of a correlation matrix.
dlkj_corr_cholesky(x, eta, p, log = FALSE)rlkj_corr_cholesky(n = 1, eta, p)
dlkj_corr_cholesky
gives the density and rlkj_corr_cholesky
generates random deviates.
upper-triangular Cholesky factor of a correlation matrix.
shape parameter.
size of the correlation matrix (number of rows and columns); required because random generation function has no information about dimension of matrix to generate without this argument.
logical; if TRUE, probability density is returned on the log scale.
number of observations (only n=1
is handled currently).
Christopher Paciorek
See Stan Development Team for mathematical details.
Stan Development Team. Stan Reference Functions, version 2.27.
Distributions
for other standard distributions
eta <- 3
x <- rlkj_corr_cholesky(1, eta, 5)
dlkj_corr_cholesky(x, eta, 5)
Run the code above in your browser using DataLab