エンジニアを目指す浪人のブログ

情報系に役立ちそうな応用数理をゆるめにメモします

行列のランク落ち,列フルランク,行フルランク,フルランクそれぞれのときのムーア・ペンローズ逆行列による連立一次方程式の解の意味について考える

本記事は以下の過去記事の内容を用います.

ムーア・ペンローズ逆行列の定義,構成,一意性についてまとめる - エンジニアを目指す浪人のブログ

ムーア・ペンローズ逆行列による連立一次方程式の解表現について考える - エンジニアを目指す浪人のブログ

行列のランクに仮定をおかないときの最小二乗法の解表現と列フルランクを仮定することの意味について考える - エンジニアを目指す浪人のブログ

最小二乗法の基礎をまとめる - エンジニアを目指す浪人のブログ

最小ノルム解の基礎をまとめる - エンジニアを目指す浪人のブログ


本記事は以下の過去記事の内容を既知とすると考えやすいです.

行列のランク落ち,列フルランク,行フルランク,フルランクそれぞれのときの4つの基本部分空間を図示する - エンジニアを目指す浪人のブログ


ムーア・ペンローズ逆行列(Moore-Penrose inverse)は擬似逆行列(pseudoinverse)と呼ばれることもあるとおり,行列が正則でない場合も連立一次方程式の解を逆行列を用いるように擬似的に表現することができます.この(擬似的な)解の意味の結果は文献[1]スライド5,6,7にまとまっていて,面白く感じたのでその結果を導出してまとめておくことにしました.連立一次方程式の解,最小二乗問題の解,最小ノルム解の関係も明らかになります.

=================================================================================

目次

{\displaystyle \; } 0. 準備
{\displaystyle \; } 1. 最小二乗問題の解の集合と連立一次方程式の解の集合
{\displaystyle \; } 2. ムーア・ペンローズ逆行列による連立一次方程式の解の意味


[ 0. 準備 ]

記号を準備します.

{\displaystyle \;\;\; \mathbf{R}^{n}  \;\;\;\;\;\;\;\;  } {\displaystyle \mathbf{R} } の要素を要素にもつ {\displaystyle n } 次元ベクトルの集合
{\displaystyle \;\;\; \mathbf{R}^{m \times n}  \;\;\;\; } {\displaystyle \mathbf{R} } の要素を要素にもつ {\displaystyle m \times n } 行列の集合
{\displaystyle \;\;\; I_n \;\;\;\;\;\;\;\;\;\;  } {\displaystyle n \times n } 単位行列
{\displaystyle \;\;\; x \;\;\;\;\;\;\;\;\;\; } {\displaystyle n } 次元ベクトル ( {\displaystyle  x = [ x_1 \ \cdots \ x_n ]^T } )
{\displaystyle \;\;\; A \;\;\;\;\;\;\;\;\;\; } {\displaystyle m \times n } 行列
{\displaystyle \;\;\; b \;\;\;\;\;\;\;\;\;\; } {\displaystyle m } 次元ベクトル
{\displaystyle \;\;\; C(A) \;\;\;\;\; } {\displaystyle A } の列空間
{\displaystyle \;\;\; A^+ \;\;\;\;\;\;\;\; } {\displaystyle A } のムーア・ペンローズ逆行列( {\displaystyle n \times m } 行列 )


ムーア・ペンローズ逆行列 {\displaystyle A^+ } の定義は冒頭の過去記事(ムーア・ペンローズ逆行列の定義)にあります.

{\displaystyle \left\| \cdot \right\| \;\;\; } (ユークリッド)ノルム {\displaystyle \left\| x \right\| = \sqrt{ x^T x } = \sqrt{ x_1^2 + \cdots + x_n^2 } }



[ 1. 最小二乗問題の解の集合と連立一次方程式の解の集合 ]

{\displaystyle A \in \mathbf{R}^{m \times n},\ b \in \mathbf{R}^{m} } とします.最小二乗問題の解の集合 {\displaystyle \mathcal{X} } と連立一次方程式の解の集合 {\displaystyle \mathcal{X}' } は以下のように定義できます.

{\displaystyle \;\;\; \mathcal{X} \; = \{ x \in \mathbf{R}^n : \ \rho (x)= \left\| Ax - b \right\|^2 \ \mathrm{is \ minimized} \} }
{\displaystyle \;\;\; \mathcal{X}' = \{ x \in \mathbf{R}^n : \ Ax = b \} }


'--------------------------------------------------------------------------------------------------------------------------------------------
事実.

最小二乗問題の解と連立一次方程式の解は同じ形式で表現できる.


証明.

冒頭の過去記事(行列のランクに仮定をおかない)事実2.は以下である.

(1.1){\displaystyle \;\;\;\;\;\; x \in \mathcal{X} \;\; \Longleftrightarrow  \;\; x = A^+ b + (I_n - A^+ A)y, \;\;\; y \in \mathbf{R}^n  }


冒頭の過去記事(ムーア・ペンローズ逆行列による連立一次方程式)定理 6.2(存在).定理 6.3.より以下が成り立つ.

(1.2){\displaystyle \;\;\; [ b \in C(A) ] \;\; \Longrightarrow  \;\; [ x \in \mathcal{X}' \; \Longleftrightarrow  \;  x = A^+ b + (I_n - A^+ A)y, \;\;\; y \in \mathbf{R}^n ] }
(1.3){\displaystyle \;\;\; [ b \notin C(A) ] \;\; \Longleftrightarrow  \;\; [ \mathcal{X}'= \emptyset ] }

(証明終わり)
'--------------------------------------------------------------------------------------------------------------------------------------------



[ 2. ムーア・ペンローズ逆行列による連立一次方程式の解の意味 ]

行列 {\displaystyle A } のランク落ち,列フルランク,行フルランク,フルランクにパターン分けし,それぞれの場合において {\displaystyle x = A ^+ b } がどのような意味をもつのかを考えていきます.


パターン1. (ランク落ち)

{\displaystyle x = A ^+ b } は連立一次方程式 {\displaystyle A x = b } の二乗誤差 {\displaystyle \left\| Ax - b \right\|^2 } を最小化する点のうち最小のノルムをもつただ一つの点です.

理由: {\displaystyle b \notin C(A) } のとき,{\displaystyle \mathcal{X},\mathcal{X}' } は以下となり,最小二乗問題の解と連立一次方程式の解は同じ形式で表されそれぞれ無数にあります.

(2.1.1){\displaystyle \;\;\; \mathcal{X} \; = \{ x \in \mathbf{R}^n : \ \rho (x)= \left\| Ax - b \right\|^2 \ \mathrm{is \ minimized} \} }
{\displaystyle \;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\; = \{ x \in \mathbf{R}^n : \ x = A^+ b \; + (I_n - A^+ A)y, \;\;\; y \in \mathbf{R}^n  \} \;\;\; \because } (1.1)

(2.1.2){\displaystyle \;\;\; \mathcal{X}' = \emptyset \;\;\; \because } (1.3)

(2.1.3){\displaystyle \;\;\; \mathcal{X}' \subset \mathcal{X} }

ここで {\displaystyle  A^+ b \in \mathcal{X} } について考えます.冒頭の過去記事(行列のランクに仮定をおかない)事実4.よりこの解はすべての {\displaystyle  x \in \mathcal{X} } の中で最小のノルムをもつただ一つの解です.


{\displaystyle b \in C(A) } のときはほぼ同様にして以下となります.

(2.1.4){\displaystyle \;\;\; \mathcal{X} \; =  \{ x \in \mathbf{R}^n : \ x = A^+ b \; + (I_n - A^+ A)y, \;\;\; y \in \mathbf{R}^n  \} \;\;\; \because } (2.1.1)に同じ

(2.1.5){\displaystyle \;\;\; \mathcal{X}' = \{ x \in \mathbf{R}^n : \  A x = b \} }
{\displaystyle \;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\; = \{ x \in \mathbf{R}^n : \ x = A^+ b \; + (I_n - A^+ A)y, \;\;\; y \in \mathbf{R}^n  \} \;\;\; \because } (1.2)

(2.1.6){\displaystyle \;\;\; \mathcal{X}' = \mathcal{X} }

ここで {\displaystyle  A^+ b \in \mathcal{X} \ (= \mathcal{X}') } について考えます.冒頭の過去記事(行列のランクに仮定をおかない)事実4.よりこの解はすべての {\displaystyle  x \in \mathcal{X} \ (= \mathcal{X}') } の中で最小のノルムをもつただ一つの解です.


パターン2. (列フルランク)

{\displaystyle x = A ^+ b } は連立一次方程式 {\displaystyle A x = b } の二乗誤差 {\displaystyle \left\| Ax - b \right\|^2 } を最小化するただ一つの点です.

補足: このパターンは多くの教科書等において最小二乗法として説明されている場合であり,冒頭の過去記事(最小二乗法)の内容と実質的に同じものです.

理由: {\displaystyle b \notin C(A) } のとき,列フルランクより {\displaystyle A^+ A = I_n } となるので {\displaystyle \mathcal{X},\mathcal{X}' } は以下となり,最小二乗問題の解はただ一つに決まります.この内容は冒頭の過去記事(行列のランクに仮定をおかない)事実5.と同じことを意味しています.

(2.2.1){\displaystyle \;\;\; \mathcal{X} \; = \{ x \in \mathbf{R}^n : \ \rho (x)= \left\| Ax - b \right\|^2 \ \mathrm{is \ minimized} \} }
{\displaystyle \;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\; = \{ x \in \mathbf{R}^n : \ x = A^+ b \; + (I_n - A^+ A)y, \;\;\; y \in \mathbf{R}^n  \} \;\;\; \because } (1.1)
{\displaystyle \;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\; = \{ x \in \mathbf{R}^n : \ x = A^+ b \; + (I_n - I_n)y, \;\;\; y \in \mathbf{R}^n  \} }
{\displaystyle \;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\; = \{ x \in \mathbf{R}^n : \ x = A^+ b  \} }
{\displaystyle \;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\; = \{ A^+ b  \} }

(2.2.2){\displaystyle \;\;\; \mathcal{X}' = \emptyset \;\;\; \because } (1.3)

(2.2.3){\displaystyle \;\;\; \mathcal{X}' \subset \mathcal{X} }


{\displaystyle b \in C(A) } のときはほぼ同様にして以下となります.

(2.2.4){\displaystyle \;\;\; \mathcal{X} \; = \{ A^+ b  \} \;\;\; \because } (2.2.1)に同じ

(2.2.5){\displaystyle \;\;\; \mathcal{X}' = \{ A^+ b \} \;\;\; \because } (1.2)を用いて(2.2.1)と同様に計算する

(2.2.6){\displaystyle \;\;\; \mathcal{X}' = \mathcal{X} }


パターン3. (行フルランク)

{\displaystyle x = A ^+ b } は連立一次方程式 {\displaystyle A x = b } の無数の解のうち最小のノルムをもつただ一つの点です.

補足: このパターンは冒頭の過去記事(最小ノルム解)の内容と実質的に同じものです.また文献[3]に参考になる図があります.

理由: 行フルランクのとき常に {\displaystyle b \in C(A) } です.{\displaystyle \mathcal{X},\mathcal{X}' } は以下となり,最小二乗問題の解と連立一次方程式の解は同じ形式で表されそれぞれ無数にあります.

(2.3.1){\displaystyle \;\;\; \mathcal{X} \; = \{ x \in \mathbf{R}^n : \ \rho (x)= \left\| Ax - b \right\|^2 \ \mathrm{is \ minimized} \} }
{\displaystyle \;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\; = \{ x \in \mathbf{R}^n : \ x = A^+ b \; + (I_n - A^+ A)y, \;\;\; y \in \mathbf{R}^n  \} \;\;\; \because } (1.1)

(2.3.2){\displaystyle \;\;\; \mathcal{X}' = \{ x \in \mathbf{R}^n : \  A x = b \} }
{\displaystyle \;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\; = \{ x \in \mathbf{R}^n : \ x = A^+ b \; + (I_n - A^+ A)y, \;\;\; y \in \mathbf{R}^n  \} \;\;\; \because } (1.2)

(2.3.3){\displaystyle \;\;\; \mathcal{X}' = \mathcal{X} }

ここで {\displaystyle  A^+ b \in \mathcal{X} \ (= \mathcal{X}') } について考えます.冒頭の過去記事(行列のランクに仮定をおかない)事実4.よりこの解はすべての {\displaystyle  x \in \mathcal{X} \ (= \mathcal{X}') } の中で最小のノルムをもつただ一つの解です.


パターン4. (フルランク)

{\displaystyle x = A ^+ b } は連立一次方程式 {\displaystyle A x = b } のただ一つの解です.

理由: フルランクのとき常に {\displaystyle b \in C(A) } です.{\displaystyle A^+ = A^{-1}} となるので {\displaystyle \mathcal{X},\mathcal{X}' } は以下となり,最小二乗問題の解と連立一次方程式の解はそれぞれただ一つに決まり,それらは同じものです.

(2.4.1){\displaystyle \;\;\; \mathcal{X} \; = \{ x \in \mathbf{R}^n : \ \rho (x)= \left\| Ax - b \right\|^2 \ \mathrm{is \ minimized} \} }
{\displaystyle \;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\; = \{ x \in \mathbf{R}^n : \ x = A^+ b \; + (I_n - A^+ A)y, \;\;\; y \in \mathbf{R}^n  \} \;\;\; \because } (1.1)
{\displaystyle \;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\; = \{ x \in \mathbf{R}^n : \ x = A^{-1} b + (I_n - A^{-1} A)y, \;\;\; y \in \mathbf{R}^n  \} }
{\displaystyle \;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\; = \{ x \in \mathbf{R}^n : \ x = A^{-1} b + (I_n - \;\; I_n)y, \;\;\; y \in \mathbf{R}^n  \} }
{\displaystyle \;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\; = \{ x \in \mathbf{R}^n : \ x = A^{-1} b  \} }
{\displaystyle \;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\; = \{ A^{-1} b  \} \; (= \{ A^+ b \} ) }

(2.4.2){\displaystyle \;\;\; \mathcal{X}' = \{ A^{-1} b \} \; (= \{ A^+ b \} ) \;\;\; \because } (1.2)を用いて(2.4.1)と同様に計算する

(2.4.3){\displaystyle \;\;\; \mathcal{X}' = \mathcal{X} }


=================================================================================

以上,行列のランク落ち,列フルランク,行フルランク,フルランクそれぞれのときのムーア・ペンローズ逆行列による連立一次方程式の解の意味について考えてみました.



参考文献
[1] 早稲田大学 杉本憲治郎先生のノート https://www.slideshare.net/wosugi/ss-79624897
[2] 電気通信大学 末廣尚士先生のノート http://www.taka.is.uec.ac.jp/~suehiro/class2015/presen/lecture10_2.pdf
[3] Mathematics Stack Exchange https://math.stackexchange.com/questions/2253443/difference-between-least-squares-and-minimum-norm-solution/2253455