# Marginalizing a Multivariate Gaussian

If I have a vector of random variables, X = [ X1, X2, X3, X4 ]

Marginalizing the probability density function can be done by integrating the PDF with respect to the variables you want to remove:

A multivariate Gaussian PDF with mean vector, μ, and covariance matrix, C, is given as:

How would I marginalize this multivariate Gaussian PDF with mean vector and a covariance matrix? Would I approach it like this?:

Would the matrix C and vector μ be treated as constants that can be moved outside the integrals?

Is there an easier way to do this?

The matrix $$\mathbf{C}$$ and the vector $$\mathbf{\mu}$$ are in deed constants, but, because they appear multiplying the vector $$\mathbf{x}$$, of which the entries $$x_1$$ and $$x_4$$ are our variables, they cannot be removed from the integral.
The standard way to do this is to expand the quadradic form inside the exponential and separate everything that does not involve $$x_1$$ and $$x_4$$ in a big constant term. ''Constant'', because it does not depend on $$x_1$$ and $$x_4$$. Now, the trick is to realize that we do not need to calculate this constant term. This is because the result we get from those integrals must be a density, i.e., it must integrate $$1$$.
Therefore, to find out what is the joint distribution of $$x_1$$ and $$x_4$$, we must look only at the part that depends on those variables, and see what kind of distribution family that density is in (spoiler: $$x_1$$ and $$x_4$$ will have a bivariate gaussian distribution).
This is easier seen if you give explicit values to $$\mathbf{C}$$ and $$\mathbf{\mu}$$.
• @CMBel Not quite. My approach does not involve integrals. Think about the univariate standard Gaussian to understand. If I told you it's density was $C\cdot e^{-x^2/2}$ you would have the same information as if I told you what $C$ were, because you can determine $C$ from the fact that it integrates $1$. Similarly, If instead of a standard Gaussian it was something like $D \cdot e^{-(x-1)²/8}$, even not knowing $D$ you can still see that the distribution is $N(1, 4)$, because the only thing that matters is the term that depends on $x$. You do not need to know $D$ to know the distribution. Jul 15, 2022 at 14:51