Skip to main content

Module correlation

Module correlation 

Source
Expand description

Pearson and Spearman correlation, and correlation matrices.

Enums§

CorrelationMethod
Which correlation coefficient to compute.

Functions§

correlation_matrix
Correlation matrix of columns (each inner slice is one variable’s values, all the same length). The diagonal is exactly 1.0; any pair with a constant column yields f64::NAN in that cell (so a chart can render it as a distinct “undefined” color) rather than erroring out the whole matrix.
pearson
Pearson correlation of two equal-length samples.
rank
Fractional ranks of data (average ranks for ties), 1-based. Used by Spearman correlation.
spearman
Spearman rank correlation — Pearson correlation of the ranks.