マハラノビス距離とレバレッジの関係を証明しますか?


12

ウィキペディアで数式を見てきました。マハラノビスの距離とレバレッジを関連付ける:

マハラノビス距離はレバレッジ統計hと密接に関連していますが、スケールは異なります:

D2=(N−1)(h−1N).

ではリンク先の記事、ウィキペディアは説明するhこれらの用語には:

線形回帰モデルでは、のためにレバレッジスコアithデータユニットは、次のように定義される:

hii=(H)ii,
ithハット行列の対角要素H=X(X⊤X)−1X⊤、⊤は行列転置を表します。⊤

どこにも証拠が見つかりません。定義から始めようとしましたが、何も進展しません。誰でもヒントを与えることができますか?

回答:


11

マハラノビス距離の下部から上部への説明でのマハラノビス距離の説明は?2つの主要な結果が含まれます。

  1. 定義上、リグレッサが均一にシフトされても変化しません。

  2. ベクトル間の二乗マハラノビス距離x及びyで与えられる

    D2(x,y)=(x−y)′Σ−1(x−y)
    Σデータの共分散です。

(1)リグレッサの平均がすべてゼロであると仮定することができます。hi計算は残ります。ただし、主張が真実であるためには、もう1つの仮定を追加する必要があります。

モデルにはインターセプトが含まれている必要があります。

これを可能にすることが聞かせてk≥0説明変数とnデータ、リグレッサの値書き込むj観察するためのiのようなxij。リグレッサーjのこれらのn値の列ベクトルをx 、j、観測値iのこれらのk値の行ベクトルと書くjx,jki書き込まれるxi。次に、モデル行列は

X=(1x11⋯x1k1x21⋯x2k⋮⋮⋮⋮1xn1⋯xnk)

そして、定義により、帽子行列は

H=X(X′X)−1X′,

対角線に沿ったエントリiは

(1)hi=hii=(1;xi)(X′X)−1(1;xi)′.

その中心行列を逆にすること以外には何もありませんが、最初の重要な結果のおかげで、特にブロック行列形式で記述する場合は簡単です:

X′X=n(10′0C)

どこ0=(0,0,…,0)′と

Cjk=1n∑i=1nxijxik=n−1nCov⁡(xj,xk)=n−1nΣjk.

(リグレッサのサンプル共分散行列のΣを記述しました。)これはブロック対角であるため、その逆はブロックを反転するだけで簡単に見つけることができます。

(X′X)−1=1n(10′0C−1)=(1n0′01n−1Σ−1).

From the definition (1) we obtain

hi=(1;xi)(1n0′01n−1Σ−1)(1;xi)′=1n+1n−1xiΣ−1xi′=1n+1n−1D2(xi,0).

Solving for the squared Mahalanobis length Di2=D2(xi,0) yields

Di2=(n−1)(hi−1n),

QED.

Looking back, we may trace the additive term 1/n to the presence of an intercept, which introduced the column of ones into the model matrix X. The multiplicative term n−1 appeared after assuming the Mahalanobis distance would be computed using the sample covariance estimate (which divides the sums of squares and products by n−1) rather than the covariance matrix of the data (which divides the sum of squares and products by n).


The chief value of this analysis is to impart a geometric interpretation to the leverage, which measures how much a unit change in the response at observation i will change the fitted value at that observation: high-leverage observations are at large Mahalanobis distances from the centroid of the regressors, exactly as a mechanically efficient lever operates at a large distance from its fulcrum.


R code to show that the relation indeed holds:

x <- mtcars

# Compute Mahalanobis distances
h <- hat(x, intercept = TRUE); names(h) <- rownames(mtcars)
M <- mahalanobis(x, colMeans(x), cov(x))

# Compute D^2 of the question
n <- nrow(x); D2 <- (n-1)*(h - 1/n)

# Compare.
all.equal(M, D2)               # TRUE
print(signif(cbind(M, D2), 3))

Excellent answer, very well rounded with rigor and intuition. Cheers!
— cgrudz

Thanks for the post @whuber ! For sanity check, here is R code to show that the relation indeed holds: x <- mtcars rownames(x) <- NULL colnames(x) <- NULL n <- nrow(x) h <- hat(x, T) mahalanobis(x, colMeans(x), cov(x)) (n-1)*(h - 1/n) all.equal(mahalanobis(x, colMeans(x), cov(x)), (n-1)*(h - 1/n))
— Tal Galili

1
@Tal I didn't think I needed a sanity check--but thank you for the code. :-) I have made modifications to clarify it and its output a little.
— whuber

1
@whuber, I wanted an example that shows how to make the equality works (making clear to me that I got the assumptions right). I've also extended the relevant Wiki entry: en.wikipedia.org/wiki/… (feel free to also expend on it there, as you see fit :) )
— Tal Galili
弊社のサイトを使用することにより、あなたは弊社のクッキーポリシーおよびプライバシーポリシーを読み、理解したものとみなされます。
Licensed under cc by-sa 3.0 with attribution required.