pub struct Correlation {
pub negative: bool,
pub numerator: BigUint,
pub denominator: BigUint,
}Expand description
The Pearson correlation of two objectives over a set of edges, kept exact: its sign and its square as a fraction.
ρ = cov / sqrt(var_i · var_j), so ρ² = cov² / (var_i · var_j), all
computed from the integer sums n Σxy - Σx Σy, n Σx² - (Σx)²
without rounding.
Fields§
§negative: booltrue for ρ < 0.
numerator: BigUintcov² (times n²).
denominator: BigUintvar_i · var_j (times n²); zero when an objective is constant,
where the correlation is undefined.
Implementations§
Trait Implementations§
Source§impl Clone for Correlation
impl Clone for Correlation
Source§impl Debug for Correlation
impl Debug for Correlation
impl Eq for Correlation
Source§impl PartialEq for Correlation
impl PartialEq for Correlation
impl StructuralPartialEq for Correlation
Auto Trait Implementations§
impl Forget for Correlation
impl Freeze for Correlation
impl Move for Correlation
impl RefUnwindSafe for Correlation
impl Send for Correlation
impl Sync for Correlation
impl Unpin for Correlation
impl UnsafeUnpin for Correlation
impl UnwindSafe for Correlation
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more