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

I wonder why MultivariateNormal::new need for Vec<f64> #168

Closed
chatblanc-ciel opened this issue Jun 13, 2022 · 0 comments
Closed

I wonder why MultivariateNormal::new need for Vec<f64> #168

chatblanc-ciel opened this issue Jun 13, 2022 · 0 comments

Comments

@chatblanc-ciel
Copy link

chatblanc-ciel commented Jun 13, 2022

I thinking using nalgebra's vector and matrix is good.
For example,

fn new_from_nalgebra(mean :nalgebra::DVector<f64>, cov :nalgebra::DMatrix<f64>) -> statrs::Result<Self> {
/* here is not necessary
        let mean = DVector::from_vec(mean);
        let cov = DMatrix::from_vec(mean.len(), mean.len(), cov);
*/
        let dim = mean.len();
        // Check that the provided covariance matrix is symmetric
// omitted others

What do you think about this?

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