klyn.math.NDArray.covariance
method
public covariance(notnull other as NDArray<T>, ddof as Long = 1l, ignoreNaN as Boolean = false) as Double
Description

Sample covariance of two equally-sized 1D series, in Double. Uses paired centered online moments; no centered tensor copies are made.

Parameters
ParameterDescription
otherSecond series of the same numeric type and length.
ddofNon-negative correction; default 1 estimates sample covariance.
ignoreNaNDrop a pair if either member is NaN, otherwise propagate NaN.
Returns

Scalar covariance.

Throws
  • ValueException for non-1D/mismatched series or insufficient samples.
  • NullException if other is null at runtime; statically null arguments are rejected with TypeError.
Example

value = x.covariance(y, ddof=0l)