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

LKJR Documentation

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)

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).

Details

See Stan Development Team for mathematical details.

Value

dlkj_corr_cholesky gives the density and rlkj_corr_cholesky generates random deviates.

Author(s)

Christopher Paciorek

References

Stan Development Team. Stan Reference Functions, version 2.27.

See Also

Distributions for other standard distributions

Examples

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


nimble documentation built on July 9, 2023, 5:24 p.m.