Learn R Programming

nimble (version 1.2.1)

LKJ: The LKJ Distribution for the Cholesky Factor of a Correlation Matrix

Description

Density and random generation for the LKJ distribution for the Cholesky factor of a correlation matrix.

Usage

dlkj_corr_cholesky(x, eta, p, log = FALSE)

rlkj_corr_cholesky(n = 1, eta, p)

Value

dlkj_corr_cholesky gives the density and rlkj_corr_cholesky generates random deviates.

Arguments

x

upper-triangular Cholesky factor of a correlation matrix.

eta

shape parameter.

p

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.

log

logical; if TRUE, probability density is returned on the log scale.

n

number of observations (only n=1 is handled currently).

Author

Christopher Paciorek

Details

See Stan Development Team for mathematical details.

References

Stan Development Team. Stan Reference Functions, version 2.27.

See Also

Distributions for other standard distributions

Examples

Run this code
eta <- 3
x <- rlkj_corr_cholesky(1, eta, 5)
dlkj_corr_cholesky(x, eta, 5)

Run the code above in your browser using DataLab