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

Example code contains errors #181

Closed
EliaBernardi opened this issue Jan 29, 2023 · 3 comments
Closed

Example code contains errors #181

EliaBernardi opened this issue Jan 29, 2023 · 3 comments

Comments

@EliaBernardi
Copy link

I am struggling with MultivariateNormal creation.
I read the documentation https://docs.rs/statrs/0.13.0/statrs/distribution/struct.MultivariateNormal.html and tried to copy and paste the example code, but it won't compile because it contains errors.

I'm using
statrs = "0.16.0"
nalgebra = "0.32.1"

even though I tried with many different version of the libraries (suggested by the error) I can't make it work.

@EliaBernardi
Copy link
Author

EliaBernardi commented Jan 29, 2023

This code works


let mvn = MultivariateNormal::new(vec![0., 0.], vec![1., 0., 0., 1.]).unwrap();
let a =  DVector::from(vec![1.,1.]);
println!("PDF : {:?}",mvn.pdf(&a));

I used these versions of the libraries:
statrs = "0.14.0"
nalgebra = "0.26.2"

@YeungOnion
Copy link
Contributor

YeungOnion commented Apr 27, 2024

I think it would be good to document that the API for MultivariateNormal introduces a public dependency for nalgebra::DVector, but what would you consider this issue's status?

@YeungOnion
Copy link
Contributor

closing for now, started discussing this issue and related in broader scope in #225

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