Skip to content

pearsonCorrelation(first, second): number

Defined in: packages/distribution/src/sample-statistics.ts:263

Pearson product-moment correlation coefficient, clamped to [-1, 1] against floating-point overshoot.

NumericSample

NumericSample

number

INVALID_SAMPLE when the lengths differ, a sample holds fewer than 2 values, or a value is non-finite; ZERO_VARIANCE when either sample is constant.