MCPcopy Index your code
hub / github.com/arrayfire/arrayfire-rust / corrcoef

Function corrcoef

src/statistics/mod.rs:439–455  ·  view source on GitHub ↗

Compute correlation coefficient # Parameters - `x` is the first Array - `y` isthe second Array # Return Values A tuple of 64-bit floating point values with the coefficients.

(x: &Array<T>, y: &Array<T>)

Source from the content-addressed store, hash-verified

437/// # Return Values
438/// A tuple of 64-bit floating point values with the coefficients.
439pub fn corrcoef<T>(x: &Array<T>, y: &Array<T>) -> (f64, f64)
440where
441 T: HasAfEnum + RealNumber,
442{
443 let mut real: f64 = 0.0;
444 let mut imag: f64 = 0.0;
445 unsafe {
446 let err_val = af_corrcoef(
447 &mut real as *mut c_double,
448 &mut imag as *mut c_double,
449 x.get(),
450 y.get(),
451 );
452 HANDLE_ERROR(AfError::from(err_val));
453 }
454 (real, imag)
455}
456
457/// Find top k elements along a given dimension
458///

Callers

nothing calls this directly

Calls 2

HANDLE_ERRORFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected