chapter 4 office2007 black and white - sjsu.edu · 12/10/2007 8 figure 4.5 a nonlinear relationship...

17
12/10/2007 1 Prediction, Goodness-of-Fit, and Modeling Issues Prepared by Vera Tabakova, East Carolina University 4.1 Least Squares Prediction 4.2 Measuring Goodness-of-Fit d li 4.3 Modeling Issues 4.4 Log-Linear Models Slide 4-2 Principles of Econometrics, 3rd Edition where e 0 is a random error. We assume that and We also ass me that and (4.1) 0 1 2 0 0 β β y x e = + + ( ) 0 1 2 0 Ey x =β +β ( ) 0 E ( ) 2 . We also assume that and Slide 4-3 Principles of Econometrics, 3rd Edition ( ) 0 0 E e = ( ) 2 0 var e ( ) 0 cov , 0 1, 2, , i e e i N = = (4.2) 0 1 2 0 ˆ y b bx = +

Upload: tranhuong

Post on 20-Jul-2019

214 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Chapter 4 office2007 black and white - sjsu.edu · 12/10/2007 8 Figure 4.5 A nonlinear relationship between food expenditure and income Principles of Econometrics, 3rd Edition Slide

12/10/2007

1

Prediction, Goodness-of-Fit, and Modeling Issues

Prepared by Vera Tabakova, East Carolina University

4.1 Least Squares Prediction

4.2 Measuring Goodness-of-Fit

d li4.3 Modeling Issues

4.4 Log-Linear Models

Slide 4-2Principles of Econometrics, 3rd Edition

where e0 is a random error. We assume that andWe also ass me that and

(4.1)0 1 2 0 0β βy x e= + +

( )0 1 2 0E y x= β +β

( ) 0E ( ) 2. We also assume that and

Slide 4-3Principles of Econometrics, 3rd Edition

( )0 0E e = ( ) 20var e = σ

( )0cov , 0 1,2, ,ie e i N= = …

(4.2)0 1 2 0y b b x= +

Page 2: Chapter 4 office2007 black and white - sjsu.edu · 12/10/2007 8 Figure 4.5 A nonlinear relationship between food expenditure and income Principles of Econometrics, 3rd Edition Slide

12/10/2007

2

Figure 4.1 A point prediction

Slide 4-4Principles of Econometrics, 3rd Edition

(4.3)( ) ( )0 0 1 2 0 0 1 2 0ˆf y y x e b b x= − = β +β + − +

( ) ( ) ( ) ( )1 2 0 0 1 2 0E f x E e E b E b x= β +β + − ⎡ + ⎤⎣ ⎦

Slide 4-5Principles of Econometrics, 3rd Edition

(4.4)2

2 02

( )1var( ) 1( )i

x xf

N x x⎡ ⎤−

= σ + +⎢ ⎥−⎣ ⎦∑

( ) ( ) ( ) ( )

[ ]

1 2 0 0 1 2 0

1 2 0 1 2 00 0

E f x E e E b E b x

x x

β +β + ⎡ + ⎤⎣ ⎦

= β +β + − β +β =

The variance of the forecast error is smaller when

i. the overall uncertainty in the model is smaller, as measured by the variance of the random errors ;

ii. the sample size N is larger; iii. the variation in the explanatory variable is larger; andp y g ;iv. the value of is small.

Slide 4-6Principles of Econometrics, 3rd Edition

Page 3: Chapter 4 office2007 black and white - sjsu.edu · 12/10/2007 8 Figure 4.5 A nonlinear relationship between food expenditure and income Principles of Econometrics, 3rd Edition Slide

12/10/2007

3

22 0

2

1 ( )ˆvar( ) 1( )i

x xfN x x

⎡ ⎤−= σ + +⎢ ⎥−⎣ ⎦∑

Slide 4-7Principles of Econometrics, 3rd Edition

(4.5)

(4.6)

( ) ( )se varf f=

( )0ˆ secy t f±

Figure 4.2 Point and interval prediction

Slide 4-8Principles of Econometrics, 3rd Edition

y

0 1 2 0ˆ 83.4160 10.2096(20) 287.6089y b b x= + = + =

22 0

2

1 ( )ˆvar( ) 1( )i

x xfN x x

⎡ ⎤−= σ + +⎢ ⎥−⎣ ⎦∑

Slide 4-9Principles of Econometrics, 3rd Edition

( )

2 22 2

0 2

22 2

0 2

ˆ ˆˆ ( )( )

ˆˆ ( ) var

i

x xN x x

x x bN

⎣ ⎦

σ σ= σ + + −

σ= σ + + −

[ ]0ˆ se( ) 287.6069 2.0244(90.6328) 104.1323,471.0854cy t f± = ± =

Page 4: Chapter 4 office2007 black and white - sjsu.edu · 12/10/2007 8 Figure 4.5 A nonlinear relationship between food expenditure and income Principles of Econometrics, 3rd Edition Slide

12/10/2007

4

(4.7)

(4 8)

1 2 i i iy x e= β +β +

( )y E y e= +

Slide 4-10Principles of Econometrics, 3rd Edition

(4.8)

(4.9)

(4.10)

( )i i iy E y e= +

ˆ ˆi i iy y e= +

ˆ ˆ( )i i iy y y y e− = − +

Figure 4.3 Explained and unexplained components of yi

Slide 4-11Principles of Econometrics, 3rd Edition

(4 11)2 2 2ˆ ˆ( ) ( )∑ ∑ ∑

( )22ˆ

1i

y

y yN

−σ =

−∑

Slide 4-12Principles of Econometrics, 3rd Edition

(4.11)2 2 2ˆ ˆ( ) ( )i i iy y y y e− = − +∑ ∑ ∑

Page 5: Chapter 4 office2007 black and white - sjsu.edu · 12/10/2007 8 Figure 4.5 A nonlinear relationship between food expenditure and income Principles of Econometrics, 3rd Edition Slide

12/10/2007

5

= total sum of squares = SST: a measure of total variation in y about the sample mean.

= sum of squares due to the regression = SSR: that part of total variation in y, about the sample mean, that is explained by, or due to, the regression. Also known as the “explained sum of squares ”

2( )iy y−∑

2ˆ( ) iy y−∑

known as the “explained sum of squares.”

= sum of squares due to error = SSE: that part of total variation in y about its mean that is not explained by the regression. Also known as the unexplained sum of squares, the residual sum of squares, or the sum of squared errors.

SST = SSR + SSE

Slide 4-13Principles of Econometrics, 3rd Edition

2ˆ ie∑

(4.12)2 1SSR SSER

SST SST= = −

The closer R2 is to one, the closer the sample values yi are to the fitted regression

equation . If R2= 1, then all the sample data fall exactly on the fitted

least squares line, so SSE = 0, and the model fits the data “perfectly.” If the sample

data for y and x are uncorrelated and show no linear association, then the least

squares fitted line is “horizontal,” so that SSR = 0 and R2 = 0.

Slide 4-14Principles of Econometrics, 3rd Edition

1 2i iy b b x= +

(4.13)

(4.14)

cov( , )var( ) var( )

xyxy

x y

x yx y

σρ = =

σ σ

ˆˆ ˆ

xyxyr

σ=

Slide 4-15Principles of Econometrics, 3rd Edition

(4.14)

(4.15)

ˆ ˆxyx yσ σ

( )

( )

( )

2

2

ˆ ( )( ) 1

ˆ ( ) 1

ˆ ( ) 1

xy i i

x i

y i

x x y y N

x x N

y y N

σ = − − −

σ = − −

σ = − −

Page 6: Chapter 4 office2007 black and white - sjsu.edu · 12/10/2007 8 Figure 4.5 A nonlinear relationship between food expenditure and income Principles of Econometrics, 3rd Edition Slide

12/10/2007

6

2 2xyr R=

2 2ˆyyR r=

R2 measures the linear association, or goodness-of-fit, between the sample data

and their predicted values. Consequently R2 is sometimes called a measure of

“goodness-of-fit.”

Slide 4-16Principles of Econometrics, 3rd Edition

( )

( )

2

2 2

495132.160

ˆ ˆ 304505.176

i

i i i

SST y y

SSE y y e

= − =

= − = =

∑ ∑

Slide 4-17Principles of Econometrics, 3rd Edition

2 304505.1761 1 .385495132.160

SSERSST

= − = − =

( )( )ˆ 478.75 .62

ˆ ˆ 6.848 112.675xy

xyx y

= = =σ σ

Figure 4.4 Plot of predicted y, against y

Slide 4-18Principles of Econometrics, 3rd Edition

y

Page 7: Chapter 4 office2007 black and white - sjsu.edu · 12/10/2007 8 Figure 4.5 A nonlinear relationship between food expenditure and income Principles of Econometrics, 3rd Edition Slide

12/10/2007

7

FOOD_EXP = weekly food expenditure by a household of size 3, in dollars

INCOME = weekly household income, in $100 units

283.42 10.21 .385FOOD_EXP = INCOME R+ =

* indicates significant at the 10% level** indicates significant at the 5% level*** indicates significant at the 1% level

Slide 4-19Principles of Econometrics, 3rd Edition

* *** (se) (43.41) (2.09)

4.3.1 The Effects of Scaling the DataChanging the scale of x:

* *1 2 1 2 1 2 = ( )( / ) = y x e c x c e x e= β +β + β + β + β +β +

* *h β β d

Changing the scale of y:

Slide 4-20Principles of Econometrics, 3rd Edition

2 2where β β and c x x c= =

* * * *1 2 1 2/ ( / ) ( / ) ( / ) or y c c c x e c y x e= β + β + = β +β +

Variable transformations:Power: if x is a variable then xp means raising the variable to the power p; examples

are quadratic (x2) and cubic (x3) transformations.

The natural logarithm: if x is a variable then its natural logarithm is ln(x).g g ( )

The reciprocal: if x is a variable then its reciprocal is 1/x.

Slide 4-21Principles of Econometrics, 3rd Edition

Page 8: Chapter 4 office2007 black and white - sjsu.edu · 12/10/2007 8 Figure 4.5 A nonlinear relationship between food expenditure and income Principles of Econometrics, 3rd Edition Slide

12/10/2007

8

Figure 4.5 A nonlinear relationship between food expenditure and income

Slide 4-22Principles of Econometrics, 3rd Edition

The log-log model

The parameter β is the elasticity of y with respect to x.1 2ln( ) ln( )y x= β +β

The log-linear model

A one-unit increase in x leads to (approximately) a 100 β2 percent change in y.

The linear-log model

A 1% increase in x leads to a β2/100 unit change in y.

Slide 4-23Principles of Econometrics, 3rd Edition

1 2ln( )i iy x= β +β

( ) ( )2

1 2 ln or 100 100

yy xx x

Δ β= β +β =

Δ

The reciprocal model is

1 21_FOOD EXP e

INCOME= β +β +

The linear-log model is

Slide 4-24Principles of Econometrics, 3rd Edition

1 2_ ln( )FOOD EXP INCOME e= β +β +

Page 9: Chapter 4 office2007 black and white - sjsu.edu · 12/10/2007 8 Figure 4.5 A nonlinear relationship between food expenditure and income Principles of Econometrics, 3rd Edition Slide

12/10/2007

9

Remark: Given this array of models, that involve different transformations of the dependent and independent variables, and some of which have similar shapes, what are some guidelines for choosing a functional form?

Slide 4-25Principles of Econometrics, 3rd Edition

g g

1. Choose a shape that is consistent with what economic theory tells us about the relationship.

2. Choose a shape that is sufficiently flexible to “fit” the data

3. Choose a shape so that assumptions SR1-SR6 are satisfied, ensuring that the least squares estimators have the desirable properties described in Chapters 2 and 3.

Figure 4.6 EViews output: residuals histogram and summary statistics for food expenditure example

Slide 4-26Principles of Econometrics, 3rd Edition

The Jarque-Bera statistic is given by

( )22 3

6 4KNJB S

⎛ ⎞−= +⎜ ⎟⎜ ⎟

⎝ ⎠

where N is the sample size, S is skewness, and K is kurtosis.

In the food expenditure example

Slide 4-27Principles of Econometrics, 3rd Edition

( )22 2.99 340 .097 .063

6 4JB

⎛ ⎞−= − + =⎜ ⎟⎜ ⎟

⎝ ⎠

Page 10: Chapter 4 office2007 black and white - sjsu.edu · 12/10/2007 8 Figure 4.5 A nonlinear relationship between food expenditure and income Principles of Econometrics, 3rd Edition Slide

12/10/2007

10

Figure 4.7 Scatter plot of wheat yield over time

Slide 4-28Principles of Econometrics, 3rd Edition

1 2t t tYIELD TIME e= β +β +

Slide 4-29Principles of Econometrics, 3rd Edition

2.638 .0210 .649 (se) (.064) (.0022)

t tYIELD TIME R= + =

Figure 4.8 Predicted, actual and residual values from straight line

Slide 4-30Principles of Econometrics, 3rd Edition

Page 11: Chapter 4 office2007 black and white - sjsu.edu · 12/10/2007 8 Figure 4.5 A nonlinear relationship between food expenditure and income Principles of Econometrics, 3rd Edition Slide

12/10/2007

11

Figure 4.9 Bar chart of residuals from straight line

Slide 4-31Principles of Econometrics, 3rd Edition

31 2t t tYIELD TIME e= β +β +

3 1000000TIMECUBE TIME

Slide 4-32Principles of Econometrics, 3rd Edition

20.874 9.68 0.751 (se) (.036) (.082)

t tYIELD TIMECUBE R= + =

3 1000000TIMECUBE TIME=

Figure 4.10 Fitted, actual and residual values from equation with cubic term

Slide 4-33Principles of Econometrics, 3rd Edition

Page 12: Chapter 4 office2007 black and white - sjsu.edu · 12/10/2007 8 Figure 4.5 A nonlinear relationship between food expenditure and income Principles of Econometrics, 3rd Edition Slide

12/10/2007

12

4.4.1 The Growth Model

( ) ( ) ( )0ln ln ln 1tYIELD YIELD g t

t

= + +

β +β

Slide 4-34Principles of Econometrics, 3rd Edition

1 2t= β +β

( )ln .3434 .0178 (se) (.0584) (.0021)

tYIELD t= − +

4.4.2 A Wage Equation

( ) ( ) ( )0

1 2

ln ln ln 1WAGE WAGE r EDUC

EDUC

= + +

= β +β

Slide 4-35Principles of Econometrics, 3rd Edition

1 2β β

( )ln .7884 .1038 (se) (.0849) (.0063)

WAGE EDUC= + ×

4.4.3 Prediction in the Log-Linear Model

( )( ) ( )1 2ˆ exp ln expny y b b x= = +

( ) ( ) 2ˆ2 2ˆ ˆ ˆ2E b b σ

Slide 4-36Principles of Econometrics, 3rd Edition

( ) ( )2 21 2exp 2c ny E y b b x y eσ= = + + σ =

( )ln .7884 .1038 .7884 .1038 12 2.0335WAGE EDUC= + × = + × =

( ) 2ˆ 2ˆ ˆ 7.6408 1.1276 8.6161c ny E y y eσ= = = × =

Page 13: Chapter 4 office2007 black and white - sjsu.edu · 12/10/2007 8 Figure 4.5 A nonlinear relationship between food expenditure and income Principles of Econometrics, 3rd Edition Slide

12/10/2007

13

4.4.4 A Generalized R2 Measure

( ) 22 2ˆ,ˆcorr ,g y yR y y r= ⎡ ⎤ =⎣ ⎦

R2 values tend to be small with microeconomic, cross-sectional data, because the

variations in individual behavior are difficult to fully explain.

Slide 4-37Principles of Econometrics, 3rd Edition

( ) 22 2ˆcorr , .4739 .2246g cR y y= ⎡ ⎤ = =⎣ ⎦

4.4.5 Prediction Intervals in the Log-Linear Model

( ) ( )( ) ( ) ( )( )exp ln se ,exp ln sec cy t f y t f⎡ ⎤− +⎢ ⎥⎣ ⎦

Slide 4-38Principles of Econometrics, 3rd Edition

( ) ( ) [ ]exp 2.0335 1.96 .4905 ,exp 2.0335 1.96 .4905 2.9184,20.0046⎡ − × + × ⎤ =⎣ ⎦

coefficient of determinationcorrelationdata scaleforecast error

linear modellinear relationshiplinear-log modellog-linear modellog-log model

Slide 4-39Principles of Econometrics, 3rd Edition

forecast standard errorfunctional formgoodness-of-fitgrowth modelJarque-Bera testkurtosisleast squares predictor

log-normal distributionpredictionprediction intervalR2

residualskewness

Page 14: Chapter 4 office2007 black and white - sjsu.edu · 12/10/2007 8 Figure 4.5 A nonlinear relationship between food expenditure and income Principles of Econometrics, 3rd Edition Slide

12/10/2007

14

Slide 4-40Principles of Econometrics, 3rd Edition

( ) ( )0 0 1 2 0 0 1 2 0ˆf y y x e b b x= − = β +β + − +

Slide 4-41Principles of Econometrics, 3rd Edition

( ) ( ) ( ) ( ) ( )

( ) ( ) ( )

20 1 2 0 1 0 2 0 1 2

2 2 22 20 02 2 2

ˆvar var var var 2 cov ,

2i

i i i

y b b x b x b x b b

x xx xN x x x x x x

= + = + +

σ σ −= + + σ

− − −∑

∑ ∑ ∑

( )( ) ( ) ( )

( )( ) ( )

22 2 2 2 2 2 2 200

0 2 2 2 2 2

2 2 2 22 0 0

2ˆvar

2

i

i i i i i

i

x xx Nx x NxyN x x N x x x x x x N x x

x Nx x x x x

⎡ ⎤ ⎡ ⎤⎧ ⎫ ⎧ ⎫σ −σ σ σ σ⎪ ⎪ ⎪ ⎪⎢ ⎥ ⎢ ⎥= − + + +⎨ ⎬ ⎨ ⎬− − − − −⎢ ⎥ ⎢ ⎥⎪ ⎪ ⎪ ⎪⎩ ⎭ ⎩ ⎭⎣ ⎦ ⎣ ⎦

⎡ ⎤− − += σ +⎢ ⎥

∑∑ ∑ ∑ ∑ ∑

Slide 4-42Principles of Econometrics, 3rd Edition

( ) ( )

( )( )

( )( )

( )

2 2

2 22 0

2 2

22 01

i i

i

i i

N x x x x

x x x xN x x x x

x xN x

= σ +⎢ ⎥− −⎢ ⎥⎣ ⎦

⎡ ⎤− −= σ +⎢ ⎥

− −⎢ ⎥⎣ ⎦

−= σ +

∑ ∑

∑∑ ∑

( )2i x

⎡ ⎤⎢ ⎥

−⎢ ⎥⎣ ⎦∑

Page 15: Chapter 4 office2007 black and white - sjsu.edu · 12/10/2007 8 Figure 4.5 A nonlinear relationship between food expenditure and income Principles of Econometrics, 3rd Edition Slide

12/10/2007

15

~ (0,1)var( )

f Nf

( )2

2 01 ( )ˆvar 1 x xf⎡ ⎤−

= σ + +⎢ ⎥

Slide 4-43Principles of Econometrics, 3rd Edition

(4A.1)

(4A.2)

( ) 2var 1( )i

fN x x

= σ + +⎢ ⎥−⎣ ⎦∑

( )0 0

( 2)ˆ

~se( )var

Nf y y t

ff−

−=

( ) 1c cP t t t− ≤ ≤ = −α

0 0ˆ[ ] 1

se( )c cy yP t t

f−

− ≤ ≤ = −α

[ ]ˆ ˆse( ) se( ) 1P y t f y y t f− ≤ ≤ + = −α

Slide 4-44Principles of Econometrics, 3rd Edition

[ ]0 0 0se( ) se( ) 1c cP y t f y y t f− ≤ ≤ + = −α

( ) [ ]22 2 2ˆ ˆ ˆ ˆ ˆ ˆ( ) ( ) 2( )i i i i i i iy y y y e y y e y y e− = − + = − + + −

( )2 2 2ˆ ˆ ˆ ˆ( ) 2 ( )+ +∑ ∑ ∑ ∑

Slide 4-45Principles of Econometrics, 3rd Edition

( ) 2 2( ) 2 ( )i i i i iy y y y e y y e− = − + + −∑ ∑ ∑ ∑

( ) ( )1 2

1 2

ˆ ˆ ˆ ˆ ˆ ˆ ˆ

ˆ ˆ ˆ

i i i i i i i i

i i i i

y y e y e y e b b x e y e

b e b x e y e

− = − = + −

= + −

∑ ∑ ∑ ∑ ∑

∑ ∑ ∑

Page 16: Chapter 4 office2007 black and white - sjsu.edu · 12/10/2007 8 Figure 4.5 A nonlinear relationship between food expenditure and income Principles of Econometrics, 3rd Edition Slide

12/10/2007

16

( )1 2 1 2ˆ 0i i i i ie y b b x y Nb b x= − − = − − =∑ ∑ ∑ ∑

( ) 2ˆ 0x e x y b b x x y b x b x= − − = − − =∑ ∑ ∑ ∑ ∑

Slide 4-46Principles of Econometrics, 3rd Edition

If the model contains an intercept it is guaranteed that SST = SSR + SSE. If, however, the model does not contain an intercept, then and SST ≠ SSR + SSE.

( )1 2 1 2 0i i i i i i i i ix e x y b b x x y b x b x= − − = − − =∑ ∑ ∑ ∑ ∑

( )ˆ ˆ 0i iy y e− =∑

ˆ 0ie ≠∑

Suppose that the variable y has a normal distribution, with mean μ and variance σ2. If we consider then is said to have a log-normaldistribution.

yw e= ( ) ( )2ln ~ ,y w N= μ σ

( ) 2 2E μ+σ

Slide 4-47Principles of Econometrics, 3rd Edition

( ) 2E w eμ+σ=

( ) ( )2 22var 1w e eμ+σ σ= −

Given the log-linear model

If we assume that

( ) 1 2ln y x e= β +β +

( )2~ 0,e N σ

( ) ( ) ( )1 2 1 2i i i ix e x eE y E e E e eβ +β + β +β= = =

Slide 4-48Principles of Econometrics, 3rd Edition

( ) ( ) ( )( )

1 2 1 2

221 2 1 2 1 2 22

i i i i

i i i i

i

x e x x

E y E e E e e

e E e e e e

β β β β

β +β β +β β +β +σσ

= = =

= =

( ) 21 2 ˆ 2ib b x

iE y e + +σ=

Page 17: Chapter 4 office2007 black and white - sjsu.edu · 12/10/2007 8 Figure 4.5 A nonlinear relationship between food expenditure and income Principles of Econometrics, 3rd Edition Slide

12/10/2007

17

The growth and wage equations:

and( )2 ln 1 rβ = + 2 1r eβ= −

( ) ( )( )22~ varb N b x xβ = σ ∑

Slide 4-49Principles of Econometrics, 3rd Edition

( ) ( )( )2 2 2~ ,var ib N b x xβ = σ −∑

( )2 22 var /2bbE e eβ +⎡ ⎤ =⎣ ⎦( )2 2var /2ˆ 1b br e += −

( ) ( )222 ˆvar ib x x= σ −∑