According to Gelman et al book, page 73, if
$p(\mu, \Sigma) \propto |\Sigma|^{-(d+1)/2}$
then
$\Sigma \mid y \sim \text{Inv-Wishart}(S^{-1})$ with $n-1$ degrees of freedom
for
$$S = \sum_i (y_i - \bar{y})(y_i - \bar{y})^T$$
I cannot get the inverse, $S^{-1}$, am I missing something please? Here is how I do it:
By construction any matrix $\sum_i X_i X_i^T$ will have the Wishart distribution if $X$ is drawn from the multivariate normal distribution (with known covariance matrix). Hence $S$ will follow the Wishart with $n-1$ degrees of freedom (conditional on $\Sigma$):
$$S \sim W_{n-1}(\Sigma)$$
with density:
$$ \operatorname{p}(S \mid \Sigma) = \frac{ |S|^{ \frac{1}{2}(n-d-2) } \exp\Big[ -\frac{1}{2} \operatorname{Tr}(\Sigma^{-1} S) \Big] }{ 2^{\frac{1}{2}(n-1)d } |\Sigma|^{(n-1)/2} \Gamma_d(\frac{n-1}{2}) } $$
From Bayes theorem:
$p(\Sigma \mid S) \,\, p(S) = p(S \mid \Sigma) \,\, p(\Sigma)$ and since $S\sim W_{n-1}(\Sigma)$ we get:
\begin{align} \operatorname{p}(\Sigma \mid S, \text{data}) & \propto\operatorname{p}(S \mid \Sigma) \cdot |\Sigma|^{-(d+1)/2} \nonumber \\ & \propto |\Sigma|^{-(n+d)/2} \exp\big[ -\frac{1}{2} \operatorname{Tr}(\Sigma^{-1} \, S)\big] \nonumber \end{align}
Isnt the last one the density (up to a scalar) of the Inv-Wishart($S$)? According to the book, it should have been the Inv-Wishart($S^{-1}$) instead.
What am i doing wrong please?