Skip to main content
Module

x/simplestatistics/index.js>sampleCovariance

simple statistics for node & browser javascript
Go to Latest
function sampleCovariance
import { sampleCovariance } from "https://deno.land/x/simplestatistics@v7.7.5/index.js";

Sample covariance of two datasets: how much do the two datasets move together? x and y are two datasets, represented as arrays of numbers.

Examples

sampleCovariance([1, 2, 3, 4, 5, 6], [6, 5, 4, 3, 2, 1]); // => -3.5

Parameters

x

a sample of two or more data points

y

a sample of two or more data points