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?

リッジ回帰の双対表現

Posted at

リッジ回帰の双対表現

PRML Chapter6 p.3参照

\begin {align*}
& J(\mathbf{w}) = \frac{1}{2} \sum\left(y_i - \mathbf{x}_i^T\mathbf{w}\right)^2+\frac{1}{2} \lambda \mathbf{w}^T\mathbf{w} \\
& \frac{\partial}{\partial \mathbf{w}}=0 \\
& \mathbf{w}=\frac{1}{\lambda}\sum\left(y_i - \mathbf{x}_i^T\mathbf{w}\right)\mathbf{x}_i \\
& \mathbf{w}=\sum a_i \mathbf{x}_i \\
& (a_i = \frac{1}{\lambda}\left(y_i - \mathbf{x}_i^T\mathbf{w}\right)) \\
& \mathbf{w} = \left(\mathbf{x}_1, \ldots, \mathbf{x}_N\right)\left(\begin{array}{c}
a_1 \\
\vdots \\
a_N
\end{array}\right) \\
& \mathbf{w} = \mathbf{X}^T\mathbf{a} \\
\end {align*}
\begin {align*}
J(\mathbf{w}) & =\frac{1}{2}(\mathbf{y}-\mathbf{X} \mathbf{w})^{\top}(\mathbf{y}-\mathbf{X} \mathbf{w})+\frac{1}{2} \lambda \mathbf{w}^{\top} \mathbf{w} . \\
& =\frac{1}{2}\left(\mathbf{y}-\mathbf{X} \mathbf{X}^{\top} \mathbf{a}\right)^{\top}\left(\mathbf{y}-\mathbf{X} \mathbf{X}^{\top} \mathbf{a}\right)+\frac{1}{2} \lambda\left(\mathbf{X}^{\top} \mathbf{a}\right)^{\top}\left(\mathbf{X}^{\top} \mathbf{a}\right) \\
& =\frac{1}{2}\left\{\mathbf{y}^{\top} \mathbf{y}-\mathbf{y}^{\top} \mathbf{X} \mathbf{X}^{\top} \mathbf{a} - (\mathbf{X} \mathbf{X}^{\top} \mathbf{a})^{\top} \mathbf{y} + \left(\mathbf{X} \mathbf{X}^{\top} \mathbf{a}\right)^{\top} \mathbf{X} \mathbf{X}^{\top} \mathbf{a}\right\}+\frac{1}{2} \lambda \mathbf{a}^{\top} \mathbf{X} \mathbf{X}^{\top} \mathbf{a} \\
& =\frac{1}{2}\left\{\mathbf{y}^{\top} \mathbf{y} + \mathbf{a}^{\top} \mathbf{X} \mathbf{X}^{\top} \mathbf{X} \mathbf{X}^{\top} \mathbf{a}-\left(\mathbf{y}^{\top} \mathbf{X} \mathbf{X}^{\top} \mathbf{a}\right)^{\top}-\mathbf{a}^{\top} \mathbf{X} \mathbf{X}^{\top} \mathbf{y}+\mathbf{a}^{\top} \mathbf{X} \mathbf{X}^{\top} \mathbf{X} \mathbf{X}^{\top} \mathbf{a}\right\}+\frac{1}{2} \lambda \mathbf{a}^{\top} \mathbf{X} \mathbf{X}^{\top} \mathbf{a}  \\
= & \frac{1}{2} \mathbf{a}^{\top} \mathbf{X} \mathbf{X}^{\top} \mathbf{X} \mathbf{X}^{\top} \mathbf{a}-\mathbf{a}^{\top} \mathbf{X} \mathbf{X}^{\top} \mathbf{y}+\frac{1}{2} \mathbf{y}^{\top} \mathbf{y}+\frac{\lambda}{2} \mathbf{a}^{\top} \mathbf{X} \mathbf{X}^{\top}\mathbf{a} \\
& (\mathbf{X}\mathbf{X}^{\top} = \mathbf{K}) \\
= & \frac{1}{2} \mathbf{a}^{\top} \mathbf{K} \mathbf{K} \mathbf{a}-\mathbf{a}^{\top} \mathbf{K} \mathbf{y}+\frac{1}{2} \mathbf{y}^{\top} \mathbf{y}+\frac{\lambda}{2} \mathbf{a}^{\top} \mathbf{K}\mathbf{a} \\
\end {align*}
\begin {align*}
& \mathbf{a}=\frac{1}{\lambda}(\mathbf{y}-\mathbf{X}\mathbf{w}) \\
& =\frac{1}{\lambda}\left(\mathbf{y}-\mathbf{X}\mathbf{X}^{\top}\mathbf{a}\right) \\
& \lambda \mathbf{a}=\mathbf{y}- \mathbf{K}\mathbf{a} \\
& \mathbf{a} = (\mathbf{K} + \lambda \mathbf{I})^{-1}\mathbf{y}
\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?