correlation
Calculates the Pearson correlation coefficient for two same-length arrays.
API Reference
Signature
Parameters
Returns
Returns the Pearson correlation coefficient, or NaN when either side has zero variance.
Throws
- Throws if either input is not a non-empty array.
- Throws if the arrays have different lengths.
- Throws if any value is non-finite.
Agent Contract
Agent Notes
correlationuses Pearson correlation.- Expect
NaNfor zero-variance inputs.