Multivariate gaussian and matrix-vector products: basics
Assume you have a multivariate gaussian vector \(\mathbf{x}\), so that \(p(\mathbf{x}) = \mathcal{N}(\pmb{\mu}, \pmb{\Sigma})\). Suppose we have a fixed matrix \(\mathbf{A}\) and vector \(\mathbf{c}\). What is the distribution of
- The matrix-vector product \(\mathbf{A}\mathbf{x}\) ?
- The inner product \(\mathbf{c}^\mathsf{T}\mathbf{x}\) ?
- The outer products \(\mathbf{x}\mathbf{c}^\mathsf{T}, \mathbf{c}\mathbf{x}^\mathsf{T}\) ?
Matrix-vector product
Because \(\pmb{\Sigma}\) is positive-semi-definite, it has a cholesky factor \(\mathbf{L} = \mathrm{chol}(\pmb{\Sigma})\), and further the equality
$$\mathbf{x} = \pmb{\mu} + \mathbf{L}\mathbf{z}\,,\qquad \mathbf{z} \sim \mathcal{N}(\mathbf{0}, \mathbf{I}) $$
holds. It is then easy to compute the matrix product and derive its distribution:
$$\mathbf{A}\mathbf{x} = \mathbf{A}\pmb{\mu} + \mathbf{A}\mathbf{L}\mathbf{z}\,,\qquad \mathbf{z} \sim \mathcal{N}(\mathbf{0}, \mathbf{I}) $$
So that applying the same trick in reverse yields that \(\mathbf{A}\mathbf{x} \sim \mathcal{N}(\tilde{\pmb{\mu}}, \tilde{\pmb{\Sigma}})\) with
$$\tilde{\pmb{\mu}} = \mathbf{A}\pmb{\mu}\,,\qquad \tilde{\pmb{\Sigma}} = \mathbf{A}\mathbf{L}\mathbf{L}^\mathsf{T}\mathbf{A}^\mathsf{T} = \mathbf{A}\pmb{\Sigma}\mathbf{A}^\mathsf{T}$$
Inner product
A consequence of this first result is obtained by taking \(\mathbf{A} = \mathbf{c}^\mathsf{T} \in \mathbb{R}^{1 \times p}\) Thus, we have the result
$$ \mathbf{c}^\mathsf{T} \mathbf{x}\;\sim\;\mathcal{N}\left( \mathbf{c}^\mathsf{T}\pmb{\mu}\,,\;\mathbf{c}^\mathsf{T}\pmb{\Sigma}\mathbf{c}\right)$$
Outer product
To be added.
$$\mathbf{x}\mathbf{c}^\mathsf{T} =\pmb{\mu}\mathbf{c}^\mathsf{T} + \mathbf{L}\mathbf{z}\mathbf{c}^\mathsf{T}\,,\qquad \mathbf{z} \sim \mathcal{N}(\mathbf{0}, \mathbf{I}) $$