# 多変量正規分布 ###### tags: `probability-theory` 互いに独立ではない1組の計測値の確率モデル。 ## 2次元 ### 確率密度関数 $$ \begin{align} & f\left(x_1, x_2; \mu_1, \mu_2, \sigma_1^2, \sigma_2^2, \rho_{12}\right) \notag \\ = & \frac{1}{2\pi\sqrt{\sigma_1^2\sigma_2^2-\rho_{12}^2\sigma_1^2\sigma_2^2}}\exp\left\{-\frac{\left(\left(x_1-\mu_1\right)^2\sigma_2^2+\left(x_2-\mu_2\right)^2\sigma_1^2-2\left(x_1-\mu_1\right)\left(x_2-\mu_2\right)\rho_{12}\sigma_1\sigma_2\right)}{2\left(\sigma_1^2\sigma_2^2-\rho_{12}^2\sigma_1^2\sigma_2^2\right)}\right\} \notag \\ = & \frac{1}{2\pi\sigma_1\sigma_2\sqrt{1-\rho_{12}^2}}\exp\left\{-\frac{\left(\left(x_1-\mu_1\right)^2\sigma_2^2+\left(x_2-\mu_2\right)^2\sigma_1^2-2\left(x_1-\mu_1\right)\left(x_2-\mu_2\right)\rho_{12}\sigma_1\sigma_2\right)}{2\sigma_1^2\sigma_2^2\left(1-\rho_{12}^2\right)}\right\} \notag \end{align} $$ ## 一般 ### パラメータ $$ \boldsymbol{\mu} = \left( \begin{array}{c} \mu_1 \\ \mu_2 \\ \vdots \\ \mu_p \end{array} \right) $$ $$ \Sigma = \left( \begin{array}{cccc} \sigma_1^2 & \rho_{12}\sigma_1\sigma_2 & \cdots & \rho_{1p}\sigma_1\sigma_p \\ \rho_{21}\sigma_2\sigma_1 & \sigma_2^2 & \cdots & \rho_{2p}\sigma_2\sigma_p \\ \vdots & \vdots & \ddots & \vdots \\ \rho_{p1}\sigma_p\sigma_1 & \rho_{p2}\sigma_p\sigma_2 & \cdots & \sigma_p^2 \end{array} \right) $$ ### 確率ベクトル $$ \boldsymbol{X} = \left(\begin{array}{c} X_1 \\ X_2 \\ \vdots \\ X_p \end{array}\right) \sim N\left(\boldsymbol{\mu}, \Sigma\right) $$ ### 確率密度関数 $$ f\left(\boldsymbol{x}; \boldsymbol{\mu}, \Sigma\right) = \frac{1}{\sqrt{\left|2\pi\Sigma\right|}}\exp\left\{-\frac{1}{2}\left(\boldsymbol{x}-\boldsymbol{\mu}\right)^\top\Sigma\left(\boldsymbol{x}-\boldsymbol{\mu}\right)\right\} $$