Tell me more ×
Cross Validated is a question and answer site for statisticians, data analysts, data miners and data visualization experts. It's 100% free, no registration required.

If I have two normally distributed random variables, X and Y, and I want to find the mean of the distribution that results from multiplying them together, which of the following two formulas should I use, and why? (and when would I use the other?):

  1. E[XY] = (computational formula for the variance)

      = Cov(X,Y) + E[X]E[Y] 
    
  2. E[XY] = (product of two Gaussian PDFs)

      = (E[X]Var[Y] + E[Y]Var[X]) / (Var[Y] + Var[X])
    

If I take the example of X = Y, both Gaussian with mean=5 and variance=2, then the two formulas above lead to different answers:

  1. E[XY] = 2 + 5*5 = 27
  2. E[XY] = (5*2+5*2) / (2+2) = 5

I know I'm missing something - is it that the product of two Gaussian PDFs does not describe the distribution of the product of the corresponding variables? If it doesn't, then what does it (the second formula) describe and how should it used? Is it possible to explain the difference in meaning between the two formulas in plain English? :P

Thanks in advance!

share|improve this question
"Is it that the product of two Gaussian PDFs does not describe the distribution of the product of the corresponding variables?" Yes, as StasK points out in his answer, multiplying two Gaussian PDFs (and using the same argument in both: $f_X(x)f_Y(x)$) rarely results in a PDF. When it does give a PDF, or if we use $c\cdot f_X(x)f_Y(x)$ where $c$ is chosen to give a PDF, the result is a Gaussian PDF, while $XY$ is definitely not a Gaussian random variable. Note that $f_X(x)f_Y(y)$ is a joint PDF that ignores the correlation between $X$ and $Y$ and treats them as independent Gaussians. – Dilip Sarwate Mar 1 '12 at 12:47
@Waldo000000, if you've been trying to figure out conjugate priors computations in Bayesian inference, state so in your question. The question as you asked it is TOTALLY unrelated to your Bayesian clarification comment to my answer. – StasK Mar 1 '12 at 15:01

1 Answer

up vote 2 down vote accepted

The first formula is the correct one, of course. I am not sure I can see what one could gain by multiplying the densities together, keeping the same variable as the argument of both, as the result will not be a density except in some very special cases.

An apparent multiplication of densities does occur in Bayesian inference where the likelihood $p(x|\theta)$ is combined with the prior $\pi(\theta)$ as $\pi(x|\theta)\pi(\theta)$. However, the former is a conditional density, and the resulting density is a joint density of the data $x$ and the parameters $\theta$. To follow through the derivations for the normal case with the normal conjugate prior, see http://www.eisber.net/StatWiki/index.php/Mathematische_Statistik_-_%C3%9Cbung_Erg%C3%A4nzungsaufgabe_2_Beispiel_2. It omits the scaling factors in front of the density and concentrates on the kernels; I would encourage you to follow this through with a complete derivation of all the densities involved.

share|improve this answer
The second formula is used here. How would you re-write the second equation properly, to describe the multiplication of a prior, p(x), a measurement probability p(z|x) and a posterior, p(x|z)? (rather than using the variables X and Y, as I did originally)? – Waldo000000 Mar 1 '12 at 13:29
You multiply prior $\pi(x)$ and the likelihood $\pi(z|x)$, and then you integrate out $x$ to get the marginal distribution $\pi(z)$. This is easy to do with conjugate priors, of course, if that's what you've been thinking all the way along. – StasK Mar 1 '12 at 14:50
1  
Thanks. I've just managed to confuse myself a bit when thinking about the difference between multiplying two random variables (e.g. X and Y, leading to the calculation of E[XY]), versus multiplying two distributions (e.g. p(x) and p(z|x), divided of course by p(z), leading to the calculation of E[p(x|z)]). – Waldo000000 Mar 1 '12 at 16:12
StasK: I think there is a $+$ missing in the second line of the derivation eisber.net/StatWiki/index.php/…. – Zen Mar 1 '12 at 19:29
@Zen, you are right. Well, this is a Wiki, log in and fix it! – StasK Mar 1 '12 at 20:28

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.