# Computing the PDF of a WishartMatrixDistribution. Is this a limitation in the PDF Mathematica function?

I'm trying to compute the pdf of a wishart distribution.

Why does

PDF[WishartMatrixDistribution[10, IdentityMatrix[4]],
2*IdentityMatrix[4]]


not return a number? The output I get is exactly the same line of code... There are no error warnings, nothing.

• I just changed the title to reflect the fact that the problem pertains to WishartMatrixDistribution and not to WishartDistribution - this may be misleading. Change it back if you are not comfortable with that. – gwr Nov 23 '18 at 11:30
• I believe the matrix distributions do not work with PDF. – Szabolcs Nov 23 '18 at 18:31

Unfortunately, it seems that WishartMatrixDistribution cannot be used with PDF. But you can use the MultivariateStatistics package:

Needs[ "MultivariateStatistics"];
PDF[ WishartDistribution[ IdentityMatrix[4], 10], 2*IdentityMatrix[4] ]


$$\frac{1}{1\,814\,400\,e^4\,\pi^4}$$

The definition for WishartDistribution is exactly the same as that for the WishartMatrixDistribution as far as I can see - but the parameterization is reverted.

• As a further comment, PDF does not work with WishartMatrix not even when you sample from it and then plug the values into PDF[dist, x]. The documentation suggests a Series expansion, but for distributions without known functional forms - which Wishart and Inverse Wishart have. Also, the parametrisation is indeed reversed. – Titus Nov 23 '18 at 11:17
• gwr, thanks for the answer. It seems to work now, but something seems off. Now, in the programme, when I use MultinormalDistribution or the MultivariateTDistribution, their names show in a different colour, as if they were spelled wrong... Do you have an idea of what's happening? – An old man in the sea. Nov 23 '18 at 11:20
• @Anoldmaninthesea. That is called shadowing and you can read up on it here. Once you start with a fresh kernel and load the package first everything should be fine again. – gwr Nov 23 '18 at 11:22
• That's the thing... I quit the kernel, and rebooted it, and I still get the same red colour... – An old man in the sea. Nov 23 '18 at 11:23
• @Anoldmaninthesea. You need to load the package first before you use the symbol. There is more explanation in the link I sent you and has to do with Contexts`. – gwr Nov 23 '18 at 11:25