Seasonal decomposition method in forecastinganna.lamek/ZAJECIA/... · Decomposition Model...

Preview:

Citation preview

Seasonal decompositionmethod in forecasting

Introduction

•One approach to the analysis of timeseries data is based on smoothing pastdata in order to separate the underlyingpattern in the data series fromrandomness.

•The underlying pattern then can beprojected into the future and used as theforecast.

Introduction

•The underlying pattern can also be divided into sub patterns to identify the component factors that influence each of the values in a series.

•This procedure is called decomposition.

•Decomposition methods usually try to identify two separate components of the basic underlying pattern that tend to characterize economics and business series.• Trend Cycle

• Seasonal Factors

Introduction

•The trend cycle represents long term changes in the level of series.

•The seasonal factor is the periodic fluctuations of constant length that is usually caused by known factors such as rainfall, month of the year, temperature, timing of the Holidays, etc.

•The decomposition model assumes that the data has the following form:

Data = Pattern + Error

= f (trend-cycle, Seasonality , error)

Decomposition Model

•Mathematical representation of the decomposition approach is:

• Yt is the time series value (actual data) at period t.

• St is the seasonal component ( index) at period t.

• Tt is the trend cycle component at period t.

• Et is the irregular (remainder) component at period t.

),,( tttt ETSfY

Decomposition Model

• The exact functional form depends on the decomposition model actually used. Two common approaches are:

• Additive Model

• Multiplicative Model

tttt ETSY

tttt ETSY

Decomposition Model

• An additive model is appropriate if the magnitude of the seasonal fluctuation does not vary with the level of the series.

Decomposition Model

• Multiplicative model is more prevalent with economic series since most seasonal economic series have seasonal variation which increases with the level of the series.

Seasonal Adjustment

• A useful by-product of decomposition is that it provides an easy way to calculate seasonally adjusted data.

• For additive decomposition, the seasonally adjusted data are computed by subtracting the seasonal component.

tttt ETSY

Seasonal Adjustment

• For Multiplicative decomposition, the seasonally adjusted data are computed by dividing the original observation by the seasonal component.

tt

t

t ETS

Y

Deseasonalizing the data and Finding Seasonal Indexes

• In general:• Seasonal adjustment allows comparison of values at

different points in time.

• It is easier to understand the relationship among economic or business variables when seasonality is removed from the data.

• Seasonal adjustment may be a useful element in the production of short term forecasts of future values of a time series.

Trend

Source: http://www.ioz.pwr.wroc.pl/Pracownicy/gladysz/

PERIOD t observation

y tend y^ error=y-y^I 93 1 32 28,18 3,82II 93 2 21 26,16 -5,16I 94 3 27 24,15 2,85II 94 4 19 22,13 -3,13I 95 5 22 20,11 1,89II 95 6 16 18,09 -2,09I 96 7 18 16,07 1,93II 96 8 11 14,05 -3,05I 97 9 17 12,04 4,96II 97 10 8 10,02 -2,02

-10,00

-5,00

0,00

5,00

10,00

0 2 4 6 8 10 12

Skła

dn

iki r

esz

tow

e

Zmienna X 1

ERRORS

y = -2,0182t + 30,2

0

5

10

15

20

25

30

35

0 2 4 6 8 10 12

Zmienna X 1

Correlation coefficient

Determination coefficient

Source: http://www.ioz.pwr.wroc.pl/Pracownicy/gladysz/

Seasonal decomposition method (multiplicative model)

Source: http://www.ioz.pwr.wroc.pl/Pracownicy/gladysz/

Period t y observation trend y^error

e= y-y^ APE=|e|/y

I 93 1 32 28,182 3,82 11,93%

II 93 2 21 26,164 -5,16 24,59%

I 94 3 27 24,145 2,85 10,57%

II 94 4 19 22,127 -3,13 16,46%

I 95 5 22 20,109 1,89 8,60%

II 95 6 16 18,091 -2,09 13,07%

I 96 7 18 16,073 1,93 10,71%

II 96 8 11 14,055 -3,05 27,77%

I 97 9 17 12,036 4,96 29,20%

II 97 10 8 10,018 -2,02 25,23%

avg 17,81%

APE – absolute percentage errory = -2,0182x + 30,2

R² = 1

0

5

10

15

20

25

30

35

0 2 4 6 8 10 12

Y

X 1

-6

-4

-2

0

2

4

6

0 5 10 15

Skła

dn

iki r

esz

tow

e

Errors

I 98 11 8,00

II 98 12 5,98

forecast

Seasonal and random fluctuation

Source: http://www.ioz.pwr.wroc.pl/Pracownicy/gladysz/

Period z1=y1/y^1 z2=y2/y^2 y1* y2* error e= y-y* APE=|e|/y

I 93 1,135 33,12 -1,12 3,50%

II 93 0,80 21,58 -0,58 2,76%

I 94 1,118 28,38 -1,38 5,09%

II 94 0,86 18,25 0,75 3,94%

I 95 1,094 23,63 -1,63 7,42%

II 95 0,88 14,92 1,08 6,74%

I 96 1,120 18,89 -0,89 4,94%

II 96 0,78 11,59 -0,59 5,39%

I 97 1,412 14,14 2,86 16,79%

II 97 0,80 8,26 -0,26 3,29%

sum 5,880 4,127 5,99%

Raw (crude) seasonal indexes (seasonal + random fluctuations)

Clear seasonal indexes (seasonal fluctuations)

Forecasts

Source: http://www.ioz.pwr.wroc.pl/Pracownicy/gladysz/

Seasonal decomposition method(additive model)

• Trend

Source: http://www.ioz.pwr.wroc.pl/Pracownicy/gladysz/

period t y trend y^ error e= y-y^ APE

I 95 1 2,8 3,14 -0,34 12,00%

II 95 2 3,7 3,28 0,42 11,29%

III 95 3 3 3,43 -0,43 14,30%

IV 95 4 4,6 3,58 1,02 22,27%

I 96 5 3 3,72 -0,72 24,06%

II 96 6 4,2 3,87 0,33 7,89%

III 96 7 3,5 4,01 -0,51 14,71%

IV 96 8 5 4,16 0,84 16,77%

I 97 9 3,5 4,31 -0,81 23,08%

II 97 10 4,7 4,45 0,25 5,22%

III 97 11 4 4,60 -0,60 15,02%

IV 97 12 5,3 4,75 0,55 10,43%

avg 14,75%

y = 0,1465x + 2,9894R² = 1

0

1

2

3

4

5

6

0 2 4 6 8 10 12 14

Y

X 1

-1

0

1

2

0 5 10 15

X 1

Error

Seasonal and random fluctuation

Source: http://www.ioz.pwr.wroc.pl/Pracownicy/gladysz/

Raw (crude) seasonal indexes (seasonal + random fluctuations)

Source: http://www.ioz.pwr.wroc.pl/Pracownicy/gladysz/

Clear seasonal indexes (seasonal fluctuations)

Source: http://www.ioz.pwr.wroc.pl/Pracownicy/gladysz/

Forecasts

Source: http://www.ioz.pwr.wroc.pl/Pracownicy/gladysz/

Recommended