Bukti bahwa F-statistik mengikuti distribusi-F


20

Mengingat pertanyaan ini: Bukti bahwa koefisien dalam model OLS mengikuti distribusi-t dengan derajat kebebasan (nk)

Saya ingin sekali memahami alasannya

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

di mana p adalah jumlah parameter model dan n jumlah observasi dan TSS total varians, RSS varian residual, mengikuti Fp−1,n−p distribusi.

Saya harus mengakui bahwa saya bahkan belum berusaha membuktikannya karena saya tidak tahu harus mulai dari mana.


Christoph Hanck dan Francis sudah memberikan jawaban yang sangat bagus. Jika Anda masih mengalami kesulitan dalam memahami bukti uji f untuk regresi linier, cobalah untuk checkout teamdable.github.io/techblog/… . Saya menulis posting blog tentang bukti kaki untuk regresi linier. Itu ditulis dalam bahasa Korea tetapi mungkin tidak menjadi masalah karena hampir semuanya adalah rumus matematika. Saya harap ini akan membantu jika Anda masih mengalami kesulitan dalam memahami bukti uji f untuk regresi linier.
— Taeho Oh

Meskipun tautan ini dapat menjawab pertanyaan, lebih baik untuk memasukkan bagian-bagian penting dari jawaban di sini dan memberikan tautan untuk referensi. Jawaban hanya tautan dapat menjadi tidak valid jika halaman tertaut berubah. - Dari Ulasan
— mkt - Reinstate Monica

Jawaban:


19

Mari kita tunjukkan hasil untuk kasus umum di mana rumus Anda untuk statistik uji adalah kasus khusus. Secara umum, kita perlu memverifikasi bahwa statistik dapat, sesuai dengan karakterisasi distribusi F , ditulis sebagai rasio independen χ2 rvs dibagi dengan derajat kebebasan mereka.

Misalkan H0:R′β=r dengan R dan r diketahui, nonrandom dan R:k×q memiliki peringkat kolom penuh q . Ini merupakan q pembatasan linear untuk (tidak seperti di notasi Ops) k regressors termasuk istilah konstan. Jadi, dalam contoh @ user1627466, p−1 berhubungan dengan pembatasan q=k−1 untuk mengatur semua koefisien kemiringan ke nol.

Dalam pandangan Var(β^ols)=σ2(X′X)−1 , kita memiliki

R′(β^ols−β)∼N(0,σ2R′(X′X)−1R),
sehingga (dengan B−1/2={R′(X′X)−1R}−1/2 menjadi "matriks persegi root" dariB−1={R′(X′X)−1R}−1 , melalui, misalnya, dekomposisi Cholesky)
n:=B−1/2σR′(β^ols−β)∼N(0,Iq),
sebagai
Var(n)=B−1/2σR′Var(β^ols)RB−1/2σ=B−1/2σσ2BB−1/2σ=I
mana baris kedua menggunakan varians dari OLSE,

Ini, seperti yang ditunjukkan pada jawaban yang Anda link ke (lihat juga di sini ), adalah independen dari

d:=(n−k)σ^2σ2∼χn−k2,
di mana σ 2=y'MXy/(n-k)adalah biasa berisi estimasi error varians, denganMX=I-X(X'X)-1X'adalah yang "residual pembuat matriks" dari kemunduran padaX.σ^2=y′MXy/(n−k)MX=I−X(X′X)−1X′X

Jadi, karena n′n adalah bentuk kuadrat dalam normals,

n′n⏞∼χq2/qd/(n−k)=(β^ols−β)′R{R′(X′X)−1R}−1R′(β^ols−β)/qσ^2∼Fq,n−k.
Secara khusus, di bawahH0:R′β=r, ini untuk mengurangi statistik
F=(R′β^ols−r)′{R′(X′X)−1R}−1(R′β^ols−r)/qσ^2∼Fq,n−k.

For illustration, consider the special case R′=I, r=0, q=2, σ^2=1 and X′X=I. Then,

F=β^ols′β^ols/2=β^ols,12+β^ols,222,
jarak Euclidean kuadrat dari OLS memperkirakan dari asal distandarisasi dengan jumlah elemen - menyoroti bahwa, sejakβ2ols,2dikuadratkan normals standar dan karenanyaχ21, yangFdistribusi dapat dilihat sebagai "rata-rataχ2distribusi.β^ols,22χ12Fχ2

Jika Anda lebih suka simulasi kecil (yang tentu saja bukan bukti!), Di mana nol diuji bahwa tidak ada k regressor yang penting - yang memang tidak, sehingga kami mensimulasikan distribusi nol.

enter image description here

Kami melihat kesepakatan yang sangat baik antara kerapatan teoritis dan histogram statistik uji Monte Carlo.

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")

Untuk melihat bahwa versi statistik uji dalam pertanyaan dan jawabannya memang setara, perhatikan bahwa nol sesuai dengan batasan R′=[0I] danr=0 .

Misalkan 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.
Dengan menggunakan situs kami, Anda mengakui telah membaca dan memahami Kebijakan Cookie dan Kebijakan Privasi kami.
Licensed under cc by-sa 3.0 with attribution required.