機械学習基礎理論独習

誤りがあればご指摘いただけると幸いです。数式が整うまで少し時間かかります。リンクフリーです。

勉強ログです。リンクフリーです
目次へ戻る

PRML演習問題 3.2(標準)

問題

行列

\begin{eqnarray}
{\bf\Phi}\left({\bf\Phi}^\top{\bf\Phi}\right)^{-1}{\bf\Phi}^\top\tag{3.103}
\end{eqnarray}

は任意のベクトル {\bf v}\bf\Phi の列ベクトルで張られる空間の上に正射影することを示せ。
そしてこの結果を使って、最小二乗解 (3.15) は図 3.2 で示した多様体 \mathcal S の上に
ベクトル \bf t を正射影することに対応していることを示せ。

参照

\begin{eqnarray}
y({\bf x},{\bf w})=\sum_{j=0}^{M-1}w_j\phi_j({\bf x})={\bf w}^\top{\boldsymbol\phi}({\bf x})\tag{3.3}
\end{eqnarray}

\begin{eqnarray}
{\bf w}_{\rm ML}=\left({\bf\Phi}^\top{\bf\Phi}\right)^{-1}{\bf\Phi}^\top{\bf t}\tag{3.15}
\end{eqnarray}

3.2
f:id:olj611:20211017213346p:plain:w300

解答

{\bf\Phi}\left({\bf\Phi}^\top{\bf\Phi}\right)^{-1}{\bf\Phi}^\top{\bf v} を計算します。

\begin{eqnarray}
{\bf\Phi}\left({\bf\Phi}^\top{\bf\Phi}\right)^{-1}{\bf\Phi}^\top{\bf v}&=&{\bf\Phi}\widetilde{\bf v}\ \ \ \ (\widetilde{\bf v}:=\left({\bf\Phi}^\top{\bf\Phi}\right)^{-1}{\bf\Phi}^\top{\bf v})\\
&=&\begin{pmatrix}{\boldsymbol\psi}_1 & \cdots & {\boldsymbol\psi}_M \end{pmatrix}\begin{pmatrix}\tilde{v}_1\\ \vdots\\ \tilde{v}_M\end{pmatrix}\\
&=&{\boldsymbol\psi}_1\tilde{v}_1+\cdots+{\boldsymbol\psi}_M\tilde{v}_M\tag{1}
\end{eqnarray}

(1)より、{\bf\Phi}\left({\bf\Phi}^\top{\bf\Phi}\right)^{-1}{\bf\Phi}^\top{\bf v}{\boldsymbol\Phi} の列ベクトル {\boldsymbol\psi}_m\ (m=1,\ldots,M) の線形結合で表されます。
よって、式 (3.103) は任意のベクトル {\bf v}\bf\Phi の列空間 \mathcal S に(正)射影することを示せました。

2\bf y は成分が y({\bf x}_n, {\bf w}) のベクトルであるので、次のように書けます。

\begin{eqnarray}
{\bf y}&=&\begin{pmatrix}y({\bf x}_1, {\bf w})\\ \vdots\\ y({\bf x}_N, {\bf w})\end{pmatrix}\\
&=&\begin{pmatrix}{\bf w}^\top{\boldsymbol\phi}({\bf x}_1)\\ \vdots\\ {\bf w}^\top{\boldsymbol\phi}({\bf x}_N)\end{pmatrix}\\
&=&\begin{pmatrix}{\boldsymbol\phi}({\bf x}_1)^\top{\bf w}\\ \vdots\\ {\boldsymbol\phi}({\bf x}_N)^\top{\bf w}\end{pmatrix}\\
&=&\begin{pmatrix}{\boldsymbol\phi}({\bf x}_1)^\top\\ \vdots\\ {\boldsymbol\phi}({\bf x}_N)^\top\end{pmatrix}{\bf w}\\
&=&{\boldsymbol\Phi}{\bf w}\tag{2}
\end{eqnarray}

(2) に式 (3.15) を代入します。

\begin{eqnarray}
{\bf y}&=&{\boldsymbol\Phi}{\bf w}_{\rm ML}\\
&=&{\bf\Phi}\left({\bf\Phi}^\top{\bf\Phi}\right)^{-1}{\bf\Phi}^\top{\bf t}\tag{3}
\end{eqnarray}

(3) は式 (1) より、\bf\Phi の列空間 {\mathcal S} に射影されます。
これが正射影であることを示すためには、列空間 {\mathcal S} を張るベクトル {\boldsymbol\psi}_j
ベクトル {\bf y}-{\bf t} が直交することを示せばよいです。

 ({\bf y}-{\bf t})^\top{\boldsymbol\psi}_j を計算します。

\begin{eqnarray}
({\bf y}-{\bf t})^\top{\boldsymbol\psi}_j&=&({\bf\Phi}\left({\bf\Phi}^\top{\bf\Phi}\right)^{-1}{\bf\Phi}^\top{\bf t}-{\bf t})^\top{\boldsymbol\psi}_j\\
&=&\left({\bf t}^\top{\bf\Phi}\left(\left({\bf\Phi}^\top{\bf\Phi}\right)^{-1}\right)^\top{\bf\Phi}^\top-{\bf t}^\top\right){\boldsymbol\psi}_j\\
&=&\left({\bf t}^\top{\bf\Phi}\left({\bf\Phi}^\top{\bf\Phi}\right)^{-1}{\bf\Phi}^\top-{\bf t}^\top\right){\boldsymbol\psi}_j\\
&=&{\bf t}^\top\left({\bf\Phi}\left({\bf\Phi}^\top{\bf\Phi}\right)^{-1}{\bf\Phi}^\top-{\bf I}\right){\boldsymbol\psi}_j\\
&=&{\bf t}^\top\left({\bf\Phi}\left({\bf\Phi}^\top{\bf\Phi}\right)^{-1}{\bf\Phi}^\top{\boldsymbol\psi}_j-{\boldsymbol\psi}_j\right)\\
&=&{\bf t}^\top\left({\boldsymbol\psi}_j-{\boldsymbol\psi}_j\right)\tag{4}\\
&=&0\tag{5}
\end{eqnarray}

(4) の式変形については、補足にて説明します。
(5) より、列空間 {\mathcal S} を張るベクトル {\boldsymbol\psi}_j とベクトル {\bf y}-{\bf t} が直交することが示せたので、
最小二乗解 (3.15) は列空間 \mathcal S の上にベクトル \bf t を正射影することに対応していることを示せました。
(問題文の「多様体 \mathcal S」を本解答では、「列空間 {\mathcal S}」として記載しております。)

補足

(4) の式変形について、説明します。

{\bf\Phi}\left({\bf\Phi}^\top{\bf\Phi}\right)^{-1}{\bf\Phi}^\top は列空間 {\mathcal S} への射影になっており、{\boldsymbol\psi}_j の張る空間が列空間 {\mathcal S} です。
なので、{\boldsymbol\psi}_j を列空間 {\mathcal S} へ射影しても、{\boldsymbol\psi}_j のままです。
よって、{\bf\Phi}\left({\bf\Phi}^\top{\bf\Phi}\right)^{-1}{\bf\Phi}^\top{\boldsymbol\psi}_j={\boldsymbol\psi}_j が成り立ちます。

また、

\begin{eqnarray}
{\bf\Phi}\left({\bf\Phi}^\top{\bf\Phi}\right)^{-1}{\bf\Phi}^\top{\bf\Phi}&=&{\bf\Phi}\left({\bf\Phi}^\top{\bf\Phi}\right)^{-1}{\bf\Phi}^\top\begin{pmatrix}{\boldsymbol\psi}_1 & \cdots & {\boldsymbol\psi}_M \end{pmatrix}\\
&=&\begin{pmatrix}\left({\bf\Phi}^\top{\bf\Phi}\right)^{-1}{\bf\Phi}^\top{\boldsymbol\psi}_1 & \cdots & \left({\bf\Phi}^\top{\bf\Phi}\right)^{-1}{\bf\Phi}^\top{\boldsymbol\psi}_M \end{pmatrix}\tag{6}\\
&=&{\bf\Phi}\tag{7}
\end{eqnarray}

となり、式 (6),(7) を比較すると、\left({\bf\Phi}^\top{\bf\Phi}\right)^{-1}{\bf\Phi}^\top{\boldsymbol\psi}_j{\bf\Phi} の第 j 列になっていることが分かるので、
{\bf\Phi}\left({\bf\Phi}^\top{\bf\Phi}\right)^{-1}{\bf\Phi}^\top{\boldsymbol\psi}_j={\boldsymbol\psi}_j が成り立ちます。

目次へ戻る