pub struct PearsonCorrelation;Expand description
Pearson correlation coefficient.
Implementations§
Source§impl PearsonCorrelation
impl PearsonCorrelation
Sourcepub fn compute(x: &[f64], y: &[f64]) -> Result<f64, MultivariateError>
pub fn compute(x: &[f64], y: &[f64]) -> Result<f64, MultivariateError>
Compute Pearson correlation between two equal-length slices.
NaN pairs are deleted pairwise. When either series has zero
variance the correlation is undefined and the result is NaN, not
0.0 — the convention RollingCorrelation and
rolling_corr, applied here for the same reason: 0.0 asserts “these
series are uncorrelated” where the truth is “there is nothing to
correlate”, and a caller acts on the first.
§Errors
MultivariateError::DimensionMismatch on unequal lengths, and
MultivariateError::InsufficientData with fewer than two usable
pairs.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PearsonCorrelation
impl RefUnwindSafe for PearsonCorrelation
impl Send for PearsonCorrelation
impl Sync for PearsonCorrelation
impl Unpin for PearsonCorrelation
impl UnsafeUnpin for PearsonCorrelation
impl UnwindSafe for PearsonCorrelation
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more