# Latest content was relocated to https://bintanvictor.wordpress.com. This old blog will be shutdown soon.

## Thursday, December 4, 2014

### expectation of 2 (possibly correlated) random variables multiplied

I guess this is too basic to be covered other sites.

First, a random variable is not a regular variable we use in algebra or calculus. It's more like a noisegen...

Second, X1 * X2 is not really multiplying 2 numbers and you get another number. This expression actually represents a random variable that is strictly "controlled" by 2 other (possibly correlated) random variables. At any moment, the output is the product of those two
outputs.

E[ X1*X2 ] how can we simplify, and how is it related to E[X1]*E[X2] ?

Let's denote u1 as the expectation or population mean of X1. The key formula is

E[X1*X2] = u1*u2 + Cov(X1 , X2)

case: when independent or uncorrelated, E[X1*X2] = u1*u2
case: when positively correlated, Cov > 0, so E[X1*X2] > u1*u2
case: when negatively correlated, Cov < 0, so E[X1*X2] < u1*u2

Easily verifiable in matlab --

a=[1:5]'
b=-a
cov(a,b)
mean(a.*a)
mean(a.*b)