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

PRML 演習問題 7.6 解答

Last updated at Posted at 2020-10-15

問題

出力値が$\mathrm{t\in}${$\mathrm{-1, 1}$}であるロジスティック回帰モデルについて考える. (7.1)という形の$\mathrm{y(x)}$を用いて$\mathrm{p(t=1|y)=\sigma(y)}$とすると尤度関数(の符号を反転したもの)に2乗ノルムの正則化項を加えたものは(7.47)という形を取ることを示せ.
$$
\mathrm{y(x)=w^t\phi(x)+b}
\tag{7.1}
$$
$$
\mathrm{\sum^N_{n=1}E_{LR}(y_nt_n)+\lambda\parallel{w}\parallel^2}
\tag{7.47}
$$

方針

 まず$\mathrm{p(t=1|y)=\sigma(y)}$を, データ$\mathrm{(t_1,y_1),(t_2,y_2),...}$に対し一般化し, 尤度関数について考える. 式の変形と整理を行うことで目的の式である(7.47)を導出する.

解答

$\mathit{p}$($\mathit{t}$=1|$\mathit{y}$)=$\mathrm{\sigma}$($\mathit{y}$)とすると,$\mathit{t\in}${$\mathrm{-1, 1}$}より

\begin{align*}
\mathit{p}(\mathit{t}=-1|\mathit{y})=1-\mathit{p}(\mathit{t}=1|\mathit{y})=1-\mathrm{\sigma(}\mathit{y}\mathrm{)}=\mathrm{\sigma(}\mathit{-y})
\end{align*}

である.したがって

\begin{align*}
\mathit{p}(\mathit{t|y})=\mathrm{\sigma}(\mathit{yt})
\tag{7.46}
\end{align*}

データ($\mathit{t_1, y_1}$), ($\mathit{t_2, y_2}$),...の尤度関数は

\begin{align*}
\mathit{p}(\mathit{t_1,t_2,...|y_1,y_2,...})&=\mathit{p}(\mathit{t_1|y_1})\mathit{p}(\mathit{t_2|y_2})...\\
&=\mathrm{\prod_{i=1}^N\sigma}(\mathit{y_it_i})
\tag{a}
\end{align*}

よって(a)の負の対数を取ることで負の対数尤度関数を得る.

\begin{align*}
-\mathrm{ln\prod_{i=1}^N\sigma}(\mathit{y_it_i})
&=-\mathrm{\sum_{i=1}^Nln\sigma}(\mathit{y_it_i})\\
&=-\mathrm{\sum{ln}\frac{1}{1+exp(-\mathit{y_it_i})}}(ロジスティック回帰なので\mathrm{\sigma}の定義より)\\
&=\mathrm{\sum{ln}(1+exp(-\mathit{y_it_i}))}
\end{align*}

と上記のように変形を行うことで(b)で示される誤差関数を得る.

\begin{align*}
\mathit{E}=\mathrm{\sum^N_{i=1}ln(1+exp(-\mathit{y_it_i}))}
\tag{b}
\end{align*}

二乗ノルムの正則化項を追加すると以下の(c)を得る

\begin{align*}
\mathit{E}=\mathrm{\sum^N_{i=1}ln(1+exp(-\mathit{y_it_i}))+\lambda{\parallel{w}\parallel}}
\tag{c}
\end{align*}

ここで(7.48)を用いると

$$
\mathit{E_\mathrm{LR}(\mathit{y_nt_n})}=\mathrm{ln(1+exp(-\mathit{yt}))}
\tag{7.48}
$$

(7.47)を得る

\begin{align*}
\mathit{E}=\mathrm{\sum^N_{i=1}}\mathit{E_\mathrm{LR}}(\mathit{y_it_i})+\mathrm{\lambda{\parallel}{w}\parallel}
\tag{7.47}
\end{align*}

したがって題意は示された.

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