bartz.mcmcstep.Wishart

class bartz.mcmcstep.Wishart(nu, rate, value)[source]

A precision matrix with a Wishart prior, bundled with its current value.

Represents a random precision (inverse covariance) value drawn from a Wishart prior with degrees of freedom nu and rate matrix rate. The univariate case (k = 1) is the Gamma special case; the relationship to the inverse-gamma prior on the variance is alpha = nu / 2, beta = rate / 2. The prior mean of the precision is nu * rate^-1.

Set nu and rate to None to represent a precision held fixed at value with no prior (e.g. the identity in binary regression).

nu: Float32[Array, ''] | None

Degrees of freedom of the Wishart prior, or None if there is no prior.

rate: Float32[Array, ''] | Float32[Array, 'k k'] | None

The rate matrix of the Wishart prior (scalar for univariate), or None if there is no prior. Equal to the inverse-gamma scale in the univariate case.

value: Float32[Array, '*chains k k'] | Float32[Array, '*chains']

The precision matrix (scalar for univariate).