linearity and nonlinearity 1 this sequence introduces the topic of fitting nonlinear regression...

16
LINEARITY AND NONLINEARITY 1 This sequence introduces the topic of fitting nonlinear regression models. First we need a definition of linearity. u X X X Y 4 4 3 3 2 2 1 Linear in variables and parameters:

Upload: anton-maddix

Post on 01-Apr-2015

217 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: LINEARITY AND NONLINEARITY 1 This sequence introduces the topic of fitting nonlinear regression models. First we need a definition of linearity. Linear

LINEARITY AND NONLINEARITY

1

This sequence introduces the topic of fitting nonlinear regression models. First we need a definition of linearity.

uXXXY 4433221

Linear in variables and parameters:

Page 2: LINEARITY AND NONLINEARITY 1 This sequence introduces the topic of fitting nonlinear regression models. First we need a definition of linearity. Linear

The model shown above is linear in two senses. The right side is linear in variables because the variables are included exactly as defined, rather than as functions.

2

LINEARITY AND NONLINEARITY

uXXXY 4433221

Linear in variables and parameters:

Page 3: LINEARITY AND NONLINEARITY 1 This sequence introduces the topic of fitting nonlinear regression models. First we need a definition of linearity. Linear

It is also linear in parameters since a different parameter appears as a multiplicative factor in each term.

3

LINEARITY AND NONLINEARITY

uXXXY 4433221

Linear in variables and parameters:

Page 4: LINEARITY AND NONLINEARITY 1 This sequence introduces the topic of fitting nonlinear regression models. First we need a definition of linearity. Linear

The second model above is linear in parameters, but nonlinear in variables.

4

LINEARITY AND NONLINEARITY

uXXXY 4433221

uXXXY 44332221 log

Linear in parameters, nonlinear in variables:

Linear in variables and parameters:

Page 5: LINEARITY AND NONLINEARITY 1 This sequence introduces the topic of fitting nonlinear regression models. First we need a definition of linearity. Linear

Such models present no problem at all. Define new variables as shown.

5

LINEARITY AND NONLINEARITY

uXXXY 4433221

uXXXY 44332221 log

4433222 log,, XZXZXZ

Linear in parameters, nonlinear in variables:

Linear in variables and parameters:

Page 6: LINEARITY AND NONLINEARITY 1 This sequence introduces the topic of fitting nonlinear regression models. First we need a definition of linearity. Linear

With these cosmetic transformations, we have made the model linear in both variables and parameters.

6

LINEARITY AND NONLINEARITY

uXXXY 4433221

uXXXY 44332221 log

4433222 log,, XZXZXZ

uZZZY 4433221

Linear in parameters, nonlinear in variables:

Linear in variables and parameters:

Page 7: LINEARITY AND NONLINEARITY 1 This sequence introduces the topic of fitting nonlinear regression models. First we need a definition of linearity. Linear

Nonlinear in parameters:

uXXXY 4433221

uXXXY 44332221 log

4433222 log,, XZXZXZ

uZZZY 4433221

uXXXY 43233221

This model is nonlinear in parameters since the coefficient of X4 is the product of the coefficients of X2 and X3. As we will see, some models which are nonlinear in parameters can be linearized by appropriate transformations, but this is not one of those.

7

LINEARITY AND NONLINEARITY

Linear in parameters, nonlinear in variables:

Linear in variables and parameters:

Page 8: LINEARITY AND NONLINEARITY 1 This sequence introduces the topic of fitting nonlinear regression models. First we need a definition of linearity. Linear

We will begin with an example of a simple model that can be linearized by a cosmetic transformation. The table reproduces the data in Exercise 1.4 on average annual rates of growth of employment and GDP for 25 OECD countries.

8

LINEARITY AND NONLINEARITY

Average annual percentage growth rates

Employment GDP Employment GDP

Australia 1.68 3.04 Korea 2.57 7.73Austria 0.65 2.55 Luxembourg 3.02 5.64Belgium 0.34 2.16 Netherlands 1.88 2.86Canada 1.17 2.03 New Zealand 0.91 2.01Denmark 0.02 2.02 Norway 0.36 2.98Finland –1.06 1.78 Portugal 0.33 2.79France 0.28 2.08 Spain 0.89 2.60Germany 0.08 2.71 Sweden –0.94 1.17Greece 0.87 2.08 Switzerland 0.79 1.15Iceland –0.13 1.54 Turkey 2.02 4.18Ireland 2.16 6.40 United Kingdom 0.66 1.97Italy –0.30 1.68 United States 1.53 2.46Japan 1.06 2.81

Page 9: LINEARITY AND NONLINEARITY 1 This sequence introduces the topic of fitting nonlinear regression models. First we need a definition of linearity. Linear

A plot of the data reveals that the relationship is clearly nonlinear. We will consider various nonlinear specifications for the relationship in the course of this chapter, starting with the hyperbolic model shown.

9

LINEARITY AND NONLINEARITY

-2

-1

0

1

2

3

0 1 2 3 4 5 6 7 8

emp

loym

ent

gro

wth

rat

e

GDP growth rate

ug

e 21

Page 10: LINEARITY AND NONLINEARITY 1 This sequence introduces the topic of fitting nonlinear regression models. First we need a definition of linearity. Linear

This is nonlinear in g, but if we define z = 1/g, we can rewrite the model so that it is linear in variables as well as parameters.

10

LINEARITY AND NONLINEARITY

-2

-1

0

1

2

3

0 1 2 3 4 5 6 7 8

emp

loym

ent

gro

wth

rat

e

GDP growth rate

ug

e 21

g

z1

uze 21

Page 11: LINEARITY AND NONLINEARITY 1 This sequence introduces the topic of fitting nonlinear regression models. First we need a definition of linearity. Linear

Here is the data table a second time, showing the values of z computed from those of g. There is no need in practice to perform the calculations oneself. Regression applications always have a facility for generating new variables as functions of existing ones.

11

LINEARITY AND NONLINEARITY

Average annual percentage growth rates

e g z e g z

Australia 1.68 3.04 0.3289 Korea 2.57 7.73 0.1294Austria 0.65 2.55 0.3922 Luxembourg 3.02 5.64 0.1773Belgium 0.34 2.16 0.4630 Netherlands 1.88 2.86 0.3497Canada 1.17 2.03 0.4926 New Zealand 0.91 2.01 0.4975Denmark 0.02 2.02 0.4950 Norway 0.36 2.98 0.3356Finland –1.06 1.78 0.5618 Portugal 0.33 2.79 0.3584France 0.28 2.08 0.4808 Spain 0.89 2.60 0.3846Germany 0.08 2.71 0.3690 Sweden –0.94 1.17 0.8547Greece 0.87 2.08 0.4808 Switzerland 0.79 1.15 0.8696Iceland –0.13 1.54 0.6494 Turkey 2.02 4.18 0.2392Ireland 2.16 6.40 0.1563 United Kingdom0.66 1.97 0.5076Italy –0.30 1.68 0.5952 United States 1.53 2.46 0.4065Japan 1.06 2.81 0.3559

Page 12: LINEARITY AND NONLINEARITY 1 This sequence introduces the topic of fitting nonlinear regression models. First we need a definition of linearity. Linear

Here is the output for a regression of e on z.

12

LINEARITY AND NONLINEARITY

. gen z = 1/g

. reg e z

Source | SS df MS Number of obs = 25-------------+------------------------------ F( 1, 23) = 26.06 Model | 13.1203665 1 13.1203665 Prob > F = 0.0000 Residual | 11.5816089 23 .503548214 R-squared = 0.5311-------------+------------------------------ Adj R-squared = 0.5108 Total | 24.7019754 24 1.02924898 Root MSE = .70961

------------------------------------------------------------------------------ e | Coef. Std. Err. t P>|t| [95% Conf. Interval]-------------+---------------------------------------------------------------- z | -4.050817 .793579 -5.10 0.000 -5.69246 -2.409174 _cons | 2.604753 .3748822 6.95 0.000 1.82925 3.380256------------------------------------------------------------------------------

Page 13: LINEARITY AND NONLINEARITY 1 This sequence introduces the topic of fitting nonlinear regression models. First we need a definition of linearity. Linear

The figure shows the transformed data and the regression line for the regression of e on z.

13

LINEARITY AND NONLINEARITY

-2

-1

0

1

2

3

0 0.2 0.4 0.6 0.8 1

emp

loym

ent

gro

wth

rat

e

z = 1/g

------------------------ e | Coef. -----------+------------ z | -4.050817 _cons | 2.604753 ------------------------

ze 05.460.2ˆ

Page 14: LINEARITY AND NONLINEARITY 1 This sequence introduces the topic of fitting nonlinear regression models. First we need a definition of linearity. Linear

Substituting 1/g for z, we obtain the nonlinear relationship between e and g. The figure shows this relationship plotted in the original diagram. The linear regression of e on g reported in Exercise 1.4 is also shown, for comparison.

14

LINEARITY AND NONLINEARITY

-4

-3

-2

-1

0

1

2

3

0 1 2 3 4 5 6 7 8

emp

loym

ent

gro

wth

rat

e

GDP growth rate

gze

05.460.205.460.2ˆ

Page 15: LINEARITY AND NONLINEARITY 1 This sequence introduces the topic of fitting nonlinear regression models. First we need a definition of linearity. Linear

15

LINEARITY AND NONLINEARITY

In this case, it was easy to see that the relationship between e and g was nonlinear. In the case of multiple regression analysis, nonlinearity might be detected using the graphical technique described in a previous slideshow.

-4

-3

-2

-1

0

1

2

3

0 1 2 3 4 5 6 7 8

emp

loym

ent

gro

wth

rat

e

GDP growth rate

gze

05.460.205.460.2ˆ

Page 16: LINEARITY AND NONLINEARITY 1 This sequence introduces the topic of fitting nonlinear regression models. First we need a definition of linearity. Linear

Copyright Christopher Dougherty 2012.

These slideshows may be downloaded by anyone, anywhere for personal use.

Subject to respect for copyright and, where appropriate, attribution, they may be

used as a resource for teaching an econometrics course. There is no need to

refer to the author.

The content of this slideshow comes from Section 4.1 of C. Dougherty,

Introduction to Econometrics, fourth edition 2011, Oxford University Press.

Additional (free) resources for both students and instructors may be

downloaded from the OUP Online Resource Centre

http://www.oup.com/uk/orc/bin/9780199567089/.

Individuals studying econometrics on their own who feel that they might benefit

from participation in a formal course should consider the London School of

Economics summer school course

EC212 Introduction to Econometrics

http://www2.lse.ac.uk/study/summerSchools/summerSchool/Home.aspx

or the University of London International Programmes distance learning course

EC2020 Elements of Econometrics

www.londoninternational.ac.uk/lse.

2012.11.03