Skip to main content

correlation_matrix

Function correlation_matrix 

Source
pub fn correlation_matrix(
    series: &[&[f64]],
    means: &[f64],
    variances: &[f64],
) -> Vec<Vec<f64>>
Expand description

Compute the Pearson correlation matrix from return series.

series[i] is the return series for asset i. All series must have the same length. means[i] and variances[i] are the pre-computed mean and sample variance for series i.