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

dmnorm implementation should invserve the precision matrix #103

Closed
sunxd3 opened this issue Sep 24, 2023 · 1 comment
Closed

dmnorm implementation should invserve the precision matrix #103

sunxd3 opened this issue Sep 24, 2023 · 1 comment

Comments

@sunxd3
Copy link
Member

sunxd3 commented Sep 24, 2023

In

"""
dmnorm(μ::Vector, T::Matrix)
Return a [Multivariate Normal](https://juliastats.org/Distributions.jl/latest/multivariate/#Distributions.MvNormal)
distribution object with mean vector `μ` and precision matrix `T`.
The mathematical form of the PDF for a Multivariate Normal distribution in the BUGS family of softwares is given by:
```math
p(x|μ,T) = (2π)^{-k/2} |T|^{1/2} e^{-1/2 (x-μ)' T (x-μ)}
```
"""
function dmnorm::Vector, T::Matrix)
return MvNormal(μ, T)
end

consider https://juliastats.org/Distributions.jl/latest/multivariate/#Distributions.AbstractMvNormal and https://www.multibugs.org/documentation/latest/Distributions.html#MultivariateNormal

The precision matrix should be inverted before creating the MvNormal distribution

@sunxd3
Copy link
Member Author

sunxd3 commented Sep 25, 2023

fixed by #106

@sunxd3 sunxd3 closed this as completed Sep 26, 2023
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

1 participant