Jak obliczyć wariancję estymatora OLS


17

Wiem, że

β0^=y¯β1^x¯
i oto, jak daleko doszedłem, kiedy obliczyłem wariancję:

Var(β0^)=Var(y¯β1^x¯)=Var((x¯)β1^+y¯)=Var((x¯)β1^)+Var(y¯)=(x¯)2Var(β1^)+0=(x¯)2Var(β1^)+0=σ2(x¯)2i=1n(xix¯)2

ale to daleko, jak mam. Ostateczna formuła, którą próbuję obliczyć, to

Var(β0^)=σ2n1i=1nxi2i=1n(xix¯)2

Nie jestem pewien, jak uzyskać

(x¯)2=1ni=1nxi2
zakładam, że moja matematyka jest poprawna do tego momentu.

Czy to właściwa ścieżka?

(x¯)2=(1ni=1nxi)2=1n2(i=1nxi)2

Jestem pewien, że to proste, więc odpowiedź może chwilę poczekać, jeśli ktoś ma wskazówkę, która popchnie mnie we właściwym kierunku.


2
To nie jest właściwa ścieżka. Czwarte równanie nie ma zastosowania. Na przykład, , x 2 = 0 i x 3 = 1 , lewa termin wynosi zero, podczas gdy prawo termin jest 2 / 3 . Problem pochodzi z etapu podziału wariancji (3. linia drugiego równania). Rozumiesz dlaczego x1=1x2=0x3=12/3
QuantIbex

Wskazówka do punktu Quantlbex: wariancja nie jest funkcją liniową. Narusza to zarówno addytywność, jak i mnożenie skalarne.
David Marx,

@DavidMarx Ten krok powinien być , tak myślę, a potem raz podstawię o ^ β 1 i ˉ Y
=Var((x¯)β1^+y¯)=(x¯)2Var(β1^)+y¯
β1^y¯ (nie wiem, co zrobić z tym, ale ja myślę o tym więcej), że powinien umieścić mnie na właściwą drogę mam nadzieję.
P

To nie jest poprawne. Pomyśl o warunku wymaganym, aby wariancja sumy była równa sumie wariancji.
QuantIbex

2
Nie, jest losowe, ponieważ y i = β 0 + β 1 x i + ϵ , gdzie ϵ oznacza (losowy) szum. Ale OK, mój poprzedni komentarz mógł być mylący. Ponadto, V a r ( a X + b ) = a 2 V a r ( X ) , jeśli a i b oznaczają stałe. y¯yi=β0+β1xi+ϵϵVar(aX+b)=a2Var(X)ab
QuantIbex

Odpowiedzi:


19

This is a self-study question, so I provide hints that will hopefully help to find the solution, and I'll edit the answer based on your feedbacks/progress.

The parameter estimates that minimize the sum of squares are Aby uzyskać wariancjiP0, zacznij od jego ekspresji i zastąpić ekspresjębeta1i zrobić algebry VdoR(β0)=VdoR(¯Y-β1ˉx)=...

β^0=y¯β^1x¯,β^1=i=1n(xix¯)yii=1n(xix¯)2.
β^0β^1
Var(β^0)=Var(Y¯β^1x¯)=

Edycja:
Mamy

Var(β^0)=Var(Y¯β^1x¯)=Var(Y¯)+(x¯)2Var(β^1)2x¯Cov(Y¯,β^1).
The two variance terms are
Var(Y¯)=Var(1ni=1nYi)=1n2i=1nVar(Yi)=σ2n,
and
Var(β^1)=1[i=1n(xix¯)2]2i=1n(xix¯)2Var(Yi)=σ2i=1n(xix¯)2,
and the covariance term is
Cov(Y¯,β^1)=Cov{1ni=1nYi,j=1n(xjx¯)Yji=1n(xix¯)2}=1n1i=1n(xix¯)2Cov{i=1nYi,j=1n(xjx¯)Yj}=1ni=1n(xix¯)2i=1n(xjx¯)j=1nCov(Yi,Yj)=1ni=1n(xix¯)2i=1n(xjx¯)σ2=0
since i=1n(xjx¯)=0.
And since
i=1n(xix¯)2=i=1nxi22x¯i=1nxi+i=1nx¯2=i=1nxi2nx¯2,
we have
Var(β^0)=σ2n+σ2x¯2i=1n(xix¯)2=σ2ni=1n(xix¯)2{i=1n(xix¯)2+nx¯2}=σ2i=1nxi2ni=1n(xix¯)2.

Edit 2

Why do we have var(i=1nYi)=i=1nVar(Yi)?

The assumed model is Yi=β0+β1Xi+ϵi, where the ϵi are independant and identically distributed random variables with E(ϵi)=0 and var(ϵi)=σ2.

Once we have a sample, the Xi are known, the only random terms are the ϵi. Recalling that for a random variable Z and a constant a, we have var(a+Z)=var(Z). Thus,

var(i=1nYi)=var(i=1nβ0+β1Xi+ϵi)=var(i=1nϵi)=i=1nj=1ncov(ϵi,ϵj)=i=1ncov(ϵi,ϵi)=i=1nvar(ϵi)=i=1nvar(β0+β1Xi+ϵi)=i=1nvar(Yi).
The 4th equality holds as cov(ϵi,ϵj)=0 for ij by the independence of the ϵi.

I think I got it! The book has suggested steps, and I was able to prove each step separately (I think). It's not as satisfying as just sitting down and grinding it out from this step, since I had to prove intermediate conclusions for it to help, but I think everything looks good.
M T

See edit for the development of the suggested approach.
QuantIbex

The variance of the sum equals the sum of the variances in this step:
Var(Y¯)=Var(1ni=1nYi)=1n2i=1nVar(Yi)
because since the Xi are independent, this implies that the Yi are independent as well, right?
M T

Also, you can factor out a constant from the covariance in this step:
1n1i=1n(xix¯)2Cov{i=1nYi,j=1n(xjx¯)Yj}
even though it's not in both elements because the formula for covariance is multiplicative, right?
M T

1
@oort, in the numerator you have the sum of n terms that are identical (and equal to σ2), so the numerator is nσ2.
QuantIbex

1

I got it! Well, with help. I found the part of the book that gives steps to work through when proving the Var(β^0) formula (thankfully it doesn't actually work them out, otherwise I'd be tempted to not actually do the proof). I proved each separate step, and I think it worked.

I'm using the book's notation, which is:

SSTx=i=1n(xix¯)2,
and ui is the error term.

1) Show that β^1 can be written as β^1=β1+i=1nwiui where wi=diSSTx and di=xix¯.

This was easy because we know that

β^1=β1+i=1n(xix¯)uiSSTx=β1+i=1ndiSSTxui=β1+i=1nwiui

2) Use part 1, along with i=1nwi=0 to show that β1^ and u¯ are uncorrelated, i.e. show that E[(β1^β1)u¯]=0.

E[(β1^β1)u¯]=E[u¯i=1nwiui]=i=1nE[wiu¯ui]=i=1nwiE[u¯ui]=1ni=1nwiE(uij=1nuj)=1ni=1nwi[E(uiu1)++E(uiuj)++E(uiun)]

and because the u are i.i.d., E(uiuj)=E(ui)E(uj) when ji.

When j=i, E(uiuj)=E(ui2), so we have:

=1ni=1nwi[E(ui)E(u1)++E(ui2)++E(ui)E(un)]=1ni=1nwiE(ui2)=1ni=1nwi[Var(ui)+E(ui)E(ui)]=1ni=1nwiσ2=σ2ni=1nwi=σ2nSSTxi=1n(xix¯)=σ2nSSTx(0)=0

3) Show that β0^ can be written as β0^=β0+u¯x¯(β1^β1). This seemed pretty easy too:

β0^=y¯β1^x¯=(β0+β1x¯+u¯)β1^x¯=β0+u¯x¯(β1^β1).

4) Use parts 2 and 3 to show that Var(β0^)=σ2n+σ2(x¯)2SSTx:

Var(β0^)=Var(β0+u¯x¯(β1^β1))=Var(u¯)+(x¯)2Var(β1^β1)=σ2n+(x¯)2Var(β1^)=σ2n+σ2(x¯)2SSTx.

I believe this all works because since we provided that u¯ and β1^β1 are uncorrelated, the covariance between them is zero, so the variance of the sum is the sum of the variance. β0 is just a constant, so it drops out, as does β1 later in the calculations.

5) Use algebra and the fact that SSTxn=1ni=1nxi2(x¯)2:

Var(β0^)=σ2n+σ2(x¯)2SSTx=σ2SSTxSSTxn+σ2(x¯)2SSTx=σ2SSTx(1ni=1nxi2(x¯)2)+σ2(x¯)2SSTx=σ2n1i=1nxi2SSTx

There might be a typo in point 1; I think var(β^) should read β^.
QuantIbex

You might want to clarify notations, and specify what ui and SSTx are.
QuantIbex

ui is the error term and SSTx is the total sum of squares for x (defined in the edit).
M T

1
In point 1, the term β1 is missing in the last two lines.
QuantIbex

1
In point 2, you can't take u¯ out of the expectation, it's not a constant.
QuantIbex
Korzystając z naszej strony potwierdzasz, że przeczytałeś(-aś) i rozumiesz nasze zasady używania plików cookie i zasady ochrony prywatności.
Licensed under cc by-sa 3.0 with attribution required.