From my understanding, the expectation of vector (let’s say nx1) is equivalent to finding the mean. However if we have two vectors x and y, both of which are (nx1), what does it mean to try to find the expectation of the product of these vectors?
e.g:
E[x * y] = ?
Here are we taking the inner product or the outer product? If I was using Matlab, would I be doing:
E[x' * y]
or
E[x * y']
or
E[x .* y]
I’m not really understanding the intuition behind expectation as applied to the product of vectors (my background is not in mathematics), so if someone could shed light on this for me I would really appreciate it. Thanks!
== EDIT ==
You’re right, I wasn’t clear. I came across the definition of the covariance where the formula given was:
Cov[X; Y] = E[X * Y] - E[X] * E[Y]
And the part where E[X * Y] came up is what confused me. I should have put this up on a math site, and will next time. Thanks for the help.
Following on from @woodchips ‘s answer – when it does make sense to multiply two random variables and find the expectation of the product, in the discrete case it depends on whether you have the values for
XandYthat correspond with each other i.e. if for each event you have anxand ay. In that case to find the expectation of the product, you simply multiply each pair ofxandyyou have and find the mean. If they’re independent and you just have two vectors of samples and there is no co-occurrence, the expectation of the product is simply the product of their individual expectations.