基礎勉強

スカラー,ベクトルと行列

スカラー

一つの数値(変数)で表されるもの,一次元の数。
方向を持たない量のことをいう。大きさと方向を持つベクトルと対比する概念である。

例:身長は178.3cm,温度が20.4℃,178.3と20.4などはスカラーである。

ベクトル

ベクトルはスカラーの集合である。ベクトルを構成するスカラーを「ベクトルの要素」という。

例:体格を考えるとき,「身長,座高,体重」などをまとめて取り扱う。

p次元列ベクトル

{\bf x}=\left( x_1,\cdots , x_i, \cdots , x_p \right)^t (注:行ベクトル{\bf x}=\left( x_1,\cdots , x_i, \cdots , x_p \right)の転置,{\bf x}=\left( x_1,\cdots , x_i, \cdots , x_p \right)^T,{\bf x}=\left( x_1,\cdots , x_i, \cdots , x_p \right)'の形も同様)

行列 ⇒統計学の多変量データに関連する

マトリックスごと!!ベクトルを並べて組み立てたもの!!!・・・だと思う^0^

 p \times q 行列 (注: pq列の行列♪)

  {\bf A} =\left( \begin{array}{cccc} a_{11} & a_{12} & \cdots & a_{1q} \\ a_{21} & a_{22} & \cdots & a_{2q} \\ \vdots & \vdots & \ddots & \vdots \\ a_{p1} & a_{p2} & \cdots & a_{pq} \\ \end{array} \right) 注:このときに, {\bf A}^t =\left( \begin{array}{cccc} a_{11} & a_{21} & \cdots & a_{p1} \\ a_{12} & a_{22} & \cdots & a_{p2} \\ \vdots & \vdots & \ddots & \vdots \\ a_{1q} & a_{2q} & \cdots & a_{pq} \\ \end{array} \right)

a_{ij} は,行列 {\bf A}(i,j) 成分または (i,j) 要素と呼ぶ。
行列転置の性質
(1) ({\bf A}^t)^t ={\bf A}
(2) (c{\bf A}+d{\bf B})^t =c{\bf A}^t +d{\bf B}^t 
(3) tr({\bf A}^t)=tr({\bf A})   (注: tr({\bf A}) は正方行列 {\bf A} の対角成分の和である)
(4) ({\bf AB})^t= {\bf B}^t {\bf A}^t  
(5) ({\bf A}^t)^{-1} = ({\bf A}^{-1})^t  (注: {\bf A}^{-1}{\bf A} の逆行列である)
(6) |{\bf A}^t|=|{\bf A}|   (注: |{\bf A}|{\bf A} の行列式である)

p 次正方行列{\bf A} に対して,その (i,i) 成分(対角成分と呼ぶ)の和を行列{\bf A} のトレースと呼び,tr({\bf A}) と表す。

  {\bf A} =\left( \begin{array}{cccc} a_{11} & a_{12} & \cdots & a_{1p} \\ a_{21} & a_{22} & \cdots & a_{2p} \\ \vdots & \vdots & \ddots & \vdots \\ a_{p1} & a_{p2} & \cdots & a_{pp} \\ \end{array} \right) \Rightarrow tr({\bf A})= a_{11}+a_{22}+\cdots +a_{pp}

相関係数,分散共分散行列と相関係数行列

相関係数

2つ変数のn組のデータ (x_i,y_i) (i=1,2,\cdots ,n) に対して,
{\bf x}=\left( \begin{array} x_1 - \bar{x} \\ x_2 - \bar{x} \\  \vdots \\ x_n - \bar{x} \end{array} \right) \ \ \ \ \ \  ,\ \ \ \ \ \  {\bf y}=\left( \begin{array} y_1 - \bar{y} \\ y_2 - \bar{y} \\  \vdots \\ y_n - \bar{y} \end{array} \right)  
と定義する。変数x の平方和S_{xx} ,変数y の平方和S_{yy}xy の偏差積和S_{xy}は
  S_{xx}=\sum_{k=1}^{n} {(x_k-\bar{x})}^2 = {\bf x}^t {\bf x} = {||{\bf x}||}^2 
  S_{yy}=\sum_{k=1}^{n} {(y_k-\bar{y})}^2 = {\bf y}^t {\bf y} = {||{\bf y}||}^2 
  S_{xy}=\sum_{k=1}^{n} {(x_k-\bar{x})}{(y_k-\bar{y})} = {\bf x}^t {\bf y} = \left( {\bf x},{\bf y} \right) 
となる。したがって,相関係数r_{xy}は次のようになる。
  r_{xy}=\frac{S_{xy}}{\sqrt{S_{xx} S_{yy}}} = \frac{{\bf x}^T {\bf y}}{\sqrt{{\bf x}^T {\bf x}\cdot {\bf y}^T {\bf y}}} = \frac{({\bf x},{\bf y})}{||{\bf x}|| ||{\bf y}||}= \cos \theta 
.
\theta  は二つのベクトル{\bf x}{\bf y} のなす角である。ここでは,
 {\bf x}=c{\bf y}\left\{ \begin{array}{l}  c > 0 & (\theta = 0^{\circ }\Leftrightarrow r_{xy}=1) \\ c < 0 & \ \ \ (\theta = 180^{\circ }\Leftrightarrow r_{xy}= -1) \end{array} \right.
r_{xy}=0 \Leftrightarrow  二つのベクトルが直交する。

分散共分散行列













最終更新:2007年08月10日 12:52