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

Add CDF for multivariate normal #178

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

Conversation

henryjac
Copy link
Contributor

Multivariate Normal CDF

Implements the multivariate normal CDF

Algorithm

Uses the algorithm as explained in Section 4.2.2 in Computation of Multivariate Normal and t Probabilities by Alan Genz and Frank Bretz, together with the cholesky decomposition with dynamic changing of rows explained in Section 4.1.3. Specifically we use a Quasi Monte Carlo method.

Additions

  • Trait ContinuousMultivariateCDF in mod.rs
  • Module MultivariateUniform in multivariate_uniform.rs (mainly for me wanting an in-house way to get uniform distribution in $[0,1]^n$). Implements mean, mode, pdf, cdf, min, max, ln_pdf.
  • Function chol_chrows for computing the Cholesky decomposition dynamically whilst changing rows for better integration limits
  • Function integrate_pdf to integrate a multivariate pdf between limits a and b
  • Implement ContinuousMultivariateCDF for MultivariateNormal (and MultivariateUniform), where cdf uses integrate_pdf with left limit a=[f64::NEG_INFINITY; dim] and right limit x=b
  • Tests cdf against scipy.stats.multivariate_normal.cdf in python, as well as MvNormalCDF in Julia
  • Import crate primes for generating first $n$ primes as Richtmyer generators in the Quasi MC algorithm

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.

None yet

2 participants