補足. 最小2乗法_$P_X$の性質についての証明

$\gdef \vec#1{\boldsymbol{#1}} \\ \gdef \rank {\mathrm{rank}} \\ \gdef \det {\mathrm{det}} \\ \gdef \Bern {\mathrm{Bern}} \\ \gdef \Bin {\mathrm{Bin}} \\ \gdef \Mn {\mathrm{Mn}} \\ \gdef \Cov {\mathrm{Cov}} \\ \gdef \Po {\mathrm{Po}} \\ \gdef \HG {\mathrm{HG}} \\ \gdef \Geo {\mathrm{Geo}}\\ \gdef \N {\mathrm{N}} \\ \gdef \LN {\mathrm{LN}} \\ \gdef \U {\mathrm{U}} \\ \gdef \t {\mathrm{t}} \\ \gdef \F {\mathrm{F}} \\ \gdef \Exp {\mathrm{Exp}} \\ \gdef \Ga {\mathrm{Ga}} \\ \gdef \Be {\mathrm{Be}} \\ \gdef \NB {\mathrm{NB}}$

(証明すべき内容の再掲)
$P_X = \vec X (\vec X^{\top} \vec X)^{-1} \vec X^{\top}$に対して、

①$P_{X}^2 = P_{X}$
②$P_{X}^{\top} = P_{X}$
③$P_{X} \vec X = \vec X$
④$P_{X} \vec a \in Im(\vec X) ~~ (\forall a \in \mathbb{R}^{n})$

(ただし、$Im(\vec X)$は$\vec X$の列ベクトルで張られた空間)

が成立する。

(証明)

(①について)
$$\begin{aligned} P_X^2 &= (\vec X (\vec X^{\top} \vec X)^{-1} \vec X^{\top}) (\vec X (\vec X^{\top} \vec X)^{-1} \vec X^{\top}) \\[10px] &= \vec X \underbrace{(\vec X^{\top} \vec X)^{-1} (\vec X^{\top} \vec X)}_{=I} (\vec X^{\top} \vec X)^{-1} \vec X^{\top} \\[10px] &= \vec X (\vec X^{\top} \vec X)^{-1} \vec X^{\top} \\[10px] &= P_X \end{aligned}$$


(②について)
$$\begin{aligned} P_X^{\top} &= (\vec X (\vec X^{\top} \vec X)^{-1} \vec X^{\top})^{\top} \\[10px] &= \vec X (\vec X (\vec X^{\top} \vec X)^{-1})^{\top} \\ &{\scriptsize ((\bullet \circ)^{\top} = \circ^{\top} \bullet^{\top})} \\[10px] &= \vec X ((\vec X^{\top} \vec X)^{-1})^{\top} \vec X^{\top} \\[10px] &= \vec X ((\vec X^{\top} \vec X)^{\top})^{-1} \vec X^{\top} \\ &{\scriptsize ((\bullet^{-1})^{\top} = (\bullet^{\top})^{-1})} \\[10px] &= \vec X (\vec X^{\top} \vec X)^{-1} \vec X^{\top} \\[10px] &= P_X \end{aligned}$$


(③について)
$$\begin{aligned} P_X \vec X &= \vec X \underbrace{(\vec X^{\top} \vec X)^{-1} \vec X^{\top} \vec X}_{=I} \\[10px] &= \vec X \end{aligned}$$


(④について)
$\forall \vec a \in \mathbb{R}^n$に対して、
$$\begin{aligned} P_X \vec a &= \vec X (\vec X^{\top} \vec X)^{-1} \vec X^{\top} \vec a \\[10px] &= \textcolor{red}{\vec X} \{ (\vec X^{\top} \vec X)^{-1} \vec X^{\top} \vec a \} \end{aligned}$$と$\vec X$の積の形になるため、$P_{X} \vec a \in Im(\vec X)$