# What is the equation of the expectation of the product of two normally distributed multivariate random variables?

Given two multivariate random variables $\mathbf{x} \sim N(\hat{\mathbf{x}}, Q)$, $\mathbf{y}\sim N(\hat{\mathbf{y}}, R)$ which are not independent but are correlated with covariance matrix $C$ and a constant matrix $A$. What is the expectation of $\mathbf{x}^T A \mathbf{y}$, i.e. $E[\mathbf{x}^T A \mathbf{y}]$? What if $\mathbf{x}$ and $\mathbf{y}$ are independent? Note that I'm using $\mathbf{x}^T$ to mean the transpose of $\mathbf{x}$.

-
I am putting no constraints on the joint distribution. Would it simplify matters to do so? –  DaemonMaker Nov 16 '12 at 16:09

Edited in response to OP's edits of the question

$C$ is $n\times n$ covariance matrix of (column) $n$-vectors $\mathbf x$ and $\mathbf y$. The $i$-$j$-th entry in $C$ is $c_{i,j} = \text{cov}(X_i, Y_j)$. Now, $E[X_i]=\hat{x}_i$ and $E[Y_j]=\hat{y}_j$ so that $c_{i,j} = E[X_iY_j]-\hat{x}_i\hat{y}_j$. Then, \begin{align*} E[\mathbf x^TA\mathbf y] &= E\left[\sum_{i=1}^n\sum_{j=1}^n a_{i,j}X_iY_j\right]\\ &= \sum_{i=1}^n\sum_{j=1}^n a_{i,j}E[X_iY_j]\\ &= \sum_{i=1}^n\sum_{j=1}^n a_{i,j}(c_{i,j}+\hat{x}_i\hat{y}_j)\\ &= \hat{\bf x}\,^TA\hat{\bf y} + \sum_{i=1}^n\sum_{j=1}^n a_{i,j}c_{i,j}. \end{align*} If $C = \mathbf 0$ is the all-zeroes matrix, then we get $$E[\mathbf x^TA\mathbf y] = \hat{\mathbf x}\,^TA\hat{\mathbf y} = E[\mathbf{x}]^TAE[\bf y]$$ as in Robert Israel's answer. (However, Robert has not as yet revised his answer in response to your edits that make the $X_i$ and $Y_j$ non-zero-mean random variables and so $E[\mathbf{x}]^TAE[\mathbf y]$ does not equal $0$ when $C = \mathbf 0$ as he says). Note that normality of $\mathbf x$ and/or $\mathbf y$ has nothing to do with the matter.

-
What about the case when $\mathbf{x}$ and $\mathbf{y}$ are correlated? –  DaemonMaker Nov 16 '12 at 18:20
$C$ is the matrix from which you can read off the covariance of any component $X_i$ of $\mathbf x$ and any component $Y_j$ of $\mathbf y$. The correlation matrices $Q$ and $R$ specify only the covariances of $X_i$ and $X_j$ and $Y_i$ and $Y_j$ respectively, and are not relevant to the computation of $E[\mathbf x^TA\mathbf y]$ which depends on $C$ and not at all on what $Q$ and $R$ are. –  Dilip Sarwate Nov 16 '12 at 19:29
+1. The last double sum is the trace of the matrix $AC^T$. –  Did Nov 17 '12 at 15:21

Unless $\bf x$ and $\bf y$ are uncorrelated, you haven't given us enough information. If they are uncorrelated, $E[{\bf x}^T A {\bf y}] = E[{\bf x}]^T A E[{\bf y}] = 0$.

-
Thanks for the information. I updated my question to clarify. –  DaemonMaker Nov 16 '12 at 18:23