rust-ndarray / ndarray-stats

Statistical routines for ndarray
https://docs.rs/ndarray-stats
Apache License 2.0
201 stars 25 forks source link

Covariance not working in 0.4 #73

Closed ronniec95 closed 3 years ago

ronniec95 commented 3 years ago

This fails in 0.4

   use ndarray_stats::CorrelationExt;
    let or = ArrayView2::from_shape([prices.ncols(), prices.nrows() - 1], &pct_returns).unwrap();
    let cov_matrix = or.cov(1.0).expect("Could not calculate covariance matrix");

with

help: the following trait is implemented but not in scope; perhaps add a `use` for it:
   |
1  | use ndarray_stats::correlation::CorrelationExt;

but has no such issues in 0.3

A regression?

jturner314 commented 3 years ago

Are you sure that the versions of ndarray-stats and ndarray that you're using are compatible? ndarray-stats 0.4 provides functionality for ndarray 0.14, while ndarray-stats 0.3 provides functionality for ndarray 0.13.

ronniec95 commented 3 years ago

I see, but then the ndarray-linalg crate stops working. I'll wait till all three are in sync.