45
ECON 343 Lecture 4 : Smoothing and Extrapolation of Time Series Jad Chaaban Spring 2005-2006

ECON 343 Lecture 4 : Smoothing and Extrapolation of Time ... · Lecture 4 : Smoothing and Extrapolation of Time Series Jad Chaaban Spring 2005-2006. Outline – Lecture 4 1. Simple

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: ECON 343 Lecture 4 : Smoothing and Extrapolation of Time ... · Lecture 4 : Smoothing and Extrapolation of Time Series Jad Chaaban Spring 2005-2006. Outline – Lecture 4 1. Simple

ECON 343Lecture 4 : Smoothing and

Extrapolation of Time Series

Jad Chaaban

Spring 2005-2006

Page 2: ECON 343 Lecture 4 : Smoothing and Extrapolation of Time ... · Lecture 4 : Smoothing and Extrapolation of Time Series Jad Chaaban Spring 2005-2006. Outline – Lecture 4 1. Simple

Outline – Lecture 4

1. Simple extrapolation models2. Moving-average models3. Single Exponential smoothing4. Double Exponential smoothing5. Seasonal adjustment6. Structural breaks

Page 3: ECON 343 Lecture 4 : Smoothing and Extrapolation of Time ... · Lecture 4 : Smoothing and Extrapolation of Time Series Jad Chaaban Spring 2005-2006. Outline – Lecture 4 1. Simple

1. Simple extrapolation models

Assumptions: Forecast the time series on the basis of its past behavior

Deterministic nature: no randomness used in the models here

Regress the series against a function of time and/or itself lagged

Types of models:Linear trend model

Quadratic trend model

Exponential model

Autoregressive trend model

Page 4: ECON 343 Lecture 4 : Smoothing and Extrapolation of Time ... · Lecture 4 : Smoothing and Extrapolation of Time Series Jad Chaaban Spring 2005-2006. Outline – Lecture 4 1. Simple

Linear trend model

Assumptions: The series will increase in constant absolute amounts each period

Trend line depends only on time t

Formula:

t is usually chosen to equal 0 in the base period and to increase by 1 during each successive period

Simple OLS estimation

tYt βα +=

Page 5: ECON 343 Lecture 4 : Smoothing and Extrapolation of Time ... · Lecture 4 : Smoothing and Extrapolation of Time Series Jad Chaaban Spring 2005-2006. Outline – Lecture 4 1. Simple

Excel implementation

IMF's International Price of Beef Indexmonthly, 1980-2005

0

20

40

60

80

100

120

140

160

Jan-

80

Jan-

82

Jan-

84

Jan-

86

Jan-

88

Jan-

90

Jan-

92

Jan-

94

Jan-

96

Jan-

98

Jan-

00

Jan-

02

Jan-

04

US c

ents

per

pou

nd

Page 6: ECON 343 Lecture 4 : Smoothing and Extrapolation of Time ... · Lecture 4 : Smoothing and Extrapolation of Time Series Jad Chaaban Spring 2005-2006. Outline – Lecture 4 1. Simple

Excel implementation

Page 7: ECON 343 Lecture 4 : Smoothing and Extrapolation of Time ... · Lecture 4 : Smoothing and Extrapolation of Time Series Jad Chaaban Spring 2005-2006. Outline – Lecture 4 1. Simple

Excel implementation

Page 8: ECON 343 Lecture 4 : Smoothing and Extrapolation of Time ... · Lecture 4 : Smoothing and Extrapolation of Time Series Jad Chaaban Spring 2005-2006. Outline – Lecture 4 1. Simple

Excel implementation

Page 9: ECON 343 Lecture 4 : Smoothing and Extrapolation of Time ... · Lecture 4 : Smoothing and Extrapolation of Time Series Jad Chaaban Spring 2005-2006. Outline – Lecture 4 1. Simple

Excel implementation

IMF's International Price of Beef Indexmonthly, 1980-2005

y = -0.0652x + 175.75R2 = 0.1559

0

20

40

60

80

100

120

140

160

Jan-

80

Jan-

82

Jan-

84

Jan-

86

Jan-

88

Jan-

90

Jan-

92

Jan-

94

Jan-

96

Jan-

98

Jan-

00

Jan-

02

Jan-

04

US

cent

s pe

r pou

nd

Page 10: ECON 343 Lecture 4 : Smoothing and Extrapolation of Time ... · Lecture 4 : Smoothing and Extrapolation of Time Series Jad Chaaban Spring 2005-2006. Outline – Lecture 4 1. Simple

Quadratic trend model

Assumptions: Extends the simple linear trend model to potential non-linearity

Add a term t2

Formula:

If β and γ are >0, then yt will always increase

If β <0 and γ>0, yt will first decrease then increase

If β and γ are <0, then yt will always decrease

2ttYt γβα ++=

Page 11: ECON 343 Lecture 4 : Smoothing and Extrapolation of Time ... · Lecture 4 : Smoothing and Extrapolation of Time Series Jad Chaaban Spring 2005-2006. Outline – Lecture 4 1. Simple

Excel implementation

Page 12: ECON 343 Lecture 4 : Smoothing and Extrapolation of Time ... · Lecture 4 : Smoothing and Extrapolation of Time Series Jad Chaaban Spring 2005-2006. Outline – Lecture 4 1. Simple

Excel implementation

IMF's International Price of Beef Indexmonthly, 1980-2005

y = 0.0004x2 - 0.9967x + 691.67R2 = 0.1971

0

20

40

60

80

100

120

140

160

Jan-

80

Jan-

82

Jan-

84

Jan-

86

Jan-

88

Jan-

90

Jan-

92

Jan-

94

Jan-

96

Jan-

98

Jan-

00

Jan-

02

Jan-

04

US c

ents

per

pou

nd

Page 13: ECON 343 Lecture 4 : Smoothing and Extrapolation of Time ... · Lecture 4 : Smoothing and Extrapolation of Time Series Jad Chaaban Spring 2005-2006. Outline – Lecture 4 1. Simple

Excel implementation

Polynomial of 6 time variables

y = -1E-11x6 + 7E-08x5 - 0.0002x4 + 0.2977x3 - 243.59x2 + 106004x - 2E+07

R2 = 0.71130

20

40

60

80

100

120

140

160

Jan-

80

Jan-

82

Jan-

84

Jan-

86

Jan-

88

Jan-

90

Jan-

92

Jan-

94

Jan-

96

Jan-

98

Jan-

00

Jan-

02

Jan-

04

US c

ents

per

pou

nd

Page 14: ECON 343 Lecture 4 : Smoothing and Extrapolation of Time ... · Lecture 4 : Smoothing and Extrapolation of Time Series Jad Chaaban Spring 2005-2006. Outline – Lecture 4 1. Simple

Exponential model

Assumptions: The series will grow with constant percentage increasesUse of the exponential function

Formula:

The parameters A and r can be estimated by taking the logarithms of both sides of the formulaThen we fit the through OLS the log-linear function:

where c1=log(A) and c2=r

rtt AeY =

tccYt 21)log( +=

Page 15: ECON 343 Lecture 4 : Smoothing and Extrapolation of Time ... · Lecture 4 : Smoothing and Extrapolation of Time Series Jad Chaaban Spring 2005-2006. Outline – Lecture 4 1. Simple

Excel implementation

Page 16: ECON 343 Lecture 4 : Smoothing and Extrapolation of Time ... · Lecture 4 : Smoothing and Extrapolation of Time Series Jad Chaaban Spring 2005-2006. Outline – Lecture 4 1. Simple

Excel implementation

IMF's International Price of Beef Indexmonthly, 1980-2005

y = 215.04e-0.0007x

R2 = 0.1647

0

20

40

60

80

100

120

140

160

Jan-

80

Jan-

82

Jan-

84

Jan-

86

Jan-

88

Jan-

90

Jan-

92

Jan-

94

Jan-

96

Jan-

98

Jan-

00

Jan-

02

Jan-

04

US

cent

s pe

r po

und

Page 17: ECON 343 Lecture 4 : Smoothing and Extrapolation of Time ... · Lecture 4 : Smoothing and Extrapolation of Time Series Jad Chaaban Spring 2005-2006. Outline – Lecture 4 1. Simple

Autoregressive trend model

Assumptions: The series will grow according to its lagged values only

Formula:

Variation of the model: logarithmic autoregressive trend model:

If α=0 then the value of β is the compounded rate of growth of the series Y

1−+= tt YY βα

)log()log( 1−+= tt YY βα

Page 18: ECON 343 Lecture 4 : Smoothing and Extrapolation of Time ... · Lecture 4 : Smoothing and Extrapolation of Time Series Jad Chaaban Spring 2005-2006. Outline – Lecture 4 1. Simple

EViews implementation

Page 19: ECON 343 Lecture 4 : Smoothing and Extrapolation of Time ... · Lecture 4 : Smoothing and Extrapolation of Time Series Jad Chaaban Spring 2005-2006. Outline – Lecture 4 1. Simple

EViews implementation

Page 20: ECON 343 Lecture 4 : Smoothing and Extrapolation of Time ... · Lecture 4 : Smoothing and Extrapolation of Time Series Jad Chaaban Spring 2005-2006. Outline – Lecture 4 1. Simple

EViews implementation

normal autoregressive

renamed

Page 21: ECON 343 Lecture 4 : Smoothing and Extrapolation of Time ... · Lecture 4 : Smoothing and Extrapolation of Time Series Jad Chaaban Spring 2005-2006. Outline – Lecture 4 1. Simple

EViews implementation

Page 22: ECON 343 Lecture 4 : Smoothing and Extrapolation of Time ... · Lecture 4 : Smoothing and Extrapolation of Time Series Jad Chaaban Spring 2005-2006. Outline – Lecture 4 1. Simple

EViews implementation

Logarithmic autoregressive

Page 23: ECON 343 Lecture 4 : Smoothing and Extrapolation of Time ... · Lecture 4 : Smoothing and Extrapolation of Time Series Jad Chaaban Spring 2005-2006. Outline – Lecture 4 1. Simple

EViews implementation

Logarithmic autoregressive

Page 24: ECON 343 Lecture 4 : Smoothing and Extrapolation of Time ... · Lecture 4 : Smoothing and Extrapolation of Time Series Jad Chaaban Spring 2005-2006. Outline – Lecture 4 1. Simple

2. Moving Average models

Assumptions: The likely value for our series next month is a simple average of its values over the past 12 monthsNo regression used in the model

Moving Average An n-period moving average is the average value over the previous n time periods. As you move forward in time, the oldest time period is dropped from the analysis.

Weighted Moving Average An n-period weighted moving average allows you to place more weight on more recent time periods by weighting those time periods more heavily.

Page 25: ECON 343 Lecture 4 : Smoothing and Extrapolation of Time ... · Lecture 4 : Smoothing and Extrapolation of Time Series Jad Chaaban Spring 2005-2006. Outline – Lecture 4 1. Simple

Moving Average models

Formulas: Moving Average

with n time periods

Weighted Moving Average

n

yyMA n

ntt∑ −−

=),...,( 1

∑∑ −−

=

mi

nntMti yy

WMAα

αα ),...,( 1

Page 26: ECON 343 Lecture 4 : Smoothing and Extrapolation of Time ... · Lecture 4 : Smoothing and Extrapolation of Time Series Jad Chaaban Spring 2005-2006. Outline – Lecture 4 1. Simple

Excel implementation

Page 27: ECON 343 Lecture 4 : Smoothing and Extrapolation of Time ... · Lecture 4 : Smoothing and Extrapolation of Time Series Jad Chaaban Spring 2005-2006. Outline – Lecture 4 1. Simple

Excel implementation

IMF's International Price of Beef Indexmonthly, 1980-2005

0

20

40

60

80

100

120

140

160

Jan-

80

Jan-

83

Jan-

86

Jan-

89

Jan-

92

Jan-

95

Jan-

98

Jan-

01

Jan-

04

US

cen

ts p

er p

ound

Pbeef6 months MA

Page 28: ECON 343 Lecture 4 : Smoothing and Extrapolation of Time ... · Lecture 4 : Smoothing and Extrapolation of Time Series Jad Chaaban Spring 2005-2006. Outline – Lecture 4 1. Simple

3. Single Exponential Smoothing

This single exponential smoothing method is appropriate for series that move randomly above and below a constant mean with no trend nor seasonal patterns.

The smoothed series of is computed recursively, by evaluating:

where is the damping (or smoothing) factor. The smaller is the , the smoother is the series. By repeatedsubstitution, we can rewrite the recursion as

Page 29: ECON 343 Lecture 4 : Smoothing and Extrapolation of Time ... · Lecture 4 : Smoothing and Extrapolation of Time Series Jad Chaaban Spring 2005-2006. Outline – Lecture 4 1. Simple

Single Exponential Smoothing

Exponential smoothing-the forecast of yt is a weighted average of the past values of yt, where the weights decline exponentially with time.

The forecasts from single smoothing are constant for all future observations. This constant is given by:

Where T is the end of the estimation sample.

EViews uses the mean of the initial observations of yt to start the recursion. Values of α around 0.01 to 0.30 work quite well. You can also let EViews estimate to minimize the sum of squares of one-step forecast errors

Page 30: ECON 343 Lecture 4 : Smoothing and Extrapolation of Time ... · Lecture 4 : Smoothing and Extrapolation of Time Series Jad Chaaban Spring 2005-2006. Outline – Lecture 4 1. Simple

4. Double Exponential Smoothing

This method applies the single smoothing method twice (using the same parameter)

It is appropriate for series with a linear trend

Double smoothing of a series y is defined by the recursions:

where S is the single smoothed series and D is the double smoothed series. Note that double smoothing is a single parameter smoothing method with damping factor

Page 31: ECON 343 Lecture 4 : Smoothing and Extrapolation of Time ... · Lecture 4 : Smoothing and Extrapolation of Time Series Jad Chaaban Spring 2005-2006. Outline – Lecture 4 1. Simple

Double Exponential Smoothing

Forecasts from double smoothing are computed as:

This expression shows that forecasts from double smoothing lie on a linear trend with intercept

and slope

Page 32: ECON 343 Lecture 4 : Smoothing and Extrapolation of Time ... · Lecture 4 : Smoothing and Extrapolation of Time Series Jad Chaaban Spring 2005-2006. Outline – Lecture 4 1. Simple

Eviews Exponential Smoothing

Page 33: ECON 343 Lecture 4 : Smoothing and Extrapolation of Time ... · Lecture 4 : Smoothing and Extrapolation of Time Series Jad Chaaban Spring 2005-2006. Outline – Lecture 4 1. Simple

Eviews Exponential Smoothing

Page 34: ECON 343 Lecture 4 : Smoothing and Extrapolation of Time ... · Lecture 4 : Smoothing and Extrapolation of Time Series Jad Chaaban Spring 2005-2006. Outline – Lecture 4 1. Simple

5. Seasonal adjustment

If yt is a time series, then its generic element can be expressed as

yt = Lt x Ct x St x εt

where Lt : the global trend,Ct : a secular cycle (long term cyclical component),St : the seasonal variation,εt : an irregular component.

The objective is to eliminate SFirst, estimate LxC by deriving an average. For monthly data, a 12-month average:

which is free of irregular and seasonal fluctuations

)......(121~

516 −−+ +++++= ttttt yyyyy

Page 35: ECON 343 Lecture 4 : Smoothing and Extrapolation of Time ... · Lecture 4 : Smoothing and Extrapolation of Time Series Jad Chaaban Spring 2005-2006. Outline – Lecture 4 1. Simple

Seasonal adjustment

Then divide the original data by this estimate:

The next step is to eliminate εt

Average the values of St x εt corresponding to the same monthFor monthly data, suppose there are 48 months:

tt

t zyyS

CLSCL

==×=×

×××~εε

)(4 483624121 zzzzz +++=1~

........................................

)(41~

)(41~

38261422

37251311

zzzzz

zzzzz

+++=

+++=

Page 36: ECON 343 Lecture 4 : Smoothing and Extrapolation of Time ... · Lecture 4 : Smoothing and Extrapolation of Time Series Jad Chaaban Spring 2005-2006. Outline – Lecture 4 1. Simple

5. Seasonal adjustment

The sum of these seasonal indices should be 12 in this caseIf not, adjust by a factorThe final seasonal indices are used to deflate the data as follows:

.

/

/....

/

/

214

113

22

11

14

13

2

1

etc

zyy

zyy

zyy

zyy

a

a

a

a

=

=

=

=

Page 37: ECON 343 Lecture 4 : Smoothing and Extrapolation of Time ... · Lecture 4 : Smoothing and Extrapolation of Time Series Jad Chaaban Spring 2005-2006. Outline – Lecture 4 1. Simple

Eviews seasonal adjustment

Page 38: ECON 343 Lecture 4 : Smoothing and Extrapolation of Time ... · Lecture 4 : Smoothing and Extrapolation of Time Series Jad Chaaban Spring 2005-2006. Outline – Lecture 4 1. Simple

Eviews seasonal adjustment

Page 39: ECON 343 Lecture 4 : Smoothing and Extrapolation of Time ... · Lecture 4 : Smoothing and Extrapolation of Time Series Jad Chaaban Spring 2005-2006. Outline – Lecture 4 1. Simple

6. Importance of historical accidents

IMF's International Price of Beef Indexmonthly, 1980-2005

0

20

40

60

80

100

120

140

160

Jan-

80

Jan-

82

Jan-

84

Jan-

86

Jan-

88

Jan-

90

Jan-

92

Jan-

94

Jan-

96

Jan-

98

Jan-

00

Jan-

02

Jan-

04

US c

ents

per

pou

nd

Mad Cow disease, UK

Page 40: ECON 343 Lecture 4 : Smoothing and Extrapolation of Time ... · Lecture 4 : Smoothing and Extrapolation of Time Series Jad Chaaban Spring 2005-2006. Outline – Lecture 4 1. Simple

Incorporating structural breaks

Mad Cow timeline: Early 1990s: The British government insists the disease poses no threat to humans1993: 120,000 cattle have been diagnosed with Bovine Spongiform Encephalopathy BSE in BritainMay 1995: Stephen Churchill, 19, becomes the first victim of a new version of Creutzfeldt-Jakob Disease (vCJD). His is one of three vCJD deaths in 1995April 2002: First confirmed case of vCJDappears in the US, in a 22-year-old British woman living in Florida

Structural break: end of 1994

Page 41: ECON 343 Lecture 4 : Smoothing and Extrapolation of Time ... · Lecture 4 : Smoothing and Extrapolation of Time Series Jad Chaaban Spring 2005-2006. Outline – Lecture 4 1. Simple

Dummy variable

before after

Page 42: ECON 343 Lecture 4 : Smoothing and Extrapolation of Time ... · Lecture 4 : Smoothing and Extrapolation of Time Series Jad Chaaban Spring 2005-2006. Outline – Lecture 4 1. Simple

Eviews estimation

t t2cons

Page 43: ECON 343 Lecture 4 : Smoothing and Extrapolation of Time ... · Lecture 4 : Smoothing and Extrapolation of Time Series Jad Chaaban Spring 2005-2006. Outline – Lecture 4 1. Simple

Eviews estimation

Page 44: ECON 343 Lecture 4 : Smoothing and Extrapolation of Time ... · Lecture 4 : Smoothing and Extrapolation of Time Series Jad Chaaban Spring 2005-2006. Outline – Lecture 4 1. Simple

Eviews estimation graph

Page 45: ECON 343 Lecture 4 : Smoothing and Extrapolation of Time ... · Lecture 4 : Smoothing and Extrapolation of Time Series Jad Chaaban Spring 2005-2006. Outline – Lecture 4 1. Simple

Comparison

0

20

40

60

80

100

120

140

160

Jan-

80

Jan-

82

Jan-

84

Jan-

86

Jan-

88

Jan-

90

Jan-

92

Jan-

94

Jan-

96

Jan-

98

Jan-

00

Jan-

02

Jan-

04

Jan-

06

Jan-

08

Jan-

10

Forecast quadratic, no break

Forecast quadratic, with break