You entered x = { 1 , 2 , 3 } y = { 2 , 4 , 6 } x = \left\{ 1,\ 2,\ 3 \right\} \quad y = \left\{ 2,\ 4,\ 6 \right\} x = { 1 , 2 , 3 } y = { 2 , 4 , 6 }
Sample covariance 2 , population covariance 1.333333 \displaystyle \text{Sample covariance } 2,\ \text{population covariance } 1.333333 Sample covariance 2 , population covariance 1.333333 Copy result Copy link
Fraction
4 3 \displaystyle \frac{4}{3} 3 4 Show the work 1 Means of x and y
Covariance measures how x and y move together around their means, so find the means first. There are n = 3 n = 3 n = 3 pairs.
x ˉ = 2 y ˉ = 4 \begin{gathered} \bar{x} = 2 \\ \bar{y} = 4 \end{gathered} x ˉ = 2 y ˉ = 4 2 Sum of products of deviations
Each pair contributes the product of its two deviations: positive when both are above or both below their means, negative when one is above and the other below.
S x y = ∑ ( x − x ˉ ) ( y − y ˉ ) = ( 1 − 2 ) ( 2 − 4 ) + ( 2 − 2 ) ( 4 − 4 ) + ( 3 − 2 ) ( 6 − 4 ) = 4 \begin{aligned} S_{xy} &= \sum \left(x - \bar{x}\right)\left(y - \bar{y}\right) \\ &= \left(1 - 2\right)\left(2 - 4\right) + \left(2 - 2\right)\left(4 - 4\right) + \left(3 - 2\right)\left(6 - 4\right) \\ &= 4 \end{aligned} S x y = ∑ ( x − x ˉ ) ( y − y ˉ ) = ( 1 − 2 ) ( 2 − 4 ) + ( 2 − 2 ) ( 4 − 4 ) + ( 3 − 2 ) ( 6 − 4 ) = 4 3 Covariance
Divide by n − 1 n - 1 n − 1 when the pairs are a sample, and by n n n when they are the whole population.
Using s x y = S x y n − 1 , σ x y = S x y n s_{xy} = \frac{S_{xy}}{n - 1},\quad \sigma_{xy} = \frac{S_{xy}}{n} s x y = n − 1 S x y , σ x y = n S x y
s x y = 4 2 = 2 σ x y = 4 3 ≈ 1.333333 \begin{gathered} s_{xy} = \frac{4}{2} = 2 \\ \sigma_{xy} = \frac{4}{3} \approx 1.333333 \end{gathered} s x y = 2 4 = 2 σ x y = 3 4 ≈ 1.333333 4 Result
So the sample covariance is 2 2 2 and the population covariance is 4 3 ≈ 1.333333 \frac{4}{3} \approx 1.333333 3 4 ≈ 1.333333 .