# Covariance matrices

Consider two matrices of random variables, X and W, of same dimension. Now, consider the product X'W. I've been told that this matrix gives us the covariances between the elements of X and W. However, this is not immediately apparent to me. You do get sums of products, but these aren't exactly covariances.

• Usually, the covariance matrix refers to the expectation of the outer product of two vectors of random variables, i.e. the $n \times n$ real valued matrix $\mathbb{E}[\bf{X} \bf{X}^t]$ where $\bf{X}$ $= [X_1,...,X_n]$ is an $n \times 1$ vector of random variables. Dec 5, 2018 at 2:56
• What you are referring to sounds like a $\textit{random}$ sample covariance matrix. See Wishart matrix Dec 5, 2018 at 2:59
• Thanks, but does the matrix that I have mentioned give some sort of indication about covariances? Intuitively, I think it does, but am not convinced. Dec 5, 2018 at 3:06
• It does if the columns of X and W are i.i.d. random variables. Then the $ab$ entry of $X^tW$ is $\sum_i X_{ai} W_{bi}$, which can be thought of as a sample covariance between the random variables $X_a$ and $W_b$ where $X_a$ is distributed like the entries in column $a$ of $X$ and $W_b$ is distributed like the entries in column $b$ of $W$. Dec 5, 2018 at 3:38
• Not exactly the sample covariances right? Need to subtract sample averages. Dec 5, 2018 at 8:57