sampleCovariance
sampleCovariance(
x,y):number
Defined in: src/sample_covariance.js:16
Sample covariance of two datasets: how much do the two datasets move together? x and y are two datasets, represented as arrays of numbers.
Parameters
Section titled “Parameters”number[]
a sample of two or more data points
number[]
a sample of two or more data points
Returns
Section titled “Returns”number
sample covariance
Throws
Section titled “Throws”if x and y do not have equal lengths
Throws
Section titled “Throws”if x or y have length of one or less
Example
Section titled “Example”sampleCovariance([1, 2, 3, 4, 5, 6], [6, 5, 4, 3, 2, 1]); // => -3.5