Let $X$ and $Y$ be independent random variables with nonzero variances. I'm looking to find the correlation coefficient $\rho$ of $Z=XY$ and $X$ in terms of the means and variances of $X$ and $Y$, i.e. $\mu_X, \mu_Y, \sigma^2_X, \sigma^2_Y$.

(I have searched different methods online, including Correlation between X and XY. However, I'm wondering if I could use a simple calculation-approach rather than using moments as well.)

The result I obtained, along with the steps I've used, is the following:

$$ \begin{align} \rho & = \frac{\text{Cov}(Z,X)}{\sigma_Z\sigma_X}\\[1em] & = \frac{E\left[\left(Z-\mu_Z\right)\left(X-\mu_X\right)\right]}{\sigma_Z\sigma_X} \\[1em] & = \frac{E\left[\left(XY-\mu_X\mu_Y\right)\left(X-\mu_X\right)\right]}{\sqrt{E\left[\left(XY\right)^2\right]-\left[E\left(XY\right)\right]^2}\cdot\sigma_X} \\[1em] & = \frac{E\left(X^2Y\right)-\mu_X^2\mu_Y}{\sqrt{E\left(X^2\right)E\left(Y^2\right)-\left[E\left(X\right)\right]^2\left[E\left(Y\right)\right]^2}\cdot\sigma_X} \\[1em] & = \frac{E\left(X^2\right)E\left(Y\right)-\mu_X^2\mu_Y}{\sqrt{\left(\sigma_X^2+\mu_X^2\right)\left(\sigma_Y^2+\mu_Y^2\right)-\mu^2_X\mu^2_Y}\cdot\sigma_X} \\[1em] & = \frac{\mu_Y\left[E\left(X^2\right)-\mu^2_X\right]}{\sqrt{\sigma^2_X\sigma^2_Y+\sigma_X^2\mu_Y^2+\sigma_Y^2\mu_X^2}\cdot\sigma_X} \\[1em] & = \frac{\mu_Y\sigma_X^2}{\sqrt{\sigma^2_X\sigma^2_Y+\sigma_X^2\mu_Y^2+\sigma_Y^2\mu_X^2}\cdot\sigma_X} \\[1em] & = \frac{\mu_Y\sigma_X}{\sqrt{\sigma^2_X\sigma^2_Y+\sigma_X^2\mu_Y^2+\sigma_Y^2\mu_X^2}} \end{align} $$

which is seemingly different from the result from the moment approach used in Correlation between X and XY. In which step has an error in my calculation occurred (if any), and how can I obtain $\rho$ from the approach I am trying to use?

  • $\begingroup$ Why did you use $\mu_z = \mu_x\mu_y$? $\endgroup$ Nov 27, 2020 at 4:20
  • 2
    $\begingroup$ @helperFunction since $X$ and $Y$ are independent variables and $Z=XY$, I put $\mu_Z=E(Z)=E(XY)=E(X)E(Y)=\mu_X\mu_Y$. $\endgroup$
    – raven
    Nov 27, 2020 at 4:23
  • 1
    $\begingroup$ In the fourth equality, I think you're missing two cross terms that come to $-2\mu_X^2\mu_Y$, so you end up with $-\mu^2_X\mu_Y$ rather than $+\mu^2_X\mu_Y$ $\endgroup$ Nov 27, 2020 at 5:00
  • $\begingroup$ @ThomasLumley you are absolutely right; I've edited my result, which simplifies a bit but I still am unsure if that should be the final form. Do you think there are further steps to this? $\endgroup$
    – raven
    Nov 27, 2020 at 5:12
  • $\begingroup$ for what applications would someone want to multiply $X$ and $Y$ together? $\endgroup$
    – develarist
    Nov 27, 2020 at 7:25

2 Answers 2


A useful approach to debugging a string of equalities is an example or two, so you can check where the equality stops holding.

The simplest example I can think of for this is $Y$ being a constant that isn't 0, 1 or -1. So, let $Y=\mu_Y$ be a positive constant that isn't 1, and $\sigma^2_Y=0$.

The first three equalities are just expanding definitions, so the fourth is the first time something could go wrong. And it does. The numerator in the third line simplifies to $\mu_Y\mathrm{var}[X]$. The numerator in the fourth line doesn't. Or didn't when I wrote this; it has now been edited.

The edited version passes this check. It also matches the third answer at the linked question, which matches the first answer, so we can probably conclude it is right.


What you've written is the same as the expression in the link. In the link, there is a typo in the denominator, as $\mu_2(Y)^2$ should be $\mu_1(Y)^2$.

\begin{eqnarray}\text{Cor}(X,XY) &=& \frac{\mu_2(X)\mu_1(Y) - \mu_1(X)^2\mu_1(Y)}{\sqrt{(\mu_2(X)-\mu_1(X)^2)(\mu_2(X)\mu_2(Y) - \mu_1(X)^2\mu_1(Y)^2)}} \\ &=& \frac{E[X^2]\mu_Y - \mu_X^2\mu_Y}{\sqrt{\sigma_X^2(E[X^2]E[Y^2]-\mu_X^2\mu_Y^2)}}\\ &=& \frac{\sigma_X\mu_Y}{\sqrt{(\sigma_X^2+\mu_X^2)(\sigma_Y^2+\mu_Y^2)-\mu_X^2\mu_Y^2}}\\ &=& \frac{\sigma_X\mu_Y}{\sqrt{\sigma_X^2\sigma_Y^2 + \sigma_X^2\mu_Y^2 + \mu_X^2\sigma_Y^2}}\\ \end{eqnarray}


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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