Concept in statistics
統計学 において 、 射影行列 [1] ( 影響行列 [2] 、 ハット行列 と も呼ばれる)は、 応答値 (従属変数値)のベクトルを 適合値 (または予測値) のベクトルにマッピングする。これは 、各応答値が各適合値に与える 影響を表す。 [3] [4] 射影行列の対角要素は てこ比で あり、これは同じ観測値に対する各応答値が適合値に与える影響を表す。 ( P ) {\displaystyle (\mathbf {P} )} ( H ) {\displaystyle (\mathbf {H} )}
意味 応答値 のベクトルを 、適合値のベクトルを と 表すと 、 y {\displaystyle \mathbf {y} } y ^ {\displaystyle \mathbf {\hat {y}} }
y ^ = P y . {\displaystyle \mathbf {\hat {y}} =\mathbf {P} \mathbf {y} .} 通常「Y ハット」と発音される ように、投影行列は 「 帽子 をかぶる」ことから ハット行列 とも呼ばれます 。 y ^ {\displaystyle \mathbf {\hat {y}} } P {\displaystyle \mathbf {P} } y {\displaystyle \mathbf {y} }
残余財産の申請 残差 ベクトルの式は 、射影行列を使って簡潔に表現することもできます。 r {\displaystyle \mathbf {r} }
r = y − y ^ = y − P y = ( I − P ) y . {\displaystyle \mathbf {r} =\mathbf {y} -\mathbf {\hat {y}} =\mathbf {y} -\mathbf {P} \mathbf {y} =\left(\mathbf {I} -\mathbf {P} \right)\mathbf {y} .} ここでは 単位行列 です 。この行列は 残差マーカー行列 または 消滅行列 と呼ばれることもあります 。 I {\displaystyle \mathbf {I} } M := I − P {\displaystyle \mathbf {M} :=\mathbf {I} -\mathbf {P} }
残差の 共分散行列 は 、 誤差伝播 により、 r {\displaystyle \mathbf {r} }
Σ r = ( I − P ) T Σ ( I − P ) {\displaystyle \mathbf {\Sigma } _{\mathbf {r} }=\left(\mathbf {I} -\mathbf {P} \right)^{\textsf {T}}\mathbf {\Sigma } \left(\mathbf {I} -\mathbf {P} \right)} 、 ここで 、は誤差ベクトル(および拡張により応答ベクトル)の 共分散行列である。 独立かつ同一分布に 従う誤差 を持つ線形モデルの場合 、これは次のように簡約される。 [3] Σ {\displaystyle \mathbf {\Sigma } } Σ = σ 2 I {\displaystyle \mathbf {\Sigma } =\sigma ^{2}\mathbf {I} }
Σ r = ( I − P ) σ 2 {\displaystyle \mathbf {\Sigma } _{\mathbf {r} }=\left(\mathbf {I} -\mathbf {P} \right)\sigma ^{2}} 。
直感 行列の列空間は緑の線で表されます。ある ベクトルを行列 の列空間に射影したもの は、ベクトル A {\displaystyle \mathbf {A} } b {\displaystyle \mathbf {b} } A {\displaystyle \mathbf {A} } x {\displaystyle \mathbf {x} } 図から、ベクトルから の 列空間への最も近い点 は であり 、 の列空間に直交する線を引ける点であることがわかります 。行列の列空間に直交するベクトルは、 行列転置の 零空間内にあるため、 b {\displaystyle \mathbf {b} } A {\displaystyle \mathbf {A} } A x {\displaystyle \mathbf {Ax} } A {\displaystyle \mathbf {A} }
A T ( b − A x ) = 0 {\displaystyle \mathbf {A} ^{\textsf {T}}(\mathbf {b} -\mathbf {Ax} )=0} 。 そこから並べ替えると
A T b − A T A x = 0 ⇒ A T b = A T A x ⇒ x = ( A T A ) − 1 A T b {\displaystyle {\begin{aligned}&&\mathbf {A} ^{\textsf {T}}\mathbf {b} &-\mathbf {A} ^{\textsf {T}}\mathbf {Ax} =0\\\Rightarrow &&\mathbf {A} ^{\textsf {T}}\mathbf {b} &=\mathbf {A} ^{\textsf {T}}\mathbf {Ax} \\\Rightarrow &&\mathbf {x} &=\left(\mathbf {A} ^{\textsf {T}}\mathbf {A} \right)^{-1}\mathbf {A} ^{\textsf {T}}\mathbf {b} \end{aligned}}} 。 したがって、 は の列空間上にあるので、 に 写像する射影行列 は です 。 A x {\displaystyle \mathbf {Ax} } A {\displaystyle \mathbf {A} } b {\displaystyle \mathbf {b} } x {\displaystyle \mathbf {x} } A ( A T A ) − 1 A T {\displaystyle \mathbf {A} \left(\mathbf {A} ^{\textsf {T}}\mathbf {A} \right)^{-1}\mathbf {A} ^{\textsf {T}}}
線形モデル 線形最小二乗法を用いて線形モデルを推定したいとします。モデルは次のように表すことができます。
y = X β + ε , {\displaystyle \mathbf {y} =\mathbf {X} {\boldsymbol {\beta }}+{\boldsymbol {\varepsilon }},} ここで、 は 説明変数 の行列 ( 設計行列 )、 β は推定される未知のパラメータのベクトル、 ε は誤差ベクトルです。 X {\displaystyle \mathbf {X} }
多くの種類のモデルや手法がこの定式化の対象となります。例としては、 線形最小二乗法 、 平滑化スプライン 、 回帰スプライン 、 局所回帰 、 カーネル回帰 、 線形フィルタリング などが挙げられます。
通常の最小二乗法 各観測値の重みが同一で、 誤差 が無相関の場合、推定パラメータは
β ^ = ( X T X ) − 1 X T y , {\displaystyle {\hat {\boldsymbol {\beta }}}=\left(\mathbf {X} ^{\textsf {T}}\mathbf {X} \right)^{-1}\mathbf {X} ^{\textsf {T}}\mathbf {y} ,} したがって適合値は
y ^ = X β ^ = X ( X T X ) − 1 X T y . {\displaystyle {\hat {\mathbf {y} }}=\mathbf {X} {\hat {\boldsymbol {\beta }}}=\mathbf {X} \left(\mathbf {X} ^{\textsf {T}}\mathbf {X} \right)^{-1}\mathbf {X} ^{\textsf {T}}\mathbf {y} .} したがって、射影行列(およびハット行列)は次のように与えられる。
P := X ( X T X ) − 1 X T . {\displaystyle \mathbf {P} :=\mathbf {X} \left(\mathbf {X} ^{\textsf {T}}\mathbf {X} \right)^{-1}\mathbf {X} ^{\textsf {T}}.}
加重最小二乗法と一般化最小二乗法 上記は、重みが同一でない場合や誤差が相関している場合にも一般化できる。 誤差の 共分散行列を Σ とすると、
β ^ GLS = ( X T Σ − 1 X ) − 1 X T Σ − 1 y {\displaystyle {\hat {\mathbf {\beta } }}_{\text{GLS}}=\left(\mathbf {X} ^{\textsf {T}}\mathbf {\Sigma } ^{-1}\mathbf {X} \right)^{-1}\mathbf {X} ^{\textsf {T}}\mathbf {\Sigma } ^{-1}\mathbf {y} } 。 帽子行列はこうして
H = X ( X T Σ − 1 X ) − 1 X T Σ − 1 {\displaystyle \mathbf {H} =\mathbf {X} \left(\mathbf {X} ^{\textsf {T}}\mathbf {\Sigma } ^{-1}\mathbf {X} \right)^{-1}\mathbf {X} ^{\textsf {T}}\mathbf {\Sigma } ^{-1}} また、 であることが分かります が、今度は対称ではなくなりました。 H 2 = H ⋅ H = H {\displaystyle H^{2}=H\cdot H=H}
プロパティ 射影行列には、いくつかの有用な代数的性質があります。 [5] [6] 線形代数 の言語では 、射影行列は 計画行列の 列空間 への 直交射影 です。 [4] (は Xの擬似逆行列 である ことに注意 。)この設定における射影行列のいくつかの事実は、次のようにまとめられます。 [4] X {\displaystyle \mathbf {X} } ( X T X ) − 1 X T {\displaystyle \left(\mathbf {X} ^{\textsf {T}}\mathbf {X} \right)^{-1}\mathbf {X} ^{\textsf {T}}}
u = ( I − P ) y , {\displaystyle \mathbf {u} =(\mathbf {I} -\mathbf {P} )\mathbf {y} ,} そして u = y − P y ⊥ X . {\displaystyle \mathbf {u} =\mathbf {y} -\mathbf {P} \mathbf {y} \perp \mathbf {X} .} P {\displaystyle \mathbf {P} } は対称であり、 も同様です 。 M := I − P {\displaystyle \mathbf {M} :=\mathbf {I} -\mathbf {P} } P {\displaystyle \mathbf {P} } はべき等です: 、 も同様です 。 P 2 = P {\displaystyle \mathbf {P} ^{2}=\mathbf {P} } M {\displaystyle \mathbf {M} } が n × r 行列で 、が成り立つ 場合、 X {\displaystyle \mathbf {X} } rank ( X ) = r {\displaystyle \operatorname {rank} (\mathbf {X} )=r} rank ( P ) = r {\displaystyle \operatorname {rank} (\mathbf {P} )=r} の 固有値 は r 個の1と n − r 個の0から構成され 、の固有値は n − r 個の1と r 個の0から構成されます 。 [7] P {\displaystyle \mathbf {P} } M {\displaystyle \mathbf {M} } X {\displaystyle \mathbf {X} } は に関して不変です 。 したがって です 。 P {\displaystyle \mathbf {P} } P X = X , {\displaystyle \mathbf {PX} =\mathbf {X} ,} ( I − P ) X = 0 {\displaystyle \left(\mathbf {I} -\mathbf {P} \right)\mathbf {X} =\mathbf {0} } ( I − P ) P = P ( I − P ) = 0 . {\displaystyle \left(\mathbf {I} -\mathbf {P} \right)\mathbf {P} =\mathbf {P} \left(\mathbf {I} -\mathbf {P} \right)=\mathbf {0} .} P {\displaystyle \mathbf {P} } 特定のサブスペースに対して一意です。 線形モデル に対応する投影行列は 対称 かつべき 等性 、つまり で ある 。しかし、これは常に当てはまるわけではない。例えば、 局所重み付け散布図平滑化法(LOESS) では、ハット行列は一般に対称でもべき等でもない。 P 2 = P {\displaystyle \mathbf {P} ^{2}=\mathbf {P} }
線形モデル の場合 、射影行列の トレース はの 階数 に等しく 、これは線形モデルの独立パラメータの数です。 [8] 観測において依然として線形であるLOESSなどの他のモデルの場合、射影行列を使用して モデルの 有効自由度を 定義できます。 X {\displaystyle \mathbf {X} } y {\displaystyle \mathbf {y} }
回帰分析における投影行列の実際的な応用としては、 影響力のある観測値 、つまり回帰の結果に大きな影響を与える観測値 を特定することに関係するてこ 比 や クックの距離などがあります。
計画行列を 列ごとに と分解できると仮定する 。ハット演算子または射影演算子を と定義する 。同様に、残差演算子を と定義する 。すると、射影行列は次のように分解できる。 [9] X {\displaystyle \mathbf {X} } X = [ A B ] {\displaystyle \mathbf {X} ={\begin{bmatrix}\mathbf {A} &\mathbf {B} \end{bmatrix}}} P [ X ] := X ( X T X ) − 1 X T {\displaystyle \mathbf {P} [\mathbf {X} ]:=\mathbf {X} \left(\mathbf {X} ^{\textsf {T}}\mathbf {X} \right)^{-1}\mathbf {X} ^{\textsf {T}}} M [ X ] := I − P [ X ] {\displaystyle \mathbf {M} [\mathbf {X} ]:=\mathbf {I} -\mathbf {P} [\mathbf {X} ]}
P [ X ] = P [ A ] + P [ M [ A ] B ] , {\displaystyle \mathbf {P} [\mathbf {X} ]=\mathbf {P} [\mathbf {A} ]+\mathbf {P} {\big [}\mathbf {M} [\mathbf {A} ]\mathbf {B} {\big ]},} ここで、例えば、 および で ある。このような分解には多くの応用がある。古典的な応用では、 は すべて1の列であり、回帰分析に切片項を追加した場合の効果を分析することができる。別の用途としては、 固定効果モデル が挙げられる。ここで、は固定効果項のダミー変数からなる 大きな 疎行列 である。この分割を用いることで、 のハット行列を、を明示的に作成することなく 計算することができる。 行列 は大きすぎてコンピュータのメモリに収まらない可能性がある。 P [ A ] = A ( A T A ) − 1 A T {\displaystyle \mathbf {P} [\mathbf {A} ]=\mathbf {A} \left(\mathbf {A} ^{\textsf {T}}\mathbf {A} \right)^{-1}\mathbf {A} ^{\textsf {T}}} M [ A ] = I − P [ A ] {\displaystyle \mathbf {M} [\mathbf {A} ]=\mathbf {I} -\mathbf {P} [\mathbf {A} ]} A {\displaystyle \mathbf {A} } A {\displaystyle \mathbf {A} } X {\displaystyle \mathbf {X} } X {\displaystyle \mathbf {X} }
歴史 ハット行列は 1972 年に John Wilder によって導入されました。Hoaglin, DC と Welsch, RE (1978) による論文では、この行列の特性と、その応用例が数多く紹介されています。
参照
参考文献 ^ バシレフスキー、アレクサンダー (2005). 統計科学における応用行列代数. ドーバー. pp. 160– 176. ISBN 0-486-44538-0 。 ^ 「データ同化:データ同化システムの観測影響診断」 (PDF) 。2014年9月3日時点のオリジナル (PDF) からアーカイブ。 ^ ab Hoaglin, David C.; Welsch, Roy E. (1978年2月). 「回帰分析と分散分析におけるハット行列」 (PDF) . The American Statistician . 32 (1): 17– 22. doi :10.2307/2683469. hdl : 1721.1/1920 . JSTOR 2683469. ^ abc David A. Freedman (2009). 統計モデル:理論と実践 . ケンブリッジ大学出版局 . ^ Gans, P. (1992). 化学科学におけるデータフィッティング . Wiley. ISBN 0-471-93412-7 。 ^ Draper, NR; Smith, H. (1998). 応用回帰分析 . Wiley. ISBN 0-471-17082-8 。 ^ 雨宮毅 (1985). 『上級計量経済学 』 ケンブリッジ: ハーバード大学出版局. pp. 460–461. ISBN 0-674-00560-0 。 ^ 「線形回帰における「ハット」行列のトレースがXのランクであることの証明」。Stack Exchange 。2017年4月13日。 ^ ラオ、C. ラダクリシュナ;トウテンブルク、ヘルゲ。シャラブ。ヒューマン、クリスチャン (2008)。 線形モデルと一般化 (第 3 版)。ベルリン:シュプリンガー。 p. 323.ISBN 978-3-540-74226-5 。