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

Adds Wishart and InverseWishart distributions #170

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

egordm
Copy link

@egordm egordm commented Jul 7, 2022

This pr adds Wishart and InverseWishart distributions along with multivariate gamma functions mvgamma and mvlgamma.

mathnet implementations were used as a reference: Wishart and Inverse Wishart
The Distributions.jl Julia package was used to create the testcases and as a cross-reference.

Thanks

Edit: Sorry for creating a duplicate pr. I have closed the previous one.

@YeungOnion
Copy link
Contributor

Thanks for contributing, I do want to introduce this, but after release 0.17 since we're hoping to get more feedback on the multivariate API, see #209, and this should match what have there.

@YeungOnion YeungOnion modified the milestone: Future May 24, 2024
@egordm
Copy link
Author

egordm commented May 28, 2024

Thanks! Sounds good. I am keeping an eye on it. Let me know if any changes need to be made.

@YeungOnion
Copy link
Contributor

#209 is merged,

Modifications to match are mostly in the pattern of choosing OVector<f64, D> in lieu of DVector<f64> (similar for DMatrix to OMatrix) with appropriate trait bounds on D. Might require more blocks of impl<D> for [Inverse]Wishart of varying trait bounds on D.

let s = w.sample(rng);

s.cholesky().unwrap().inverse().symmetric_part()
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you consider implementing sample_iter to rely on a single conversion to Wishart to obtain multiple samples?

@YeungOnion YeungOnion linked an issue Sep 18, 2024 that may be closed by this pull request
@YeungOnion YeungOnion modified the milestones: Future, 0.18 Sep 18, 2024
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

Successfully merging this pull request may close these issues.

Multivariate Normal/Inverse-Wishart distribution
2 participants