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

Function angular_distance

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

Source from the content-addressed store, hash-verified

158}
159
160pub fn angular_distance(x: &[f64], y: &[f64]) -> CodependenceResult<f64> {
161 let corr_coef = corrcoef(x, y)?;
162 Ok((0.5 * (1.0 - corr_coef)).sqrt())
163}
164
165pub fn absolute_angular_distance(x: &[f64], y: &[f64]) -> CodependenceResult<f64> {
166 let corr_coef = corrcoef(x, y)?;

Callers 2

test_correlationsFunction · 0.85

Calls 1

corrcoefFunction · 0.70

Tested by 1

test_correlationsFunction · 0.68