Decomposition Method
-
Upload
abdirahman-deere -
Category
Documents
-
view
220 -
download
0
Transcript of Decomposition Method
-
8/13/2019 Decomposition Method
1/73
Applied Business Forecasting
and Planning
Time Series Decomposition
-
8/13/2019 Decomposition Method
2/73
Introduction One approach to the analysis of time series
data is based on smoothing past data in
order to separate the underlying pattern inthe data series from randomness.
The underlying pattern then can be
projected into the future and used as theforecast.
-
8/13/2019 Decomposition Method
3/73
Introduction The underlying pattern can also be broken down
into sub patterns to identify the component factorsthat influence each of the values in a series.
This procedure is called decomposition.
Decomposition methods usually try to identify twoseparate components of the basic underlying
pattern that tend to characterize economics andbusiness series.
Trend Cycle
Seasonal Factors
-
8/13/2019 Decomposition Method
4/73
Introduction The trend Cycle represents long term changes in
the level of series.
The Seasonal factor is the periodic fluctuations ofconstant length that is usually caused by knownfactors such as rainfall, month of the year,temperature, timing of the Holidays, etc.
The decomposition model assumes that the datahas the following form:
Data = Pattern + Error
=f(trend-cycle, Seasonality , error)
-
8/13/2019 Decomposition Method
5/73
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
-
8/13/2019 Decomposition Method
6/73
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
-
8/13/2019 Decomposition Method
7/73
Decomposition Model An additive model is
appropriate if the
magnitude of the seasonal
fluctuation does not vary
with the level of the series.
Time plot of U.S. retail
Sales of general
merchandise stores foreach month from Jan.
1992 to May 2002.
-
8/13/2019 Decomposition Method
8/73
Decomposition Model Multiplicative model is
more prevalent witheconomic series since
most seasonal economicseries have seasonalvariation which increaseswith the level of the series.
Time plot of number ofDVD players sold for eachmonth from April 1997 toJune 2002.
-
8/13/2019 Decomposition Method
9/73
Decomposition Model Transformations can be used to model additively,
when the original data are not additive.
We can fit a multiplicative relationship by fittingan additive relationship to the logarithm of thedata, since if
Then
tttt ETSY
tttt ELogTLogSLogYLog
-
8/13/2019 Decomposition Method
10/73
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
-
8/13/2019 Decomposition Method
11/73
Seasonal Adjustment For Multiplicative decomposition, the
seasonally adjusted data are computed by
dividing the original observation by theseasonal component.
Most published economic series areseasonally adjusted because Seasonalvariation is usually not of primary interest
tt
t
t ETS
Y
-
8/13/2019 Decomposition Method
12/73
Deseasonalizing the data The process of deseasonalizing the data has
useful results:
The seasonalized data allow us to see better theunderlying pattern in the data.
It provides us with measures of the extent ofseasonality in the form of seasonal indexes.
It provides us with a tool in projecting what onequarters (or months) observation may portendfor the entire year.
-
8/13/2019 Decomposition Method
13/73
Deseasonalizing the data Fore example, assume you are working for a
manufacturer of major household appliances andheard that housing starts for the first quarter were258.4. Since your sales depend heavily on newconstruction, you want to project this forward forthe year. We know that housing starts show strongseasonal components. To make a more accurate
projection you need to take this into consideration.Suppose that the seasonal index for the firstquarter of the housing start is .797.
-
8/13/2019 Decomposition Method
14/73
Deseasonalizing the data and Finding
Seasonal Indexes Once the Seasonal indexes are known you can
deseasonalize data by dividing by the appropriate
index that is:Deseasonalized data = Raw data/Seasonal Index
Therefore
Multiplying this deseasonalized value by 4 would give a
projection for the year of 1,296.864.
216.324797.0
4.258dataizedDeseasonal
-
8/13/2019 Decomposition Method
15/73
Deseasonalizing the data and Finding
Seasonal Indexes In general:
Seasonal adjustment allows reliable comparison of
values at different points in time. It is easier to understand the relationship among
economic or business variables once the complicating
factor of seasonality has been removed from the data.
Seasonal adjustment may be a useful element in theproduction of short term forecasts of future values of a
time series.
-
8/13/2019 Decomposition Method
16/73
Trend-Cycle Estimation The trend-cycle can be estimated by
smoothing the series to reduce the random
variation. There is a range of smootheravailable. We will look at
Moving Average
Simple moving average
Centered moving average
Double Moving average
Local Regression Smoothing
-
8/13/2019 Decomposition Method
17/73
Simple Moving Average The idea behind the moving averages is that
observations which are nearby in time are also
likely to be close in value. The average of the points near an observation will
provide a reasonable estimate of the trend-cycle at
that observation.
The average eliminate some of the randomness in
the data, and leaves a smooth trend-cycle
component.
-
8/13/2019 Decomposition Method
18/73
Simple Moving Average The first question is; how many data points to
include in each average.
Moving average of order 3 or MA(3) is when weuse averages of three points.
Moving average of order 5 or MA(5) is when weuse averages of five points.
The term moving average is used because eachaverage is computed by dropping the oldestobservation and including the next observation.
-
8/13/2019 Decomposition Method
19/73
Simple Moving Average Simple centered moving averages can be defined
for any odd order. A moving average of order k,or MA(k) where k is an odd integer is defined as
the average consisting of an observation and the m= (k-1)/2 points on either side.
For example for MA(3)
m
mj
jtt Yk
T 1
)(
3
1
)(3
1
3212
11
YYYT
YYYTtttt
-
8/13/2019 Decomposition Method
20/73
Simple Moving Average What is the formula for the MA(5)
smoother?
-
8/13/2019 Decomposition Method
21/73
Simple Moving Average The number of points included in a moving
average affects the smoothness of the resulting
estimate. As a rule, the larger the value of k the smoother
will be the resulting trend-cycle estimate.
Determining the appropriate length of a moving
average is an important task in decomposition
methods.
-
8/13/2019 Decomposition Method
22/73
Example: Weekly Department Store Sales
The weekly sales
figures (in millions of
dollars) presented inthe following table are
used by a major
department store to
determine the need fortemporary sales
personnel.
Period (t) Sales (y)
1 5.3
2 4.4
3 5.4
4 5.8
5 5.6
6 4.8
7 5.68 5.6
9 5.4
10 6.5
11 5.1
12 5.8
13 5
14 6.2
15 5.6
16 6.7
17 5.218 5.5
19 5.8
20 5.1
21 5.8
22 6.7
23 5.2
24 6
25 5.8
-
8/13/2019 Decomposition Method
23/73
Example: Weekly Department Store Sales
Weekly Sales
0
1
2
3
4
5
6
7
8
0 5 10 15 20 25 30
Weeks
Sales
Sales (y)
-
8/13/2019 Decomposition Method
24/73
Example: Weekly Department Store Sales Calculation of MA(3) and
MA(5) smoother for the weeklydepartment store sales.
In applying a k-term movingaverage, m=(k-1)/2 neighboring
points are needed on either sideof the observation.
Therefore it is not possible toestimate the trend-cycle close to
the beginning and end of series. To overcome this problem a
shorter length moving averagecan be used.
Period (t) Sales (y) MA(3) MA(5)
1 5.3
2 4.4 5.03
3 5.4 5.20 5.3
4 5.8 5.60 5.2
5 5.6 5.40 5.44
6 4.8 5.33 5.48
7 5.6 5.33 5.4
8 5.6 5.53 5.58
9 5.4 5.83 5.64
10 6.5 5.67 5.68
11 5.1 5.80 5.56
12 5.8 5.30 5.72
13 5 5.67 5.54
14 6.2 5.60 5.86
15 5.6 6.17 5.74
16 6.7 5.83 5.84
17 5.2 5.80 5.76
18 5.5 5.50 5.66
19 5.8 5.47 5.48
20 5.1 5.57 5.78
21 5.8 5.87 5.72
22 6.7 5.90 5.76
23 5.2 5.97 5.9
24 6 5.67
25 5.8
-
8/13/2019 Decomposition Method
25/73
Example: Weekly Department Store SalesWeekly Department Store Sales
0
1
2
3
4
5
6
7
8
0 5 10 15 20 25 30
Sales
Week
Sales (y)
MA(3)
MA(5)
-
8/13/2019 Decomposition Method
26/73
Centered Moving Average The simple moving average required an odd
number of observations to be included in
each average. This was to ensure that theaverage was centered at the middle of thedata values being averaged.
What about moving average with an evennumber of observations?
For example MA(4)
-
8/13/2019 Decomposition Method
27/73
Centered Moving Average To calculate a MA(4) for the weekly sales data, the trend
cycle at time 3 can be calculated as
The center of the first moving average is at 2.5 (half periodearly) and the center of the second moving average is at
3.5 (half period late). How ever the center of the two moving averages is
centered at 3.
3.54
6.58.54.54.4
5
225.5
4
8.54.54.43.5
4
5432
4321
yyyy
or
yyyy
-
8/13/2019 Decomposition Method
28/73
Centered Moving Average A centered moving average can be
expressed as a single but weighted moving
average, where the weights for each periodare unequal.
8
222
)44
(2
1
2
4
4
54321
543243215.35.23
54325.3
43215.2
YYYYY
YYYYYYYYTTT
YYYYT
YYYYT
-
8/13/2019 Decomposition Method
29/73
Centered Moving Average The first and the last term in this average have
weights of 1/8 and all the other terms haveweights of 1/4.
Therefore a double MA(4) smoother is equivalentto a weighted moving average of order 5.
In general a double MA(k) smoother is equivalent
to a weightedmoving average of order k+1 withweights 1/k for all observations except for the firstand the last observation in the average, whichhave weights 1/2k.
-
8/13/2019 Decomposition Method
30/73
Least squares estimates The general procedure for estimating the pattern
of a relationship is through fitting some functional
form in such a way as to minimize the errorcomponent of equation
data = pattern + Error
The name least squares is based on the fact that
this estimation procedure seeks to minimize the
sum of the squared errors in the above equation.
-
8/13/2019 Decomposition Method
31/73
Least squares estimates A major consideration in forecasting is to identify
and fit the most appropriate pattern (functionalform) so as to minimize the MSE.
A possible functional form is a straight line.
Recall that a straight line is represented by theequation
Where the two parameters a, and b represent theintercept and the slope respectively.
bXaY
-
8/13/2019 Decomposition Method
32/73
Least squares estimates The values a and b can be chosen by minimizing
the MSE.
This procedure is known as simple linear
regression and will be examined in detail inchapter 6.
One way to estimate trend-cycle is throughextending the idea of moving averages to moving
lines. That is instead of taking average of the points, we
may fit a straight line to these points and estimatetrend-cycle that way.
-
8/13/2019 Decomposition Method
33/73
Least squares estimates A straight trend line can be represented by the equation
The values of a and b can be found by minimizing the sum of squarederrors where the errors are the differences between the data values ofthe time series and the corresponding trend line values. That is:
A straight trend line is sometimes appropriate, but there are many timeseries where some curved trend is better.
btaTt
n
t
t btaY
1
2)(
-
8/13/2019 Decomposition Method
34/73
Least squares estimates Local regression is a way of fitting a much
more flexible trend-cycle curve to the data.
Instead of fitting a straight line to the entiredataset, a series of straight lines will be
fitted to sections of the data.
-
8/13/2019 Decomposition Method
35/73
Classical Decomposition Multiplicative Decomposition
We assume the time series is multiplicative.
This method is often called the ratio-tomoving averages method.
-
8/13/2019 Decomposition Method
36/73
Deseasonalizing the data and Finding
Seasonal Indexes First the trend-cycle Ttis computed using a
centered moving average. This removes the short-
term fluctuations from the data so that the longer-term trend-cycle components can be more clearly
identified.
These short-term fluctuations include both
seasonal and irregular variations.
An appropriate moving average (MA) can do the
job.
-
8/13/2019 Decomposition Method
37/73
Deseasonalizing the data and Finding
Seasonal Indexes The moving average should contain the
same number of periods as there are in the
seasonality that you want to identify. To identify monthly patter use MA(12)
To identify quarterly pattern use MA(4).
The moving average represents a typicallevel of Y for the year that is centered onthat moving average.
-
8/13/2019 Decomposition Method
38/73
Deseasonalizing the data and Finding
Seasonal Indexes Through the following hypothetical
example we will see how this procedure
works.Year Quarter Time inde Y MA CMA
1 1 1 10
2 2 18
3 3 20
4 4 12
2 1 5 12
2 6 20
3 7 24
4 8 13
3 1 9 14
2 10 22
3 11 28
4 12 16
-
8/13/2019 Decomposition Method
39/73
Deseasonalizing the data and Finding
Seasonal Indexes The centered moving averages represent the
deseasonalized data.
The degree of seasonality, called seasonalfactor (SF), is the ratio of the actual value to
the deseasonalized value. That is
t
tt
CMAYSF
-
8/13/2019 Decomposition Method
40/73
Deseasonalizing the data and Finding
Seasonal Indexes A seasonal factor greater than 1 indicates a
period in which Y is greater than the yearly
average, while a seasonal factor less than 1indicates a period in which y is less than the
yearly average.
In our example:
76.075.15
12
31.125.15
20
4
44
3
33
CMA
YSF
CMA
YSF
-
8/13/2019 Decomposition Method
41/73
Deseasonalizing the data and Finding
Seasonal Indexes The seasonal indexes are calculated as follows:
The seasonal factors for each of the four quarters (or12 months) are summed and divided by the number of
observations to arrive at the average seasonal factorsfor each quarter (or month).
The sum of the average seasonal factors should equalthe number of periods (4 for quarters and 12 formonths).
If it does not, the average seasonal factors should benormalized by multiplying each by the ratio of thenumber of periods to the sum of the average seasonalfactors.
-
8/13/2019 Decomposition Method
42/73
Deseasonalizing the data and Finding
Seasonal Indexes In our example For the third quarter
Seasonal factors are 1.311475, 1.371429.
Therefore the average is:
The average of SF for the rest of the
quarters is:
341.12
371429.1311475.13
ASF
ASF4 0.742063
ASF1 0.73697
ASF2 1.144451
-
8/13/2019 Decomposition Method
43/73
Deseasonalizing the data and Finding
Seasonal Indexes The seasonal indexes for the four quarters
are:Year Quarter SF ASF SI
1 1
2
3 1.3114754 1.341452 1.353315
4 0.7619048 0.742063 0.748626
2 1 0.7272727 0.73697 0.743487
2 1.1678832 1.144451 1.154572
3 1.3714286
4 0.72222223 1 0.7466667
2 1.1210191
3
4
Total 3.964936 4
-
8/13/2019 Decomposition Method
44/73
Finding the Long-Term Trend The long term movements or trend in a series can
be described by a straight line or a smooth curve.
The long-term trend is estimated from thedeseasonalized data for the variable to be forecast.
To find the long-term trend, we estimate a simplelinear equation as
Where Time =1 for the first period in the data set andincreased by 1each quarter(or month) thereafter.
)()(
TimebaCMATimefCMA
-
8/13/2019 Decomposition Method
45/73
Finding the Long-Term Trend The method of least squares can be used to
estimate a and b.
a and b values can be used to determine thetrend equation.
The trend equation can be used to estimate thetrend value of the centered moving average for
the historical and forecast periods. This new series is the centered moving-average
trend (CMAT).
-
8/13/2019 Decomposition Method
46/73
Finding the Long-Term Trend For our example,The values of a and b are estimated by
using EXCEL regression program.
SUMMARY OUTPUT
Regression Statistics
Multiple R 0.995666021
R Square 0.991350826
Adjusted R Square 0.989909297
Standard Error 0.148571238
Observations 8
ANOVA
df SS MS F Significance F Regression 1 15.18005952 15.18006 687.7079 2.02856E-07
Residual 6 0.132440476 0.022073
Total 7 15.3125
Coefficients Standard Error t Stat P-value Lower 95% Upper 95%
Intercept 13.4047619 0.157999932 84.8403 1.81E-10 13.01814971 13.79137409
X Variable 1 0.601190476 0.02292504 26.22418 2.03E-07 0.545094884 0.657286069
-
8/13/2019 Decomposition Method
47/73
Finding the Long-Term Trend The centered moving-
average trend equation
for this example is
This line is shown
along with the graph
of Y and the
deseasonalized data.0
5
10
15
20
25
30
0 2 4 6 8 10 12 14
Y
Centered moving average
Trend
)(6.040.13 TIMECMAT
-
8/13/2019 Decomposition Method
48/73
Measuring the Cyclical Component The cyclical component of a time series is
measured by a cycle factor (CF), which is the ratioof the centered moving average (CMA) to the
Centered moving average trend (CMAT).
A cycle factor greater than 1 indicates that thedeseasonalized value for that period is above thelong-term trend of the data. If CF is less than 1,the reverse is true.
CMAT
CMACF
-
8/13/2019 Decomposition Method
49/73
Measuring the Cyclical component If the cycle factor analyzed carefully, it can be the
component that has the most to offer in terms ofunderstanding where the industry may be headed.
The length and the amplitude of previous cycles mayenable us to anticipate the next tuning point in the currentcycle.
An individual familiar with an industry can often explaincyclic movements around trend line in terms of variables
or events that can be seen to have had some import.
By looking at those variables or events in the present, onecan sometimes get some hint of the likely future directionof the cycle movement.
-
8/13/2019 Decomposition Method
50/73
Business Cycles Business cycles are
wavelike fluctuations
in the general level ofeconomic activity.
They are often
described by a
diagram such as this.
-
8/13/2019 Decomposition Method
51/73
Business Cycles Expansion Phase: The period
between the begging trough (A)
and the Peak (B).
Recession, or Contractionphase: the period from peak (B)
to the ending trough (C).
The vertical distance between A
and B` provides a measure of
the degree of expansion The severity of a recession is
measured by the vertical
distance between B`` and C.
-
8/13/2019 Decomposition Method
52/73
Business Cycles
If business cycleswere true cycles, then
they would have a
constant amplitude(The vertical distancefrom trough to peak).
they would have a
constant periodicity(the length of timebetween successivepeaks or trough).
-
8/13/2019 Decomposition Method
53/73
Business Cycle Indicators
There are a number of possible business
cycle indicators, but the following three are
noteworthy The index of leading economic indicators
The index of coincident economic indicators
The index of lagging economic indicators
-
8/13/2019 Decomposition Method
54/73
Components of the Composite Indexes
Leading Index
Average weekly hours, manufacturing
Average weekly initial claims for unemployment insurance
Manufacturers' new orders, consumer goods and materials
Vendors performance, slower deliveries diffusion index
Manufacturers new orders, nondefense goods
Building permits, new private housing units
Stock prices, 500 common stocks Money supply, M2
Interest rate spread, 10 year treasury bonds less federal funds
Index of consumer expectation
-
8/13/2019 Decomposition Method
55/73
Components of the Composite Indexes
Coincident Index
Employees on nonagricultural payrolls
Personal income less transfer payments
Industrial production
Manufacturing and trade sales
-
8/13/2019 Decomposition Method
56/73
Components of the Composite Indexes
Lagging Index
Average duration of unemployment
Inventories to sales ratio, manufacturing and trade Labor cost per unit of output, manufacturing
Average prime rate
Commercial and industrial loans
Consumer installment credit to personal income ratio.
Consumer price index for services.
Source: www.globalindicators.org
-
8/13/2019 Decomposition Method
57/73
Business Cycle Indicators
It is possible that one of these indexes, orone of the series that make up an index may
be useful in predicting the cycle factor in atime series decomposition.
These could be done in
Regression analysis with the cycle factor (CF)
as the dependent variable.
These indexes or their components may be usedas independent variable in a regression model.
-
8/13/2019 Decomposition Method
58/73
Finding the Cyclical Factor
The cyclical factors
for our example are:Year QuarterTime inde Y CMA CMAT CF
1 1 1 10 14
2 2 18 14.6
3 3 20 15.3 15.2 1.003
4 4 12 15.8 15.8 0.997
2 1 5 12 16.5 16.4 1.006
2 6 20 17.1 17 1.007
3 7 24 17.5 17.6 0.994
4 8 13 18 18.2 0.989
3 1 9 14 18.8 18.8 0.997
2 10 22 19.6 19.4 1.012
3 11 28
4 12 16
003.115.2
15.3
CMAT
CMACF
CMATCMACF
3
33
t
tt
-
8/13/2019 Decomposition Method
59/73
-
8/13/2019 Decomposition Method
60/73
Classical Decomposition
Additive Decomposition Step3: In classical decomposition we assume the
seasonal component is constant from year to year.So we the average of the detrended value for a given
month (for monthly data) and given quarter (for
quarterly data) will be the seasonal index for the
corresponding month or quarter.
Step4: the irregular series Etis computed by simply
subtracting the estimated seasonality, and trend-
cycle from the original data.
-
8/13/2019 Decomposition Method
61/73
-
8/13/2019 Decomposition Method
62/73
-
8/13/2019 Decomposition Method
63/73
The Time-Series Decomposition Forecast
We know how to isolate and measure thesecomponents.
To prepare a forecast based on the timeseries decomposition model, we mustreassemble the components.
The forecast for Y (FY) is:
(CF)(E)(CMAT)(SI)FY
-
8/13/2019 Decomposition Method
64/73
Example:Private Housing Start
-
8/13/2019 Decomposition Method
65/73
Example:Private Housing Start
-
8/13/2019 Decomposition Method
66/73
-
8/13/2019 Decomposition Method
67/73
Example:Private Housing Start
-
8/13/2019 Decomposition Method
68/73
Example:Private Housing Start
The centered movingaverage series, shown bythe solid line, is much
smoother than the originalseries of private housingstarts data (dashed line)
because the seasonalpattern and the irregular or
random fluctuation in thedata are removed by theprocess of calculating thecentered moving average.
-
8/13/2019 Decomposition Method
69/73
Example:Private Housing Start
The long term trend in private
housing starts is shown by the
straight dotted line
(PHSCMAT).
The dashed line is the raw data
(PHS), while the wavelike solid
line is the deseasonalized data
(PHSCMA).
The long-term trend is positive.
The equation for the trend line
is:)(313.051.237 TimePHSCMAT
-
8/13/2019 Decomposition Method
70/73
Example:Private Housing Start
The cyclical factor isthe ratio of thecentered moving
average to the long-term trend in the data.
As this plot shows, thecycle factor moves
slowly around the baseline (1.0) with littleregularity
-
8/13/2019 Decomposition Method
71/73
Example:Private Housing Start
-
8/13/2019 Decomposition Method
72/73
Example:Private Housing Start
The actual values for
private housing starts
are shown by the
dashed line, and the
forecast values based
on the time- series
decomposition modelare shown by the solid
line.
-
8/13/2019 Decomposition Method
73/73
The Time-Series Decomposition Forecast Because the time series decomposition
models do not involve a lot of mathematics
or statistics, they are relatively easy toexplain to the end user.
This is a major advantage because if the end
user has an appreciation of how the forecastwas developed, he or she may have more
confidence in its use for decision making.