回帰誤差項と説明変数をどのように相関させることができますか?


22

このwikiページの最初の文は、「計量経済学では、説明変数がエラー用語と相関しているときに内生性の問題が発生します。1

私の質問は、これがどのように起こるのかということです。エラー項が設計行列の列空間に直交するように、回帰ベータが選択されていませんか?


9
回帰ベータは、残差が設計行列の列空間に直交するように選択されます。そして、これは、誤差項が設計行列の列空間に直交しない場合、真のベータの恐ろしい推定値を与える可能性があります!(つまり、モデルが回帰により係数を一貫して推定するために必要な仮定を満たさない場合)。
マシューガン

3
誤差項及び計画行列の列空間の直交性がない、あなたの推定方法(例えば、通常の最小二乗回帰)のプロパティ、それはモデルのプロパティである(例えばyi=a+bxi+ϵi)。
マシューガン

あなたが求めているものを大幅に変更したように見えるので、あなたの編集は新しい質問にすべきだと思います。いつでもこのリンクに戻ることができます。(あなたはそれをより良く表現する必要があると思います-あなたが「効果がどうなるか」を書くとき、私はの効果について明確ではありません?)既存のものを編集し直す必要があります。
シルバーフィッシュ

回答:


28

2種類の「エラー」用語を組み合わせています。ウィキペディアには、実際、エラーと残差のこの区別に関する記事があります。

OLS回帰分析では、残差(誤差や外乱の用語の見積もりはε^確かに回帰がインターセプト用語が含まれていると仮定すると、予測変数と相関されることが保証されています。

しかし、「真の」エラーεはそれらと相関している可能性があり、これが内因性と見なされるものです。

物事を単純に保つために、回帰モデルを検討します(これは、基になる「データ生成プロセス」または「DGP」、の値を生成すると仮定する理論モデルとして説明されますy)。

yi=β1+β2xi+εi

原則として、モデルでxと相関させることができない理由はありませんがε、この方法で標準のOLSの仮定に違反しないことを望みます。たとえば、yモデルから省略された別の変数に依存し、これが外乱項に組み込まれている場合があります(εは、yに影響する以外のすべてをひとまとめにする場所です)。この省略された変数がxとも相関している場合、εは次にxと相関し、内因性(特に、省略された変数バイアス)があります。xyxεx

利用可能なデータで回帰モデルを推定すると、

yi=β^1+β^2xi+ε^i

そのためOLS作品*道の、残差εは、無相関されるX。しかし、それは我々が避け内生性を持っているという意味ではありません-私たちは間の相関分析することにより、それを検出することができないということ、それだけで意味ε及びX(数値誤差まで)になり、ゼロ。また、OLSの前提条件に違反しているため、偏りのないなどの優れた特性が保証されなくなり、OLSについて多くを享受しています。当社の推定β 2はバイアスされます。ε^xε^xβ^2


という事実 εが無相関である xは、我々は、係数のための最善の見積りを選択するために使用する「通常の方程式」からすぐに次の。()ε^x

あなたは行列の設定に使用され、私は上記の私の例で使用される二変量モデルに固執していない場合には、残差二乗の総和である及び最適見つけるB 1 = β 1及びB 2 =をS(b1,b2)=i=1nεi2=i=1n(yib1b2xi)2b1=β^1推定切片のため、まず一階条件、我々は通常の方程式を見つけ、これを最小限に抑えること:b2=β^2

Sb1=i=1n2(yib1b2xi)=2i=1nε^i=0

間の共分散についての式に残差の和(ひいては平均)は、ゼロであることを示しε及び任意の変数はX、その後に減少1ε^x。推定勾配の1次条件を考慮すると、これはゼロであることがわかります。1n1i=1nxiε^i

Sb2=i=1n2xi(yib1b2xi)=2i=1nxiε^i=0

If you are used to working with matrices, we can generalise this to multiple regression by defining S(b)=εε=(yXb)(yXb); the first-order condition to minimise S(b) at optimal b=β^ is:

dSdb(β^)=ddb(yybXyyXb+bXXb)|b=β^=2Xy+2XXβ^=2X(yXβ^)=2Xε^=0

This implies each row of X, and hence each column of X, is orthogonal to ε^. Then if the design matrix X has a column of ones (which happens if your model has an intercept term), we must have i=1nε^i=0 so the residuals have zero sum and zero mean. The covariance between ε^ and any variable x is again 1n1i=1nxiε^i and for any variable x included in our model we know this sum is zero, because ε^ is orthogonal to every column of the design matrix. Hence there is zero covariance, and zero correlation, between ε^ and any predictor variable x.

If you prefer a more geometric view of things, our desire that y^ lies as close as possible to y in a Pythagorean kind of way, and the fact that y^ is constrained to the column space of the design matrix X, dictate that y^ should be the orthogonal projection of the observed y onto that column space. Hence the vector of residuals ε^=yy^ is orthogonal to every column of X, including the vector of ones 1n if an intercept term is included in the model. As before, this implies the sum of residuals is zero, whence the residual vector's orthogonality with the other columns of X ensures it is uncorrelated with each of those predictors.

Vectors in subject space of multiple regression

But nothing we have done here says anything about the true errors ε. Assuming there is an intercept term in our model, the residuals ε^ are only uncorrelated with x as a mathematical consequence of the manner in which we chose to estimate regression coefficients β^. The way we selected our β^ affects our predicted values y^ and hence our residuals ε^=yy^. If we choose β^ by OLS, we must solve the normal equations and these enforce that our estimated residuals ε^ are uncorrelated with x. Our choice of β^ affects y^ but not E(y) and hence imposes no conditions on the true errors ε=yE(y). It would be a mistake to think that ε^ has somehow "inherited" its uncorrelatedness with x from the OLS assumption that ε should be uncorrelated with x. The uncorrelatedness arises from the normal equations.


1
does your yi=β1+β2xi+εi mean regression using population data? Or what does it mean precisely?
denizen of the north

@user1559897 Yes, some textbooks will call this the "population regression line" or PRL. It's the underlying theoretical model for the population; you may also see this called the "data generating process" in some sources. (I tend to be a bit careful about saying it is the "regression on the population"... if you have a finite population, e.g. 50 states of the USA, that you perform the regression on, then this isn't quite true. If you are actually running a population on some data in your software, you are really talking about the estimated version of the regression, with the "hats")
Silverfish

I think i see what you are saying. If i understand you correctly, the error term in the model yi=β1+β2xi+εi could have non-zero expectation as well because it is a theoretical generating process, not a ols regression.
denizen of the north

This is a great answer from statistical inference perspective. What do you think the effect would be if prediction accuracy is the primary concern? See the edit of the post.
denizen of the north

16

Simple example:

  • Let xi,1 be the number of burgers I buy on visit i
  • Let xi,2 be the number of buns I buy.
  • Let b1 be the price of a burger
  • Let b2 be the price of a bun.
  • Independent of my burger and bun purchases, let me spend a random amount a+ϵi where a is a scalar and ϵi is a mean zero random variable. We have E[ϵi|X]=0.
  • Let yi be my spending on a trip to the grocery store.

The data generating process is:

yi=a+b1xi,1+b2xi,2+ϵi

If we ran that regression, we would get estimates a^, b^1, and b^2, and with enough data, they would converge on a, b1, and b2 respectively.

(Technical note: We need a little randomness so we don't buy exactly one bun for each burger we buy at every visit to the grocery store. If we did this, x1 and x2 would be collinear.)

An example of omitted variable bias:

Now let's consider the model:

yi=a+b1xi,1+ui

Observe that ui=b2xi,2+ϵi. Hence

Cov(x1,u)=Cov(x1,b2x2+ϵ)=b2Cov(x1,x2)+Cov(x1,ϵ)=b2Cov(x1,x2)

Is this zero? Almost certainly not! The purchase of burgers x1 and the purchase of buns x2 are almost certainly correlated! Hence u and x1 are correlated!

What happens if you tried to run the regression?

If you tried to run:

yi=a^+b^1xi,1+u^i

Your estimate b^1 would almost certainly be a poor estimate of b1 because the OLS regression estimates a^,b^,u^ would be constructed so that u^ and x1 are uncorrelated in your sample. But the actual u is correlated with x1 in the population!

What would happen in practice if you did this? Your estimate b^1 of the price of burgers would ALSO pickup the price of buns. Let's say every time you bought a $1 burger you tended to buy a $0.50 bun (but not all the time). Your estimate of the price of burgers might be $1.40. You'd be picking up the burger channel and the bun channel in your estimate of the burger price.


I like your burger bun example. You explained the problem from the perspective of statistical inference, ie inferring the effect of burger on price. Just wondering what the effect would be if all I care about is prediction, i.e prediction MSE on a test dataset? The intuition is that it is not going to be as good, but is there any theory to make it more precise? (this introduced more bias, but less variance, so the overall effect is not apparent to me. )
denizen of the north

1
@user1559897 If you just care about predicting spending, then predicting spending using the number of burgers and estimating b^1 as around $1.40 might work pretty well. If you have enough data, using the number of burgers and buns would undoubtedly work better. In short samples, L1 regularlization (LASSO) might send one of the coefficients b1 or b2 to zero. I think you're correctly recognizing that what you're doing in regression is estimating a conditional expectation function. My point is for that that function to capture causal effects, you need additional assumptions.
Matthew Gunn

3

動物の体重の重さの回帰を構築するとします。明らかに、イルカの体重は、ゾウやヘビの体重とは異なる方法で(異なる手順で、異なる器具を使用して)測定されます。これは、モデルエラーが高さ、つまり説明変数に依存することを意味します。彼らは多くの異なる方法で依存する可能性があります。たとえば、ゾウの体重をわずかに過大評価し、ヘビの体重をわずかに過小評価する傾向があるかもしれません。

したがって、ここで、エラーが説明変数と相関している状況に陥りやすいことを確認しました。これを無視して、通常どおり回帰に進むと、回帰残差が設計行列と相関していないことに気付くでしょう。これは、設計により回帰により残差が無相関になるためです。注、また、その残差がありませんエラー、彼らがしているの見積もりエラーの。そのため、誤差自体が独立変数と相関しているかどうかに関係なく、誤差の推定値(残差)は回帰方程式の解の構築によって無相関になります。

弊社のサイトを使用することにより、あなたは弊社のクッキーポリシーおよびプライバシーポリシーを読み、理解したものとみなされます。
Licensed under cc by-sa 3.0 with attribution required.