InverseWishart#

class hybrid_aif.distributions.InverseWishart[source]#

Bases: Module

Inverse-Wishart posterior over a full noise covariance.

Psi is (*parent_shape, d, d) (positive definite), nu is (*parent_shape,) with the propriety floor ν > d − 1 (the mean exists from ν > d + 1).

Psi: Array#

The positive-definite scale matrices, (..., d, d).

nu: Array#

The degrees of freedom, (...,).

Psi0: Array | None = None#

The decay anchor for Psi (design D7); required iff decay < 1.

nu0: Array | None = None#

The decay anchor for nu (design D7); required iff decay < 1.

expected_precision()[source]#

E[R⁻¹] = ν Ψ⁻¹ — what mean-field conditioning consumes.

point()[source]#

R_chol under the expected-precision substitution: chol(Ψ/ν).

mean()[source]#

E[R] = Ψ/(ν − d − 1) (ν > d+1) — diagnostic, not consumed.

stats(scatter, count)[source]#

Package one tick’s statistic: full residual scatter (..., d, d) and responsibility mass (...,).

sample(key)[source]#

One noise draw as an R_chol array, via the Bartlett decomposition of W ~ Wishart(ν, Ψ⁻¹) and R = W⁻¹.

__init__(Psi, nu, Psi0=None, nu0=None)#