covariance_s
Sample covariance.
Syntax
Section titled “Syntax”v = covariance_s(array1, array2)Description
Section titled “Description”Returns the sample covariance — sum((x - mean(x)) * (y - mean(y))) / (n-1). Equivalent to Excel’s COVARIANCE.S.
Example
Section titled “Example”covariance_s([1 2 3 4], [4 3 2 1]) % -1.667See also
Section titled “See also”covariance_p— Population covariance.pearson— Pearson product-moment correlation coefficient.cov— Covariance.