Skip to main content

correlation_matrix

Function correlation_matrix 

Source
pub fn correlation_matrix(
    columns: &[Vec<f64>],
    method: CorrelationMethod,
) -> Result<Vec<Vec<f64>>, StatsError>
Expand description

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.

§Errors