© 2000 John Petroff 

2) Decomposition (continued)

To decompose the trend from the data an OLS regression could be run with linear or nonlinear assumption on the seasonally adjusted data. The regression is run on the seasonally adjusted data to avoid distortions due to seasonality. The b coefficient gives the rate of growth. To simplify the calculation, time periods are coded from -tt/2 to +tt/2 where tt is the total number of time periods. That is, for 144 monthly observations from January 1985 to December 1996, January 1985 would be -72 and December 1996 would be +72. This simplifies formulas for coefficient estimates (presented in the previous section) because the sum of t (i.e. X in the previous section) is then just zero. Coefficient estimate a* (i.e. the intercept) is simply

a* = sum(Yt) / n = E(Y)

Coefficient estimate b* is

b* = sum(ttYt) / sum(tt2)

as can be verified from the derivations presented in the appendix. The calculation of the trend values Tt for each month (i.e. the fitted value with the trend) can be just as easily calculated directly in a spreadsheet by applying the formula

Tt = a + b Yt = E(Y) + Yt(sum(ttYt) / sum(tt2))

 To illustrate how the trend is derived we continue with the previous example presented in Table T-5.31 below using a spreadsheet as it is carried out in classical decomposition. The coefficient estimates derived in T-5.31 are

a* = Sum(Yt) / n = Ave(Yt) = 1117

b* = sum(ttYt) / sum(tt2) = 86454 / 18910 = 4.57

Table T-5.31

Trend in Sales January 1995 to December 1999

Year

Month

Actual sales

Adjusted sales

Time period
Time
x
Series
Time
x
Time

Trend in Sales

.

.

Ave=1118

Ave=1117

Ave=0

Sum=86454

Sum=18910

Ave=1117

1995

Janauary

820

918

-30

-27540

900

980

February

775

1052

-29

-30508

841

984

March

805

1002

-28

-28056

784

989

April

890

1002

-27

-27054

729

994

May

980

1001

-26

-26026

676

998

June

1150

1016

-25

-25400

625

1003

July

1270

1033

-24

-24792

576

1007

August

1250

1034

-23

-23782

529

1012

September

1210

1020

-22

-22440

484

1016

October

950

1050

-21

-22050

441

1021

November

970

1036

-20

-20720

400

1026

December

1120

1016

-19

-19304

361

1030

1996

Janaury

840

941

-18

-16938

324

1035

February

760

1031

-17

-17527

289

1039

March

790

984

-16

-15744

256

1044

April

880

991

-15

-14865

225

1048

May

960

981

-14

-13734

196

1053

June

1170

1033

-13

-13429

169

1058

July

1290

1050

-12

-12600

144

1062

August

1300

1075

-11

-11825

121

1067

September

1260

1063

-10

-10630

100

1071

October

970

1072

-9

-9648

81

1076

November

1020

1089

-8

-8712

64

1080

December

1210

1098

-7

-7686

49

1085

1997

January

1050

1176

-6

-7056

36

1090

February

920

1248

-5

-6240

25

1094

March

850

1058

-4

-4232

16

1099

April

970

1092

-3

-3276

9

1103

May

1020

1042

-2

-2084

4

1108

June

1250

1104

-1

-1104

1

1112

July

1380

1123

1

1123

1

1122

August

1380

1141

2

2282

4

1126

September

1350

1138

3

3414

9

1131

October

1060

1171

4

4684

16

1135

November

1050

1121

5

5605

25

1140

December

1310

1189

6

7134

36

1144

1998

January

1080

1210

7

8470

49

1149

February

700

950

8

7600

64

1154

March

990

1233

9

11097

81

1158

April

1090

1227

10

12270

100

1163

May

1260

1287

11

14157

121

1167

June

1370

1210

12

14520

144

1172

July

1440

1172

13

15236

169

1176

August

1380

1141

14

15974

196

1181

September

1410

1189

15

17835

225

1186

October

1020

1127

16

18032

256

1190

November

1120

1196

17

20332

289

1195

December

1280

1161

18

20898

324

1199

1999

January

1040

1165

19

22135

361

1204

February

930

1262

20

25240

400

1208

March

1010

1258

21

26418

441

1213

April

1100

1238

22

27236

484

1218

May

1230

1257

23

28911

529

1222

June

1390

1227

24

29448

576

1227

July

1480

1204

25

30100

625

1231

August

1430

1183

26

30758

676

1236

September

1520

1282

27

34614

729

1240

October

1080

1193

28

33404

784

1245

November

1190

1271

29

36859

841

1250

December

1310

1189

30

35670

900

1254

Graph G-5.4 below shows the trend line.

Graph G-5.4

After dividing the original data by seasonal indexes (St) and trend values (Tt) what is left is any possible cyclical pattern and erratic (i.e. random) variations that may still be there. The cyclical pattern is estimated with a moving average procedure similar to the one used for seasonal variations. Naturally a length of cycle must be chosen by the analyst, and unfortunately, there is no theoretical guidance for this choice. The longer the cycle length chosen the more erratic variations will be removed.

 After removing trend from the deseasonalized sales data, the residual that remains is shown in Graph G-5.5 below.

Graph G-5.5

Graph G-5.5 shows that the unusual spikes in March 97 and February 98 are outliers. An analyst may want to remove such outliers from the original actual data, replace them by the seasonally adjusted averages for those months, and undertake a new decomposition to achieve further improvement forecast quality. But even without removing outliers forecasts can be acceptable. In our example, the cyclical component is removed from the data with an assumption of a six months pattern. The final step is to show the forecasted values which are obtained by multiplying time by the estimated b* and adding a* to build trend values, then multiplying by seasonal indecis and cyclical indecis. The calculation of the forecasted values in presented in .Appendix 5b. The forecated values are plotted in Graph G-5.6 below.

Graph G-5.6

Graph G-5.6 clearly reveals that the forecasted values within the data sample match the actual values quiet well. It is reasonable to consider the forecasted values beyond the sample (shown in green in the graph for January through December 2000) also to be reliable predictions.

The traditional decomposition method gives very good estimated values within the sample period because all estimates are determined with the sample itself. Beyond the sample period, projections are still good for a month or two. The accuracy is indeed so good that the US government uses this procedure (called Census II) to make forecasts of income and consumption. Beyond one year, it would be dangerous to rely on forecasts generated solely by this procedure.

See review question Q-5F5.1.

 

 Previous: Decomposition

Last modified: Jun/01/01
 Next: Data smoothing