bartz.testing.LKJ

class bartz.testing.LKJ(eta)[source]

LKJ distribution, with density proportional to \(\det(R)^{\eta - 1}\).

eta=1 is uniform over correlation matrices; a larger eta concentrates them around the identity. The marginal of each off-diagonal entry is \((R_{cc'} + 1) / 2 \sim \mathrm{Beta}(\eta - 1 + k/2, \eta - 1 + k/2)\), so the correlations shrink as k grows; use Factor for strong correlations across many components.

eta: Float[Array, ''] | float

Concentration parameter, > 0.

sample_chol(key, k)[source]

Sample the Cholesky factor directly with the onion method.

Return type:

Float[Array, 'k k']

offdiag_var(k)[source]

E[R_cc' ** 2] = 1 / (2 eta + k - 1).

Return type:

Float[Array, ''] | float