use-correlation 0.0.1

Covariance and Pearson correlation helpers over f64 slices.
Documentation
  • Coverage
  • 14.29%
    1 out of 7 items documented1 out of 4 items with examples
  • Size
  • Source code size: 5.2 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 320.64 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 33s Average build duration of successful builds.
  • all releases: 33s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • RustUse/use-stats
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • CloudBranch

Correlation helpers for f64 slices.

The crate provides a population covariance helper and a Pearson correlation helper for paired slices of equal length.

Examples

use use_correlation::{covariance, pearson_correlation};

let x = [1.0, 2.0, 3.0, 4.0, 5.0];
let y = [2.0, 4.0, 6.0, 8.0, 10.0];

assert_eq!(covariance(&x, &y).unwrap(), 4.0);
assert!((pearson_correlation(&x, &y).unwrap() - 1.0).abs() < 1.0e-12);