klyn.math.NDArray.correlation
method
public correlation(notnull other as NDArray<T>, ignoreNaN as Boolean = false) as Double
Description

Pearson correlation of two equally-sized 1D series.

Parameters
ParameterDescription
otherSecond series of the same numeric type and length.
ignoreNaNDrop NaN pairs; otherwise propagate NaN.
Returns

Correlation in [-1,1].

Throws
  • ValueException for mismatched/constant series or fewer than two samples.
  • NullException if other is null at runtime; statically null arguments are rejected with TypeError.
Example

coefficient = x.correlation(y)