Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mistake in documentation for density of inverse Wishart distribution? #37

Open
EoghanONeill opened this issue Jan 13, 2024 · 1 comment

Comments

@EoghanONeill
Copy link

Lines 25 to 30 of https://github.com/LaplacesDemonR/LaplacesDemon/blob/master/man/dist.Inverse.Wishart.Rd are currently

Density: \eqn{p(\theta) = (2^{\nu k/2} \pi^{k(k-1)/4}
      \prod^k_{i=1} \Gamma(\frac{\nu+1-i}{2}))^{-1} |\textbf{S}|^{nu/2}
      |\Omega|^{-(nu-k-1)/2} \exp(-\frac{1}{2} tr(\textbf{S}
      \Omega^{-1}))}{p(theta) = (2^(nu*k/2) * pi^(k(k-1)/4) *
      [Gamma((nu+1-i)/2) * ... * Gamma((nu+1-k)/2)])^(-1) * |S|^(nu/2) *
      |Omega|^(-(nu-k-1)/2) * exp(-(1/2) * tr(S Omega^(-1)))}

I think these line should be edited to

Density: \eqn{p(\theta) = (2^{\nu k/2} \pi^{k(k-1)/4}
      \prod^k_{i=1} \Gamma(\frac{\nu+1-i}{2}))^{-1} |\textbf{S}|^{\nu/2}
      |\Omega|^{-(\nu+k+1)/2} \exp(-\frac{1}{2} tr(\textbf{S}
      \Omega^{-1}))}{p(theta) = (2^(nu*k/2) * pi^(k(k-1)/4) *
      [Gamma((nu+1-i)/2) * ... * Gamma((nu+1-k)/2)])^(-1) * |S|^(nu/2) *
      |Omega|^(-(nu+k+1)/2) * exp(-(1/2) * tr(S Omega^(-1)))}

https://en.wikipedia.org/wiki/Inverse-Wishart_distribution

Also it would be clearer if the density were written with Sigma instead of Omega because the function argument is Sigma.

I think there is no mistake in the density calculation in the function itself.

@singmann
Copy link
Contributor

Feel free to submit a pull request with this change and I am very likely to accept it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants