# Product of two densities, when one of them is "incomplete"

One can frequently read that the product of two multivariate Gaussian pdfs, $f_1(x)$*$f_2(x)$, is itself a Gaussian function, with parameters as defined for example in:

But what if the parameters (mean vector, covariance matrix) for $f_2$ are not given for all elements of $x$? I.e. if the mean vector of $f_2$ contains values only for some of the random elements of $x$, and the $f_2$ covariance matrix - which is here assumed to be diagonal - also contains only values for this subset of the elements of $x$? Is the product then still a Gaussian and how can the parameters be calculated?

• Hint: $f_{X,Y}{x,y} = f_X(x)f_Y(y)$ for independent random variables (or vectors). For multivariate random variables, the mean vector is the concatenation of the constituent mean vectors while the covariance matrix is $$\Sigma = \left[\begin{matrix}\Sigma_1&\mathbf 0\\\mathbf 0& \Sigma_2\end{matrix}\right]$$ Apr 20, 2015 at 19:09
• @Dilip Sarwate Thank you Dilip - yes, I think this will help... in the meantime, I found a way for the underlying problem so both densities' covariance matrices and mean vectors contain expressions for all the elements in the vector - still working on this, though. Hope I can come back with more clarification, soon. Apr 21, 2015 at 1:46
• @Dilip Sarwate thanks again - I think I got what you are saying. I could partition the vector $x$ into two parts, where one part, $x_a$ includes all those elements for which both $f_1$ and $f_2$ have parameters, and $x_b$ contains all the other elements. And then multiply $f_1(x_a)$ and $f_2(x_a)$ to get f(x_a). This I would then have to concatenate with $f_1(x_b)$ to get $f(x) = f_1(x)f_2(x)$. Is that what you had in mind? May 2, 2015 at 0:28
• Your notation is horrendous and adds to the overall confusion. When you write $f(x) = f_1(x)f_2(x)$, the three occurrences of $x$ represent three different things. You are thus violating a basic convention in mathematics that a symbol should mean the same thing everywhere it occurs in an expression or formula. May 2, 2015 at 3:39
• @Dilip Sarwate - thanks for your feedback! however, I'm not sure if the notation here is that wrong. Here x is supposed to be the same vector/set of variables, but the densities are different. This was actually pointed out to me in an answer to an earlier question: please have a look at the answer I got there: math.stackexchange.com/questions/1221058/product-of-densities. The references given in the question also use similar notation. However, I'm not ruling out that I have misunderstood something. What do you think? May 2, 2015 at 3:48

One can frequently read that the product of two multivariate Gaussian pdfs, $f_1(x)$*$f_2(x)$, is itself a Gaussian,
What is true is that if $X$ and $Y$ are independent (univariate) Gaussian random variables with densities $f_X(x)$ and $f_Y(y)$ respectively, then the product $f_X(x)f_Y(y)$ equals the joint density function $f_{X,Y}(x,y)$. Note that the joint density is a function of two real variables which have different names $x$ and $y$, and it is not claimed that $f_X(x)f_Y(x)$ is a Gaussian density (note the lack of $y$).
More generally,if $\mathbf X = (X_1,X_2,\ldots, X_m)$ and $\mathbf Y = (Y_1, Y_2, \ldots, Y_n)$ are random vectors that are independent of each other and $\mathbf X$ and $\mathbf Y$ have multivariate Gaussian densities \begin{align} f_{\mathbf X}(\mathbf x) &= \frac{1}{(2\pi)^{m/2}\sqrt{|\operatorname{det}(\Sigma_X)|}}\exp\left(-\frac 12(\mathbf x - \mathbf m_X)\Sigma_X^{-1} (\mathbf x - \mathbf m_X)^T\right)\\ f_{\mathbf Y}(\mathbf y) &= \frac{1}{(2\pi)^{n/2}\sqrt{|\operatorname{det}(\Sigma_Y)|}}\exp\left(-\frac 12(\mathbf y - \mathbf m_Y)\Sigma_Y^{-1} (\mathbf y - \mathbf m_Y)^T\right) \end{align} where $\Sigma_X$ and $\Sigma_Y$ are $m\times m$ and $n \times n$ covariance matrices, and $\mathbf m_X$ and $\mathbf m_Y$ are the mean vectors, of $\mathbf X$ and $\mathbf Y$ respectively. Note that these densities are functions of $m$ and $n$ real variables $(x_1, x_2, \ldots, x_m)$ and $(y_1, y_2,\ldots, y_n)$ respectively. Then $$f_{\mathbf X, \mathbf Y}\big ((\mathbf x, \mathbf y)\big) = f_{\mathbf X}(\mathbf x)f_{\mathbf Y}(\mathbf y)$$ where $(\mathbf x, \mathbf y) = (x_1, x_2, \ldots, x_m, y_1, y_2,\ldots, y_n)$ is a vector of $m+n$ real numbers. Plugging and chugging, we have that \begin{align} f_{\mathbf X, \mathbf Y}\big ((\mathbf x, \mathbf y)\big) &= \frac{\exp\left(-\frac 12(\mathbf x - \mathbf m_X)\Sigma_X^{-1} (\mathbf x - \mathbf m_X)^T-\frac 12(\mathbf y - \mathbf m_Y)\Sigma_Y^{-1} (\mathbf y - \mathbf m_Y)^T\right)}{(2\pi)^{(m+n)/2} \sqrt{|\operatorname{det}(\Sigma_X)|\cdot|\operatorname{det}(\Sigma_Y)|}}\tag{1}\\ &= \frac{\exp\left(-\frac 12(\mathbf z - \mathbf m)\Sigma^{-1} (\mathbf z - \mathbf m)^T\right)}{(2\pi)^{(m+n)/2} \sqrt{|\operatorname{det}(\Sigma)|}}\tag{2} \end{align} where $\mathbf z = (\mathbf x, \mathbf y) = (x_1, x_2, \ldots, x_m, y_1, \ldots, y_n)$, $\mathbf m = (\mathbf m_X,\mathbf m_Y)$ is the mean vector of the $(m+n)$-dimensional multivariate Gaussian vector $\mathbf Z = (\mathbf X, \mathbf Y)$, and $$\Sigma = \left[\begin{matrix}\Sigma_X&\mathbf 0\\\mathbf 0& \Sigma_Y\end{matrix}\right]\tag{3}$$ is the $(m+n)\times (m+n)$ covariance matrix. The derivations are greatly simplified by observing the block structure $(3)$ of the covariance matrix.