# $\operatorname{Cov}[\vec{X}\cdot({\bf{v}} \operatorname{Cov}[\vec{X},Y]), \vec{X}] = {\bf{v}\bf{v}}^{-1}\operatorname{Cov}[Y, \vec{X}]$?

In Shalizi's Advanced Data Analysis from an Elementary Point of View p.44, he writes that for a variable $$Y$$ with a $$p$$-dimensional vector of predictors $$\vec{X}$$, and $$\bf{v}$$ the covariance matrix of $$\vec{X}$$, that

$$\operatorname{Cov}[\vec{X}\cdot({\bf{v}} \operatorname{Cov}[\vec{X},Y]), \vec{X}] = {\bf{v}\bf{v}}^{-1}\operatorname{Cov}[Y, \vec{X}].$$

I am comfortable manipulating the covariance when it is a functions of one dimensional random variables, but I don't even know where to begin to get the RHS from the LHS. I am especially confused by the meaning of $$\vec{X}\cdot({\bf{v}} \operatorname{Cov}[\vec{X},Y])$$. If $$\vec{X}$$ is $$p\times 1$$ and presumably $$({\bf{v}} \operatorname{Cov}[\vec{X},Y])$$ is $$p\times p$$, then the product doesn't make sense to me. Even if this is a typo and it should be written as $$\vec{X}^{T}$$, I'm not sure I would know what to do.

My only gut instinct is that there is some law of iterated expectations that can be unraveled from the nested covariance in the first argument.

• $\mathbf{v}\text{Cov}(\vec{X}, Y)$ should be $p \times 1$, since $\text{Cov}(\vec{X}, Y)$ is $p \times 1$. But this equality doesn't look right. Commented Jun 1, 2020 at 1:59

In a full-matrix notation, note $$a \cdot b$$ is $$a^T b$$, or $$b^T a$$. Also for the ease of typing, let me write your $$\mathbf{v}$$ in $$V$$ and suppress the arrow above $$\vec{X}$$. Moreover, denote $$\text{Cov}(X, Y)$$ by $$a \in \mathbb{R}^{p \times 1}$$, hence $$\text{Cov}(Y, X) = a^T \in \mathbb{R}^{1 \times p}$$. It follows that \begin{align} \text{Cov}(X \cdot (Va), X) = \text{Cov}((Va)^TX, X) = (Va)^T\text{Cov}(X, X) = a^TV^TV = \text{Cov}(Y, X)V^TV. \end{align}
$$V^{-1}$$ should not be there anyway.
• Thank you, it is clear now. I have never seen the notation $a\cdot b$ like this. Upon rereading the original text, I made a typo and the $\textbf{v}$ on the LHS was actually supposed to be $\textbf{v}^{-1}$ but nevertheless, I can follow all the steps. Commented Jun 1, 2020 at 2:58