wrathematics / coop

Fast covariance, correlation, and cosine similarity.
Other
35 stars 6 forks source link

support for pairwise.complete.obs #2

Closed rmflight closed 8 years ago

rmflight commented 8 years ago

Supporting the case when rows or columns of a matrix may have NA elements, but still want to calculate correlations between pairs, using only the entries that are non-NA between the pair.

Demonstration at the gist.

This is important because often times -omics data have lots of missing data, and complete.obs would trim to a very small number of features to use, so want to be able to consider completeness in a pairwise fashion.

wrathematics commented 8 years ago

Implemented in 1b72b107d90665895dadca0655a92c33321ef7dd for covariance and cosine. Correlation coming soon.

rmflight commented 8 years ago

Very cool! Looking forward to making use of this.

wrathematics commented 8 years ago

Implemented in https://github.com/wrathematics/coop/commit/c7d5bd7f425a741a9a9db4a2355a91c017dec1f7.

It's only about 2.5x faster than R's version on my machine, but I have some ideas about improving the performance. But it is feature complete at this time.