LinearRegression1

E y b0 b1x 0 2 e x y b0 b1x 0 these are

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: - b1x )ùúû = 0 (These are called moment restrictions) VER. 9/25/2012. © P. KOLM 14 Moment restrictions: E [y - b0 - b1x ] = 0 E éêëx (y - b0 - b1x )ùúû = 0 Sample versions of the moment restrictions: n -1 n å (y i =1 n i ˆ ˆ - b0 - b1x i ) = 0 ˆ ˆ n -1 å x i (yi - b0 - b1x i ) = 0 i =1 The first condition is the same as saying ˆ ˆ y = b0 + b1x or ˆ ˆ b0 = y - b1x ˆ So once we calculate the averages y , x (from the sample!) and the slope b1 (see ˆ below) we obtain the intercept b 0 VER. 9/25/2012. © P. KOLM 15 ˆ How do we calculate the slope b1 ? Recall: n -1 n å x (y i i =1 i ˆ ˆ - b0 - b1x i ) = 0 From this we obtain1 n å x (y i i =1 i ˆ ˆ - (y - b1x ) - b1x i ) = 0 n n i =1 i =1 ˆ å x i (yi - y ) = b1 å x i (x i - x ) n i =1 n i =1 2 ˆ x i - x )(yi - y ) = b1 å (x i - x ) å( n ˆ And therefore, b1 = å (x i =1 i n å (x i =1 VER. 9/25/2012. © P. KOLM - x )(yi - y ) -x) 2 i provided that n å (x i - x ) > 0 2 i =1 16 Remarks ˆ ˆ b0 and b1 are called the ordinary least squares (OLS) estimates of b0 and b1 For any value of x = x i we obtain a fitted value for y, ˆ ˆ ˆ yi = b0 + b1x i Note: The slope is the sample covariance between x and y divided by the sample variance of x , i.e. n ˆ b1 = = å (x i =1 i - x )(yi - y ) n -1 Cov(x , y ) º rxy sx sy Var (x ) ⋅ n -1 n å (x i - x ) 2 i =1 o If x and y are positively correlated ( rxy > 0 ), the slope will be positive o If x and y are negatively correlated ( rxy < 0 ), the slope will be negative Important: We need x to vary in our sample otherwise n å (x i =1 VER. 9/25/2012. © P. KOLM -x) = 0 2 i 17 Alternative Derivation of OLS2 Least squares: Fitting a line through the sample points such that the sum of squared residuals is as small as possible, hence the term “ordinary least squares” ˆ The residual, u , is an estimate of the error term, u , and is the difference between the fitted line (sample regression function) and the sample point. Solving3 n n min å u = min å (yi - b0 - b1x i ) b0 , b1 i =1 2 i b0 , b1 2 i =1 ˆ ˆ using calculus gives us b0 and b1 as before VER. 9/...
View Full Document

This document was uploaded on 02/17/2014 for the course COURANT G63.2751.0 at NYU.

Ask a homework question - tutors are online