Skip to content

compute covariance

kgryte edited this page May 12, 2015 · 1 revision

Computes the covariance between one or more numeric arrays.

var x = [ 1, 2, 3, 4, 5 ],
	y = [ 5, 4, 3, 2, 1 ];

var mat = compute.covariance( x, y );
// returns [[2.5,-2.5],[-2.5,2.5]]

For method options, see compute-covariance.

Clone this wiki locally