![](https://research.miidas.jp/wp-content/uploads/2018/11/4b5f2ec89c8e89a188b98bcc198eacf4.png)
このデータは見ての通り2次元(平面)データです。これを1次元(直線)に置き換えたいです。
各点の配置は?
置き換える時に重要なのは距離感です。離れていた点通しが置き換えた先でご近所さんになると元のデータをうまく表現できてるとは言えませんよね。それが次の図です。![](https://research.miidas.jp/wp-content/uploads/2018/11/Screen-Shot-2018-11-18-at-15.12.18.png)
![](https://research.miidas.jp/wp-content/uploads/2018/11/Screen-Shot-2018-11-18-at-15.12.13.png)
![](https://research.miidas.jp/wp-content/uploads/2018/11/8dab752bc8deb5f93745a8b430e1644e.png)
![Rendered by QuickLaTeX.com \mathbb{R}^2 \Rightarrow \mathbb{R}^1](https://research.miidas.jp/wp-content/ql-cache/quicklatex.com-f19ea34066d902d3a8f3781721a7f39e_l3.png)
上の赤矢印(軸)
どうやっていい軸を選びましょうか。じーっと見てみましょう。広がっている方向に矢印が伸びていますね。つまりいい軸とはデータを矢印だけで表現したものと捉えることができそうです。では具体的にいい軸(ベクトル)をどう求めるかを考えましょう。 とりえあず求めるベクトルを![Rendered by QuickLaTeX.com v](https://research.miidas.jp/wp-content/ql-cache/quicklatex.com-ef71511c70f0e4b25cc6bd69f3bc20c2_l3.png)
![Rendered by QuickLaTeX.com | v |=1](https://research.miidas.jp/wp-content/ql-cache/quicklatex.com-ee00fcd4956069e27e064df5b4eb5ddd_l3.png)
![Rendered by QuickLaTeX.com a_1](https://research.miidas.jp/wp-content/ql-cache/quicklatex.com-460f5abc45b558edf34fe288dc0a9979_l3.png)
![](https://research.miidas.jp/wp-content/uploads/2018/11/e54f3c363307dceee3684b65c37d1567.png)
![Rendered by QuickLaTeX.com a](https://research.miidas.jp/wp-content/ql-cache/quicklatex.com-5c53d6ebabdbcfa4e107550ea60b1b19_l3.png)
![Rendered by QuickLaTeX.com b](https://research.miidas.jp/wp-content/ql-cache/quicklatex.com-f56d50c26583f9a035ff6b4e3c0ca5c0_l3.png)
![Rendered by QuickLaTeX.com a_2](https://research.miidas.jp/wp-content/ql-cache/quicklatex.com-0429f295f30eec4db774f087e7f85c21_l3.png)
![Rendered by QuickLaTeX.com a_1](https://research.miidas.jp/wp-content/ql-cache/quicklatex.com-460f5abc45b558edf34fe288dc0a9979_l3.png)
![](https://research.miidas.jp/wp-content/uploads/2018/11/Q7HIP.gif)
![Rendered by QuickLaTeX.com x_i](https://research.miidas.jp/wp-content/ql-cache/quicklatex.com-c8700e0258243116de0d4f288e2e3b44_l3.png)
![Rendered by QuickLaTeX.com b](https://research.miidas.jp/wp-content/ql-cache/quicklatex.com-f56d50c26583f9a035ff6b4e3c0ca5c0_l3.png)
![Rendered by QuickLaTeX.com \frac{1}{N-1}](https://research.miidas.jp/wp-content/ql-cache/quicklatex.com-d59dc83e86d4ddf0d1a996fc83a8ca4b_l3.png)
![Rendered by QuickLaTeX.com \frac{1}{N-1} \sum_{i=1}^{N} ( x_i x_i^T)](https://research.miidas.jp/wp-content/ql-cache/quicklatex.com-f46cc3af6db02d4ee1ff418fd45f5cd2_l3.png)
![Rendered by QuickLaTeX.com x_i,v](https://research.miidas.jp/wp-content/ql-cache/quicklatex.com-5a86a0081465a073198ab4706775cc68_l3.png)
![Rendered by QuickLaTeX.com \Sigma](https://research.miidas.jp/wp-content/ql-cache/quicklatex.com-14fb1e14301ad034b94e3db3ff52c0c9_l3.png)
![Rendered by QuickLaTeX.com f,g](https://research.miidas.jp/wp-content/ql-cache/quicklatex.com-0d6a310858cda26b66d13f9438c543b2_l3.png)
![Rendered by QuickLaTeX.com \mathbb{C}^1](https://research.miidas.jp/wp-content/ql-cache/quicklatex.com-e67c10cae2706324ead1c02b700dc869_l3.png)
![](https://research.miidas.jp/wp-content/uploads/2018/11/Screen-Shot-2018-11-18-at-14.42.08.png)
- https://en.wikipedia.org/wiki/Lagrange_multiplier
- http://www.yunabe.jp/docs/lagrange_multiplier.html
- https://ocw.mit.edu/courses/mathematics/18-02sc-multivariable-calculus-fall-2010/2.-partial-derivatives/part-c-lagrange-multipliers-and-constrained-differentials/session-40-proof-of-lagrange-multipliers/MIT18_02SC_notes_22.pdf
おっと、これわ。。。。
固有ベクトルと固有値そのもの
要点をいうと![Rendered by QuickLaTeX.com x\neq 0](https://research.miidas.jp/wp-content/ql-cache/quicklatex.com-aa7aa20ab0304bf95d252ef036e1bbbe_l3.png)
![Rendered by QuickLaTeX.com A](https://research.miidas.jp/wp-content/ql-cache/quicklatex.com-25b206f25506e6d6f46be832f7119ffa_l3.png)
![Rendered by QuickLaTeX.com \lambda](https://research.miidas.jp/wp-content/ql-cache/quicklatex.com-2b5c45836864531b8e37025dabadd24a_l3.png)
![Rendered by QuickLaTeX.com A](https://research.miidas.jp/wp-content/ql-cache/quicklatex.com-25b206f25506e6d6f46be832f7119ffa_l3.png)
- https://en.wikipedia.org/wiki/Eigenvalues_and_eigenvectors
- https://qiita.com/kenmatsu4/items/2a8573e3c878fc2da306
データの共分散行列の固有ベクトル
とわかりました。つまりデータを固有ベクトルという軸へ射影することで得た新たなデータ点はデータの次元を落としつつ最大限に元のデータを表現している新しいデータ
ということになります。これがPCAのやってることです。「PCAは射影である」
今回は2次元から1次元へのPCAでしたが一般にn次元へのPCAも同じです。固有ベクトルを軸としてとってきて射影により座標がデータのPCA後の座標です。2次元へのPCAなら2本の固有ベクトルにデータを射影して新たな座標を定義します。 最後に用語の説明をしておきます。- 第n主成分: 固有値が大きい方から数えてn番目のものに対応する固有ベクトルのことをいう。
- 寄与率: (第n番目固有値/固有値の総和)
- 累積寄与率: 寄与率の累積
寄与率?固有値?
はい、説明します。固有値は伸縮率といいました。つまり対応する固有ベクトル方向へのデータの散らばり具合です。よって固有値とはデータの広がり具合(分散)を説明します。なので「元データを説明している具合」を分散という観点から考えて寄与としています。 本日はここまで。でわ 参考;