MCPcopy Create free account
hub / github.com/Open-Quant/openquant / squared_angular_distance

Function squared_angular_distance

crates/openquant/src/codependence.rs:170–173  ·  view source on GitHub ↗
(x: &[f64], y: &[f64])

Source from the content-addressed store, hash-verified

168}
169
170pub fn squared_angular_distance(x: &[f64], y: &[f64]) -> CodependenceResult<f64> {
171 let corr_coef = corrcoef(x, y)?;
172 Ok((0.5 * (1.0 - corr_coef.powi(2))).sqrt())
173}
174
175pub fn distance_correlation(x: &[f64], y: &[f64]) -> CodependenceResult<f64> {
176 if x.len() != y.len() {

Callers 2

test_correlationsFunction · 0.85

Calls 1

corrcoefFunction · 0.70

Tested by 1

test_correlationsFunction · 0.68