F istatistiğinin F dağılımını izlediğinin kanıtı


20

Bu sorunun ışığında: OLS modelindeki katsayıların (nk) serbestlik derecesine sahip bir t dağılımını izlediğinin kanıtı

Nedenini anlamak isterim

F=(TSS−RSS)/(p−1)RSS/(n−p),

burada p model parametrelerinin bir sayı olmaktadır ve n gözlem sayısı ve TSS toplam varyans, RSS kalıntı varyans, bir aşağıda Fp−1,n−p dağılımı.

İtiraf etmeliyim ki, nereden başlayacağımı bilemeyeceğim için bunu kanıtlamaya bile çalışmadım.


Christoph Hanck ve Francis çok iyi bir cevap verdiler. Doğrusal regresyon için f testinin kanıtını anlamakta hala zorluk yaşıyorsanız, teamdable.github.io/techblog/… ' dan ödeme yapmayı deneyin . Doğrusal regresyon için yapılan kanıtın kanıtıyla ilgili blog yazısını yazdım. Korece yazılmıştır, ancak sorun olmayabilir çünkü neredeyse hepsi matematik formülüdür. Umarım doğrusal regresyon için f testinin kanıtını anlamada hala zorluklarınız varsa yardımcı olur.
— Taeho Oh

Bu bağlantı soruyu cevaplayabilse de, cevabın temel kısımlarını buraya eklemek ve bağlantıyı referans olarak sağlamak daha iyidir. Bağlantı verilen sayfa değişirse, yalnızca bağlantı yanıtları geçersiz olabilir. - Yorumdan
— mkt - Reinstate Monica

Yanıtlar:


19

Test istatistiği için formülünüzün özel bir durum olduğu genel durumun sonucunu gösterelim. Genel olarak, istatistiğin , F dağılımının karakterizasyonuna göre , bağımsız χ2 rvs oranının serbestlik derecelerine bölünmesiyle yazılabileceğini doğrulamamız gerekir .

Let H0:R′β=r ile R ve r bilinen rastgele olmayan ve R:k×q tam kolon sıralaması vardır q . Bu , sabit terimi içeren (regüler gösterimin aksine) k regresörleri için q doğrusal kısıtlamayı temsil eder . Yani, @ user1627466 örneğinde, p - 1 , tüm eğim katsayılarını sıfıra ayarlamak için q = k - 1 kısıtlamalarına karşılık gelir .kp−1q=k−1

Görünümünde Var(β^ols)=σ2(X′X)−1 , elimizdeki

R′(β^ols−β)∼N(0,σ2R′(X′X)−1R),
ki (o kadarB-1/2={R' ( X ' X ) - 1 R } - 1 / 2 , B - 1'in bir "matris kare kökü" dir = { R ′B−1/2={R′(X′X)−1R}−1/2B−1={R′(X′X)−1R}−1 , ile, örneğin bir Choleskey ayrışma)
n:=B−1/2σR′(β^ols−β)∼N(0,Iq),
olarak
Var(n)=B−1/2σR′Var(β^ols)RB−1/2σ=B−1/2σσ2BB−1/2σ=I
burada ikinci satır OLSE varyansını kullanır.

Bu gösterildiği gibi bağlanmak Bu cevap (ayrıca bkz burada ), bağımsız

d:=(n−k)σ^2σ2∼χn−k2,
burada σ 2=Y'EX-Y/(n-k)her zamanki tarafsız hata varyans tahminidir,M, X=I-X(X'X)-1x'olduğuXüzerinde gerilemeden "artık yapıcı matrisi".σ^2=y′MXy/(n−k)MX=I−X(X′X)−1X′X

Bu nedenle, n′n normallerde ikinci dereceden bir form olduğundan,

n′n⏞∼χq2/qd/(n−k)=(β^ols−β)′R{R′(X′X)−1R}−1R′(β^ols−β)/qσ^2∼Fq,n−k.
Özel olarak, altH0:R′β=r, bu istatistik, azaltır
F=(R′β^ols−r)′{R′(X′X)−1R}−1(R′β^ols−r)/qσ^2∼Fq,n−k.

R′=Ir=0q=2σ^2=1X′X=I

F=β^ols′β^ols/2=β^ols,12+β^ols,222,
çünkü, bu altını - OLS karesi bir Öklid mesafe elemanı sayısı ile standart kökenli tahminβ2ols,2standart normalleri kareleri alınır ve dolayısıylaχ21,Fdağılımı, "ortalama olarak görülebilirχ2dağıtım.β^ols,22χ12Fχ2

Eğer biraz simülasyon tercih ettiği boş hiçbiri bu test edilir (ders kanıtı değildir!) k madde regresörler - onlar gerçekten, yapma biz sıfır dağılımı simüle böylece.

enter image description here

Monte Carlo test istatistiklerinin teorik yoğunluğu ve histogramı arasında çok iyi bir uyum olduğunu görüyoruz.

library(lmtest)
n <- 100
reps <- 20000
sloperegs <- 5 # number of slope regressors, q or k-1 (minus the constant) in the above notation
critical.value <- qf(p = .95, df1 = sloperegs, df2 = n-sloperegs-1) 
# for the null that none of the slope regrssors matter

Fstat <- rep(NA,reps)
for (i in 1:reps){
  y <- rnorm(n)
  X <- matrix(rnorm(n*sloperegs), ncol=sloperegs)
  reg <- lm(y~X)
  Fstat[i] <- waldtest(reg, test="F")$F[2] 
}

mean(Fstat>critical.value) # very close to 0.05

hist(Fstat, breaks = 60, col="lightblue", freq = F, xlim=c(0,4))
x <- seq(0,6,by=.1)
lines(x, df(x, df1 = sloperegs, df2 = n-sloperegs-1), lwd=2, col="purple")

Soru ve cevaptaki test istatistiklerinin sürümlerinin gerçekten eşdeğer olduğunu görmek için null değerinin kısıtlamalarına karşılık geldiğine dikkat edin.R′=[0I]r=0

X=[X1X2] be partitioned according to which coefficients are restricted to be zero under the null (in your case, all but the constant, but the derivation to follow is general). Also, let β^ols=(β^ols,1′,β^ols,2′)′ be the suitably partitioned OLS estimate.

Then,

R′β^ols=β^ols,2
and
R′(X′X)−1R≡D~,
the lower right block of
(XTX)−1=(X1′X1X1′X2X2′X1X2′X2)−1≡(A~B~C~D~)
Now, use results for partitioned inverses to obtain
D~=(X2′X2−X2′X1(X1′X1)−1X1′X2)−1=(X2′MX1X2)−1
where MX1=I−X1(X1′X1)−1X1′.

Thus, the numerator of the F statistic becomes (without the division by q)

Fnum=β^ols,2′(X2′MX1X2)β^ols,2
Next, recall that by the Frisch-Waugh-Lovell theorem we may write
β^ols,2=(X2′MX1X2)−1X2′MX1y
so that
Fnum=y′MX1X2(X2′MX1X2)−1(X2′MX1X2)(X2′MX1X2)−1X2′MX1y=y′MX1X2(X2′MX1X2)−1X2′MX1y

It remains to show that this numerator is identical to USSR−RSSR, the difference in unrestricted and restricted sum of squared residuals.

Here,

RSSR=y′MX1y
is the residual sum of squares from regressing y on X1, i.e., with H0 imposed. In your special case, this is just TSS=∑i(yi−y¯)2, the residuals of a regression on a constant.

Again using FWL (which also shows that the residuals of the two approaches are identical), we can write USSR (SSR in your notation) as the SSR of the regression

MX1yonMX1X2

That is,

USSR=y′MX1′MMX1X2MX1y=y′MX1′(I−PMX1X2)MX1y=y′MX1y−y′MX1MX1X2((MX1X2)′MX1X2)−1(MX1X2)′MX1y=y′MX1y−y′MX1X2(X2′MX1X2)−1X2′MX1y

Thus,

RSSR−USSR=y′MX1y−(y′MX1y−y′MX1X2(X2′MX1X2)−1X2′MX1y)=y′MX1X2(X2′MX1X2)−1X2′MX1y


Thanks. I don't know if it's considered hand holding at this point but how do you go from your sum of squared betas to an expression that contains sum of squares?
— user1627466

1
@user1627466, I added a derivation of the equivalence of the two formulae.
— Christoph Hanck

4

@ChristophHanck has provided a very comprehensive answer, here I will add a sketch of proof on the special case OP mentioned. Hopefully it's also easier to follow for beginners.

A random variable Y∼Fd1,d2 if

Y=X1/d1X2/d2,
where X1∼χd12 and X2∼χd22 are independent. Thus, to show that the F-statistic has F-distribution, we may as well show that cESS∼χp−12 and cRSS∼χn−p2 for some constant c, and that they are independent.

In OLS model we write

y=Xβ+ε,
where X is a n×p matrix, and ideally ε∼Nn(0,σ2I). For convenience we introduce the hat matrix H=X(XTX)−1XT (note y^=Hy), and the residual maker M=I−H. Important properties of H and M are that they are both symmetric and idempotent. In addition, we have tr⁡(H)=p and HX=X, these will come in handy later.

Let us denote the matrix of all ones as J, the sum of squares can then be expressed with quadratic forms:

TSS=yT(I−1nJ)y,RSS=yTMy,ESS=yT(H−1nJ)y.
Note that M+(H−J/n)+J/n=I. One can verify that J/n is idempotent and rank⁡(M)+rank⁡(H−J/n)+rank⁡(J/n)=n. It follows from this then that H−J/n is also idempotent and M(H−J/n)=0.

We can now set out to show that F-statistic has F-distribution (search Cochran's theorem for more). Here we need two facts:

  1. Let x∼Nn(μ,Σ). Suppose A is symmetric with rank r and AΣ is idempotent, then xTAx∼χr2(μTAμ/2), i.e. non-central χ2 with d.f. r and non-centrality μTAμ/2. This is a special case of Baldessari's result, a proof can also be found here.
  2. Let x∼Nn(μ,Σ). If AΣB=0, then xTAx and xTBx are independent. This is known as Craig's theorem.

Since y∼Nn(Xβ,σ2I), we have

ESSσ2=(yσ)T(H−1nJ)yσ∼χp−12((Xβ)T(H−Jn)Xβ).
However, under null hypothesis β=0, so really ESS/σ2∼χp−12. On the other hand, note that yTMy=εTMε since HX=X. Therefore RSS/σ2∼χn−p2. Since M(H−J/n)=0, ESS/σ2 and RSS/σ2 are also independent. It immediately follows then
F=(TSS−RSS)/(p−1)RSS/(n−p)=ESSσ2/(p−1)RSSσ2/(n−p)∼Fp−1,n−p.
Sitemizi kullandığınızda şunları okuyup anladığınızı kabul etmiş olursunuz: Çerez Politikası ve Gizlilik Politikası.
Licensed under cc by-sa 3.0 with attribution required.