I'm trying to build my basic intuition on covariance, but am confused about the notation I typically see:
cov(X,Y) = E[(X - E[X])(Y - E[Y])]
Why is there no summation sign in this formula, and why are the X's capitalized? Consider this basic example to see where I'm slipping up.
To find the covariance, it seems like we:
- find the distance between a single observed value of variable X (thus my confusion with X...why isn't it Xi?) and the expected value of X (the sample mean)
- do the same for the first observation of variable Y
- multiply these together
- repeat this process for each observation separately (again, my confusion on using X instead of Xi)
- add up these cross-products (thus my confusion with no summation symbol)
- divide by n-1 because my expected values are sample means (thus my confusion on no division in the formula)
How does the formula I mention (see on Wikipedia) represent the calculation above? I want to know what I am misunderstanding about either the steps or the notation.