協方差矩陣的定義
設一個隨機向量為\(\mathbf{x} \in \mathbb{R}^\mathrm{N}\),其均值為\(\bar{\mathbf{x}}\),則令\(\mathbf{y} = \mathbf{x} - \bar{\mathbf{x}}\),則隨機向量\(\mathbf{x}\)的協方差定義為:
\[\Sigma_{\mathbf{x}} = \begin{bmatrix} \sigma(x_1,x_1) & \dotsb & \sigma(x_1,x_N) \\ \vdots & \ddots & \vdots \\ \sigma(x_N,x_1) & \dotsb & \sigma(x_N,x_N) \end{bmatrix} \in \mathbb{R}^{\mathrm{N} \times \mathrm{N}} \]
由於\(\sigma(x_i,x_j) = \mathrm{E}((x_i - \bar{x_i})(x_i - \bar{x_i})) = \mathrm{E}(y_i - y_j) = \sigma(y_i,y_j)\),所以\(\Sigma_{\mathbf{x}} = \Sigma_{\mathbf{y}}\),即:
\[\Sigma_{\mathbf{y}} = \begin{bmatrix} \sigma(y_1,y_1) & \dotsb & \sigma(y_1,y_N) \\ \vdots & \ddots & \vdots \\ \sigma(y_N,y_1) & \dotsb & \sigma(y_N,y_N) \end{bmatrix} \in \mathbb{R}^{\mathrm{N} \times \mathrm{N}} \]
另外,協方差矩陣還可以寫成如下的形式:
\[\Sigma_{\mathbf{x}} = \mathrm{E}((\mathbf{x-\bar{\mathbf{x}}})(\mathbf{x-\bar{\mathbf{x}}})^{\mathrm{T}}) = \mathrm{E}(\mathbf{y}\mathbf{y}^{\mathrm{T}}) \]
此式與上述兩式是等價的。各位看官可以自行證明。
協方差矩陣的意義及解釋
協方差矩陣的意義及解釋可見如下博客,這些博客已經寫得非常好了,在此,老夫我就不再重復了。
https://zhuanlan.zhihu.com/p/37609917