2
0

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.

相関係数

Posted at

簡略してデータ点$(x_i,y_i)$に対して、

・相関係数は次のように表せる。

\begin{align}
r_{xy}=\frac{S_{xy}}{S_xS_y}&=\frac{\frac{1}{n}\sum{(x_i-\bar{x})(y_i-\bar{y})}}{\sqrt{\frac{1}{n}\sum{(x_i-\bar{x})^2}} \sqrt{\frac{1}{n}\sum{(y_i-\bar{y})^2}}}\\
&=\frac{\sum{(x_i-\bar{x})(y_i-\bar{y})}}{\sqrt{\sum{(x_i-\bar{x})^2}} \sqrt{\sum{(y_i-\bar{y})^2}}}\\

\end{align}

ここで大事なのがこの式を眺める視点です。
$(x_i,y_i)$はそれぞれのデータ点なので、$(x_i-\bar{x},y_i-\bar{y})$は平均に対して平行移動した点と考えます。

(x_1-\bar{x},y_1-\bar{y}),
(x_2-\bar{x},y_2-\bar{y}),
\dots,(x_n-\bar{x},y_n-\bar{y})

この内積を取ると上式と一致します。

\cos{\theta}=\frac{\sum{(x_i-\bar{x})(y_i-\bar{y})}}{\sqrt{\sum{(x_i-\bar{x})^2}} \sqrt{\sum{(y_i-\bar{y})^2}}}\\


2
0
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
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?