Returns the sample covariance of the values in two data sets.
This is the average of the products of the deviations of each pair of data points from their respective means.
Syntax:
COVARIANCE.S( x‑data:Range or Array, y‑data:Range or Array )
Formula:
COVARIANCE.S = ( i ∑1n (xi − x) ⋅ (yi − y) ) ∕ (n − 1)
where n is the number of values, xi is the i‑th value in the x‑data, x is the arithmetic mean of the x‑data, yi is the i‑th value in the y‑data, and y is the arithmetic mean of the y‑data.
Example:
COVARIANCE.S(A1:A15, B1:B15)
returns the sample covariance of the contents of cells in the range A1:A15
and those in B1:B15
.
Note:
COVARIANCE.S()
is implemented using a two-pass approach, first independently computing the mean values,
then computing intermediate values (such as the sum of the squares, products) using the difference between each value and the corresponding mean value.
This approach helps avoid many round-off errors and is also employed by Microsoft Excel 2003 and later.
Revisions:
This function was added in Fireworkz 2.00.