chickadee » statistics » covariance

covariance xs ysprocedure

Returns the sample covariance of the paired values xs and ys: sum (x - mean x) (y - mean y) / (n - 1). The two sequences must have the same size, at least two. Exact inputs give an exact result.

> (covariance '(2 4 4 5 7 9 10 15) '(1 3 2 5 6 8 11 13))
123/7