1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

分散共分散行列の公式まとめ

Last updated at Posted at 2020-03-30

分散共分散行列の公式まとめ

Wikipedia の「分散共分散」のページ (https://ja.wikipedia.org/wiki/%E5%88%86%E6%95%A3%E5%85%B1%E5%88%86%E6%95%A3%E8%A1%8C%E5%88%97) には色々な公式があるけど、結局以下の定理1と2を理解していれば、あとは変数を適当に入れ替えるだけ。

分散共分散行列が半正定値行列であることはカーネル回帰におけるカーネルトリックを実現する上で重要。

表記ルール

  1. スカラー表記:$x$、ベクトル表記:$\boldsymbol{x}$、行列表記:$X$
  2. スカラー表記:$E[x]=\mu_x$、ベクトル表記:$E[\boldsymbol{x}]=\boldsymbol{\mu_x}$

定理

分散共分散行列 $V[\boldsymbol{x}]$ と $Cov[\boldsymbol{x}, \boldsymbol{y}]$ について、$Cov[\boldsymbol{x}, \boldsymbol{x}] = V[\boldsymbol{x}]$。

定理1

$$Cov[A \boldsymbol{x} + \boldsymbol{a}, B \boldsymbol{y} + \boldsymbol{b}] = A Cov\left[\boldsymbol{x}, \boldsymbol{y} \right] B^T$$

$$\fbox{proof}$$

\begin{align}
Cov[A \boldsymbol{x} + \boldsymbol{a}, B \boldsymbol{y} + \boldsymbol{b}]
&= E \left[ \left( A \boldsymbol{x} + \boldsymbol{a}
                  - E[A \boldsymbol{x} + \boldsymbol{a}] \right)
           \left( B \boldsymbol{y} + \boldsymbol{b}
                  - E[B \boldsymbol{y} + \boldsymbol{b}] \right)^T \right] \\
&= E \left[ \left( A \boldsymbol{x} 
                  - E[A \boldsymbol{x} ] \right)
           \left( B \boldsymbol{y} 
                  - E[B \boldsymbol{y} ] \right)^T \right] \\
&= E \left[ A \left( \boldsymbol{x} 
                  - E[\boldsymbol{x} ] \right)
           \left(\boldsymbol{y} 
                  - E[\boldsymbol{y} ] \right)^T B^T \right] \\
&= A Cov\left[ \boldsymbol{x}, \boldsymbol{y} \right] B^T
\end{align}

定理2

Cov \left[ \boldsymbol{x}_1 + \boldsymbol{x}_2,
           \boldsymbol{y}_1 + \boldsymbol{y}_2 \right]
= Cov \left[ \boldsymbol{x}_1, \boldsymbol{y}_1 \right]
+ Cov \left[ \boldsymbol{x}_1, \boldsymbol{y}_2 \right]
+ Cov \left[ \boldsymbol{x}_2, \boldsymbol{y}_1 \right]
+ Cov \left[ \boldsymbol{x}_2, \boldsymbol{y}_2 \right]

定理3

分散共分散行列 $\Sigma \succeq 0$ (半正定値行列)

$$\fbox{proof}$$

$Cov[A \boldsymbol{x} + \boldsymbol{a}, B \boldsymbol{y} + \boldsymbol{b}] = A Cov\left[\boldsymbol{x}, \boldsymbol{y} \right] B^T$ において、$\boldsymbol{y}=\boldsymbol{x}$、$\boldsymbol{a}=\boldsymbol{b}=\boldsymbol{0}$、$A=B=\boldsymbol{a^T}$ を代入。

\begin{align}
Cov[\boldsymbol{a}^T \boldsymbol{x}, \boldsymbol{a}^T \boldsymbol{x}]
&= V[\boldsymbol{a}^T \boldsymbol{x}] \\
&= \boldsymbol{a}^T V[\boldsymbol{x}] \boldsymbol{a}
\end{align}

$\boldsymbol{a}^T \boldsymbol{x}$ はスカラーなので $V[\boldsymbol{a}^T \boldsymbol{x}] \geq 0$。よって $\boldsymbol{a}^T V[\boldsymbol{x}] \boldsymbol{a} \geq 0   \Box$

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?