Using general bivariate gaussian to extract marginal PDF from given bivariate PDF

bivariate-distributionsgaussianmarginal-distribution

I had a homework question to find the marginal probability density functions, $p_X(x)$ and $p_Y(y)$, given a join probability density function $p_{XY}(x,y)$.

I have solved the problem by integration i.e.

$$p_X(x) = \int_{-\infty}^{\infty}p_{XY}(x,y)dy$$
$$p_Y(y) = \int_{-\infty}^{\infty}p_{XY}(x,y)dx$$

The problem is solved, and there were no stipulations on how we solve it – however the professor has hinted that we could have instead used the general bivariate form:

$$f(x,y)=\frac {1}{2\pi\sigma_x\sigma_y\sqrt{1-\rho^2}} exp \left( -\frac{1}{2(1-\rho^2)} \left[ \left( \frac {x – \mu_x} {\sigma_x} \right)^2 + \left( \frac {y – \mu_y} {\sigma_y} \right)^2 – 2\rho \frac {(x – \mu_x)(y – \mu_y)}{\sigma_x
\sigma_y} \right] \right) $$

And solved for $\mu_x, \mu_y, \sigma_x, \sigma_y,$ and $\rho$. Given some concrete joint bivariate Gaussian, expressed in terms of $x$ and $y$, how could I go about substituting into the general form and perhaps creating a system of equations to find the marginal distributions?

I don't want to post the exact question, as I'd like to be able to generalize the solution (any concrete example joint PDF would be fine), here is one I found from a textbook, if a concrete example is easier to work with:

$$f_{XY}(x,y) = \frac{4e^{-(x-y)^2/2}}{y^2\sqrt{2\pi}}$$

(Textbook is Introduction to Probability for Data Science – Question is Section 5, Exercise 5(b))

The above is not my homework question.

Best Answer

It's not hard but it's a bit labour-intensive. If you know about characteristic functions (see the link I posted in the comments) that's probably a neater way to do it, and more easily generalised too. \begin{eqnarray*} \int p_{XY}(x,y)dy &=& \frac {1}{2\pi\sigma_{X}\sigma_{Y}\sqrt{1-\rho^2}} \int\exp\left( -\frac{1}{2(1-\rho^2)} \left[ \left( \frac {x - \mu_{X}} {\sigma_{X}} \right)^2 +\left( \frac {y - \mu_{Y}} {\sigma_{Y}} \right)^2 - 2\rho \frac {(x - \mu_{X})(y - \mu_{Y})}{\sigma_{X} \sigma_{Y}} \right] \right) dy\\ &=& \frac {1}{2\pi\sigma_{X}\sigma_{Y}\sqrt{1-\rho^2}} \int\exp\left( -\frac{1}{2(1-\rho^2)} \left[ \left( \frac {y - \mu_{Y}} {\sigma_{Y}} - \rho \frac {x - \mu_{X}}{\sigma_{X}} \right)^{2} +\left(1-\rho^{2}\right) \left( \frac {x - \mu_{X}} {\sigma_{X}} \right)^2 \right]\right) dy\\ &=& \frac {1}{2\pi\sigma_{X}\sigma_{Y}\sqrt{1-\rho^2}} \exp\left( -\frac{1}{2} \left( \frac {x - \mu_{X}} {\sigma_{X}} \right)^2\right) \int\exp\left( -\frac{1}{2\sigma_{Y}^{2}(1-\rho^2)} \left( y - \mu_{Y} - \rho\sigma_{Y} \frac {x - \mu_{X}}{\sigma_{X}} \right)^{2} \right) dy\\ &=& \frac {1}{\sigma_{X}\sqrt{2\pi}} \exp\left( -\frac{1}{2} \left( \frac {x - \mu_{X}} {\sigma_{X}} \right)^2\right) \end{eqnarray*}

Related Question