statistical. coVariance

new coVariance()

Methods

(static) p(array1, array2) → {number}

Returns covariance, the average of the products of paired deviations.

Parameters:
NameTypeDescription
array1number

The first value range of integers.

array2number

The second value range of integers.

Returns:

covariance, the average of the products of paired deviations or an error if the arguments are incorrect.

Type: 
number

(static) s(array1, array2) → {number|Error}

Returns the sample covariance, the average of the products deviations for each data point pair in two data sets.

Parameters:
NameTypeDescription
array1number

The first value range of integers.

array2number

The second value range of integers.

Returns:

Returns the covariance of the array1 and array2 vectors.

Type: 
number | Error