koşullu OLS tahmincisinin


17

Bunu biliyorum ^ β 0 = ˉ y - ^ β 1 ˉ x

β0^=y¯−β1^x¯
ve bu ı varyans hesaplanan zaman var ne kadar geçerli:

V a r ( ^ β 0 )= V a r ( ˉ y - ^ β 1 ˉ x )= V a r ( ( - ˉ x ) ^ β 1 + ˉ y )=Var((−ˉx)^β1)+Var(ˉy)=(−ˉx)2Var(^β1)+0=(ˉx)2Var(^β1)+0=σ2(ˉx)2n ∑ i = 1 (xi- ˉ x )2

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¯)2∑i=1n(xi−x¯)2

ama bu benim sahip olduğum kadar uzak. Hesaplamaya çalıştığım son formül

V a r ( ^ β 0 )= σ 2 n - 1 n ∑ i = 1 x 2 in ∑ i = 1 (xi- ˉ x )2

Var(β0^)=σ2n−1∑i=1nx2i∑i=1n(xi−x¯)2

Nasıl alınacağından emin değilim ( ˉ x ) 2 = 1n n Σ i = 1 x 2 i

(x¯)2=1n∑i=1nx2i
matematik orada doğru yukarı olduğunu varsayarak.

Bu doğru yol mu?

( ˉ x ) 2= ( 1nn∑i=1xi)2=1n2(n∑i=1xi)2

(x¯)2=(1n∑i=1nxi)2=1n2(∑i=1nxi)2

I'm sure it's simple, so the answer can wait for a bit if someone has a hint to push me in the right direction.


2
This is not the right path. The 4th equation doesn't hold. For example, with x1=−1x1=−1, x2=0x2=0, and x3=1x3=1, the left term is zero, whilst the right term is 2/32/3. The problem comes from the step where you split the variance (3rd line of second equation). See why?
— QuantIbex

Hint towards Quantlbex point: variance is not a linear function. It violates both additivity and scalar multiplication.
— David Marx

@DavidMarx That step should be =Var((−ˉx)^β1+ˉy)=(ˉx)2Var(^β1)+ˉy
=Var((−x¯)β1^+y¯)=(x¯)2Var(β1^)+y¯
, I think, and then once I substitute in for ^β1β1^ and ˉyy¯ (not sure what to do for this but I'll think about it more), that should put me on the right path I hope.
— M T

This is not correct. Think about the condition required for the variance of a sum to be equal to the sum of the variances.
— QuantIbex

2
No, ˉyy¯ is random since yi=β0+β1xi+ϵyi=β0+β1xi+ϵ, where ϵϵ denotes the (random) noise. But OK, my previous comment was maybe misleading. Also, Var(aX+b)=a2Var(X)Var(aX+b)=a2Var(X), if aa and bb denote constants.
— QuantIbex

Yanıtlar:


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 ˆβ0=ˉy−ˆβ1ˉx,ˆβ1=∑ni=1(xi−ˉx)yi∑ni=1(xi−ˉx)2.

β^0β^1=y¯−β^1x¯,=∑ni=1(xi−x¯)yi∑ni=1(xi−x¯)2.
To get the variance of ˆβ0β^0, start from its expression and substitute the expression of ˆβ1β^1, and do the algebra Var(ˆβ0)=Var(ˉY−ˆβ1ˉx)=…
Var(β^0)=Var(Y¯−β^1x¯)=…

Edit:
We have Var(ˆβ0)=Var(ˉY−ˆβ1ˉx)=Var(ˉY)+(ˉx)2Var(ˆβ1)−2ˉxCov(ˉY,ˆβ1).

Var(β^0)=Var(Y¯−β^1x¯)=Var(Y¯)+(x¯)2Var(β^1)−2x¯Cov(Y¯,β^1).
The two variance terms are Var(ˉY)=Var(1nn∑i=1Yi)=1n2n∑i=1Var(Yi)=σ2n,
Var(Y¯)=Var(1n∑i=1nYi)=1n2∑i=1nVar(Yi)=σ2n,
and Var(ˆβ1)=1[∑ni=1(xi−ˉx)2]2n∑i=1(xi−ˉx)2Var(Yi)=σ2∑ni=1(xi−ˉx)2,
Var(β^1)=1[∑ni=1(xi−x¯)2]2∑i=1n(xi−x¯)2Var(Yi)=σ2∑ni=1(xi−x¯)2,
and the covariance term is Cov(ˉY,ˆβ1)=Cov{1nn∑i=1Yi,∑nj=1(xj−ˉx)Yj∑ni=1(xi−ˉx)2}=1n1∑ni=1(xi−ˉx)2Cov{n∑i=1Yi,n∑j=1(xj−ˉx)Yj}=1n∑ni=1(xi−ˉx)2n∑i=1(xj−ˉx)n∑j=1Cov(Yi,Yj)=1n∑ni=1(xi−ˉx)2n∑i=1(xj−ˉx)σ2=0
Cov(Y¯,β^1)=Cov{1n∑i=1nYi,∑nj=1(xj−x¯)Yj∑ni=1(xi−x¯)2}=1n1∑ni=1(xi−x¯)2Cov{∑i=1nYi,∑j=1n(xj−x¯)Yj}=1n∑ni=1(xi−x¯)2∑i=1n(xj−x¯)∑j=1nCov(Yi,Yj)=1n∑ni=1(xi−x¯)2∑i=1n(xj−x¯)σ2=0
since ∑ni=1(xj−ˉx)=0∑ni=1(xj−x¯)=0.
And since n∑i=1(xi−ˉx)2=n∑i=1x2i−2ˉxn∑i=1xi+n∑i=1ˉx2=n∑i=1x2i−nˉx2,
∑i=1n(xi−x¯)2=∑i=1nx2i−2x¯∑i=1nxi+∑i=1nx¯2=∑i=1nx2i−nx¯2,
we have Var(ˆβ0)=σ2n+σ2ˉx2∑ni=1(xi−ˉx)2=σ2n∑ni=1(xi−ˉx)2{n∑i=1(xi−ˉx)2+nˉx2}=σ2∑ni=1x2in∑ni=1(xi−ˉx)2.
Var(β^0)=σ2n+σ2x¯2∑ni=1(xi−x¯)2=σ2n∑ni=1(xi−x¯)2{∑i=1n(xi−x¯)2+nx¯2}=σ2∑ni=1x2in∑ni=1(xi−x¯)2.

Edit 2

Why do we have var(∑ni=1Yi)=∑ni=1Var(Yi)var(∑ni=1Yi)=∑ni=1Var(Yi)?

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

Once we have a sample, the XiXi are known, the only random terms are the ϵiϵi. Recalling that for a random variable ZZ and a constant aa, we have var(a+Z)=var(Z)var(a+Z)=var(Z). Thus, var(n∑i=1Yi)=var(n∑i=1β0+β1Xi+ϵi)=var(n∑i=1ϵi)=n∑i=1n∑j=1cov(ϵi,ϵj)=n∑i=1cov(ϵi,ϵi)=n∑i=1var(ϵi)=n∑i=1var(β0+β1Xi+ϵi)=n∑i=1var(Yi).

var(∑i=1nYi)=var(∑i=1nβ0+β1Xi+ϵi)=var(∑i=1nϵi)=∑i=1n∑j=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)=0cov(ϵi,ϵj)=0 for i≠ji≠j by the independence of the ϵiϵ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(1nn∑i=1Yi)=1n2n∑i=1Var(Yi)
Var(Y¯)=Var(1n∑i=1nYi)=1n2∑i=1nVar(Yi)
because since the XiXi are independent, this implies that the YiYi are independent as well, right?
— M T

Also, you can factor out a constant from the covariance in this step: 1n1∑ni=1(xi−ˉx)2Cov{n∑i=1Yi,n∑j=1(xj−ˉx)Yj}
1n1∑ni=1(xi−x¯)2Cov{∑i=1nYi,∑j=1n(xj−x¯)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 nn terms that are identical (and equal to σ2σ2), so the numerator is nσ2nσ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)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=n∑i=1(xi−ˉx)2,

SSTx=∑i=1n(xi−x¯)2,
and uiui is the error term.

1) Show that ˆβ1β^1 can be written as ˆβ1=β1+n∑i=1wiuiβ^1=β1+∑i=1nwiui where wi=diSSTxwi=diSSTx and di=xi−ˉxdi=xi−x¯.

This was easy because we know that

ˆβ1=β1+n∑i=1(xi−ˉx)uiSSTx=β1+n∑i=1diSSTxui=β1+n∑i=1wiui

β^1=β1+∑i=1n(xi−x¯)uiSSTx=β1+∑i=1ndiSSTxui=β1+∑i=1nwiui

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

E[(^β1−β1)ˉu]=E[ˉun∑i=1wiui]=n∑i=1E[wiˉuui]=n∑i=1wiE[ˉuui]=1nn∑i=1wiE(uin∑j=1uj)=1nn∑i=1wi[E(uiu1)+⋯+E(uiuj)+⋯+E(uiun)]

E[(β1^−β1)u¯]=E[u¯∑i=1nwiui]=∑i=1nE[wiu¯ui]=∑i=1nwiE[u¯ui]=1n∑i=1nwiE(ui∑j=1nuj)=1n∑i=1nwi[E(uiu1)+⋯+E(uiuj)+⋯+E(uiun)]

and because the uu are i.i.d., E(uiuj)=E(ui)E(uj)E(uiuj)=E(ui)E(uj) when j≠ij≠i.

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

=1nn∑i=1wi[E(ui)E(u1)+⋯+E(u2i)+⋯+E(ui)E(un)]=1nn∑i=1wiE(u2i)=1nn∑i=1wi[Var(ui)+E(ui)E(ui)]=1nn∑i=1wiσ2=σ2nn∑i=1wi=σ2n⋅SSTxn∑i=1(xi−ˉx)=σ2n⋅SSTx(0)=0

=1n∑i=1nwi[E(ui)E(u1)+⋯+E(u2i)+⋯+E(ui)E(un)]=1n∑i=1nwiE(u2i)=1n∑i=1nwi[Var(ui)+E(ui)E(ui)]=1n∑i=1nwiσ2=σ2n∑i=1nwi=σ2n⋅SSTx∑i=1n(xi−x¯)=σ2n⋅SSTx(0)=0

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

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

β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)2SSTxVar(β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.

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 ˉuu¯ and ^β1−β1β1^−β1 are uncorrelated, the covariance between them is zero, so the variance of the sum is the sum of the variance. β0β0 is just a constant, so it drops out, as does β1β1 later in the calculations.

5) Use algebra and the fact that SSTxn=1nn∑i=1x2i−(ˉx)2SSTxn=1n∑i=1nx2i−(x¯)2:

Var(^β0)=σ2n+σ2(ˉx)2SSTx=σ2SSTxSSTxn+σ2(ˉx)2SSTx=σ2SSTx(1nn∑i=1x2i−(ˉx)2)+σ2(ˉx)2SSTx=σ2n−1n∑i=1x2iSSTx

Var(β0^)=σ2n+σ2(x¯)2SSTx=σ2SSTxSSTxn+σ2(x¯)2SSTx=σ2SSTx(1n∑i=1nx2i−(x¯)2)+σ2(x¯)2SSTx=σ2n−1∑i=1nx2iSSTx

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

You might want to clarify notations, and specify what uiui and SSTxSSTx are.
— QuantIbex

uiui is the error term and SSTxSSTx is the total sum of squares for xx (defined in the edit).
— M T

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

1
In point 2, you can't take ˉuu¯ out of the expectation, it's not a constant.
— QuantIbex
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.