Expand description
Multivariate distributions (SciPy’s multivariate_normal, multivariate_t, dirichlet,
wishart, invwishart and multinomial): densities, moments, entropies and sampling.
Matrices are Vec<Vec<f64>> of rows.
See the book entry Multivariate distributions and further tests.
Structs§
- Dirichlet
- The Dirichlet distribution on the simplex (SciPy’s
dirichlet(α)):f(x) = Π x_i^{α_i − 1} / B(α),B(α) = Π Γ(α_i) / Γ(α₀),α₀ = Σ α_i. - InvWishart
- The inverse Wishart distribution of
X⁻¹forX ~ Wishart(ν, Ψ⁻¹)(SciPy’sinvwishart(df, scale = Ψ)):log f(X) = (ν/2) log|Ψ| − (νp/2) log 2 − log Γ_p(ν/2) − ((ν + p + 1)/2) log|X| − tr(Ψ X⁻¹)/2. - Multinomial
- The multinomial distribution of the counts of
nindependent draws fromp.len()categories with probabilitiesp(SciPy’smultinomial(n, p)). - Multivariate
Normal - The multivariate normal distribution
N(μ, Σ)(SciPy’smultivariate_normal), for a positive definiteΣ:log f(x) = −½ (d log 2π + log|Σ| + (x − μ)ᵀ Σ⁻¹ (x − μ)), with the quadratic form computed as‖L⁻¹(x − μ)‖²from the Cholesky factorΣ = L Lᵀ. - MultivariateT
- The multivariate Student t distribution with location
μ, shapeΣandνdegrees of freedom (SciPy’smultivariate_t):X = μ + Z/√(W/ν),Z ~ N(0, Σ),W ~ χ²_ν. - Wishart
- The Wishart distribution of
X = Σ_k z_k z_kᵀ,z_k ~ N(0, S), withν > p − 1degrees of freedom (SciPy’swishart(df, scale)):log f(X) = ((ν − p − 1)/2) log|X| − tr(S⁻¹X)/2 − (νp/2) log 2 − (ν/2) log|S| − log Γ_p(ν/2). Sampling uses Bartlett’s decompositionX = L A Aᵀ Lᵀ,Alower triangular withA_ii = √χ²_{ν−i}and standard normal entries below the diagonal.