pymc.Wishart#
- class pymc.Wishart(name, *args, rng=None, dims=None, initval=None, observed=None, total_size=None, transform=UNSET, default_transform=UNSET, **kwargs)[source]#
Wishart distribution.
The Wishart distribution is the probability distribution of the maximum-likelihood estimator (MLE) of the precision matrix of a multivariate normal distribution. If V=1, the distribution is identical to the chi-square distribution with nu degrees of freedom.
\[f(X \mid nu, T) = \frac{{\mid T \mid}^{nu/2}{\mid X \mid}^{(nu-k-1)/2}}{2^{nu k/2} \Gamma_p(nu/2)} \exp\left\{ -\frac{1}{2} Tr(TX) \right\}\]where \(k\) is the rank of \(X\).
Support
\(X(p x p)\) positive definite matrix
Mean
\(nu V\)
Variance
\(nu (v_{ij}^2 + v_{ii} v_{jj})\)
- Parameters:
- nutensor_like of
int Degrees of freedom, > 0.
- Vtensor_like of
float p x p positive definite matrix.
- nutensor_like of
Notes
This distribution is not recommended as a prior distribution for MCMC sampling. Most samplers operate in unconstrained space and proposals rarely satisfy the symmetric positive definite constraint, causing sampling to fail or perform poorly. Consider using LKJCholeskyCov or LKJCorr instead.
Methods
Wishart.dist(nu, V, *args, **kwargs)Create a tensor variable corresponding to the cls distribution.