You are on page 1of 60

Chapter 3-Time series

Decomposition
Introduction
n One approach to the analysis of time series
data is based on smoothing past data in
order to separate the underlying pattern in
the data series from randomness.
n The underlying pattern then can be
projected into the future and used as the
forecast.
Introduction
n The underlying pattern can also be broken down
into sub patterns to identify the component factors
that influence each of the values in a series.
n This procedure is called decomposition.
n Decomposition methods usually try to identify two
separate components of the basic underlying
pattern that tend to characterize economics and
business series.
n Trend Cycle
n Seasonal Factors
Introduction
n The trend Cycle represents long term changes in
the level of series.
n 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.
n The decomposition model assumes that the data
has the following form:
Data = Pattern + Error
= f (trend-cycle, Seasonality , error)
Decomposition Model
n Mathematical representation of the decomposition
approach is:
Yt = f (St , Tt , Et )
n Yt is the time series value (actual data) at period t.
n St is the seasonal component ( index) at period t.
n Tt is the trend cycle component at period t.
n Et is the irregular (remainder) component at period t.
Decomposition Model
n The exact functional form depends on the
decomposition model actually used. Two
common approaches are:
n Additive Model
Yt = St + Tt + Et

n Multiplicative Model
Yt = St ´ Tt ´ Et
Decomposition Model
n An additive model is
appropriate if the
magnitude of the seasonal
fluctuation does not vary
with the level of the series.
n Time plot of U.S. retail
Sales of general
merchandise stores for
each month from Jan.
1992 to May 2002.
Decomposition Model
n Multiplicative model is
more prevalent with
economic series since
most seasonal economic
series have seasonal
variation which increases
with the level of the series.
n Time plot of number of
DVD players sold for each
month from April 1997 to
June 2002.
Decomposition Model
n Transformations can be used to model additively,
when the original data are not additive.
n We can fit a multiplicative relationship by fitting
an additive relationship to the logarithm of the
data, since if
Yt = St ´ Tt ´ Et
n Then
Log Yt = Log St + Log Tt + Log Et
Seasonal Adjustment
n A useful by-product of decomposition is
that it provides an easy way to calculate
seasonally adjusted data.
n For additive decomposition, the seasonally
adjusted data are computed by subtracting
the seasonal component.
Yt - St = Tt + Et
Seasonal Adjustment
n For Multiplicative decomposition, the
seasonally adjusted data are computed by
dividing the original observation by the
seasonal component.
Yt
= Tt + Et
St
n Most published economic series are
seasonally adjusted because Seasonal
variation is usually not of primary interest
Deseasonalizing the data
n The process of deseasonalizing the data has
useful results:
n The seasonalized data allow us to see better the
underlying pattern in the data.
n It provides us with measures of the extent of
seasonality in the form of seasonal indexes.
n It provides us with a tool in projecting what one
quarter’s (or month’s) observation may portend
for the entire year.
Deseasonalizing the data
n Fore example, assume you are working for a
manufacturer of major household appliances and
heard that housing starts for the first quarter were
258.4. Since your sales depend heavily new
construction, you want to project this forward for
the year. We know that housing starts show strong
seasonal components.To make a more accurate
projection you need to take this into consideration.
Suppose that the seasonal index for the first
quarter of the housing start is .797.
Deseasonalizing the data and Finding
Seasonal Indexes
n Once the Seasonal indexes are known you can
deseasonalize data by dividing by the appropriate
index that is:
Deseasonalized data = Raw data/Seasonal Index
n Therefore
258.4
Deseasonalized data = = 324.216
0.797
n Multiplying this deseasonalized value by 4 would give a
projection for the year of 1,296.864.
Deseasonalizing the data and Finding
Seasonal Indexes
n In general:
n Seasonal adjustment allows reliable comparison of
values at different points in time.
n It is easier to understand the relationship among
economic or business variables once the complicating
factor of seasonality has been removed from the data.
n Seasonal adjustment may be a useful element in the
production of short term forecasts of future values of a
time series.
Trend-Cycle Estimation
n The trend-cycle can be estimated by
smoothing the series to reduce the random
variation. There is a range of smoother
available. We will look at
n Moving Average
n Simple moving average
n Centered moving average
n Double Moving average
n Local Regression Smoothing
Simple Moving Average
n The idea behind the moving averages is that
observations which are nearby in time are also
likely to be close in value.
n The average of the points near an observation will
provide a reasonable estimate of the trend-cycle at
that observation.
n The average eliminate some of the randomness in
the data, and leaves a smooth trend-cycle
component.
Simple Moving Average
n The first question is; how many data points to
include in each average.
n Moving average of order 3 or MA(3) is when we
use averages of three points.
n Moving average of order 5 or MA(5) is when we
use averages of five points.
n The term moving average is used because each
average is computed by dropping the oldest
observation and including the next observation.
Simple Moving Average
n Simple 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 is defined as
the average consisting of an observation and the m
= (k-1)/2 points on either side.
m
1
Tt =
k
åY
j =- m
t+ j

n For example for MA(3)


1
Tt = (Yt -1 + Yt + Yt +1 )
3
1
T2 = (Y1 + Y2 + Y3 )
3
Simple Moving Average
n What is the formula for the MA(5)
smoother?
Simple Moving Average
n The number of points included in a moving
average affects the smoothness of the resulting
estimate.
n As a rule, the larger the value of k the smoother
will be the resulting trend-cycle estimate.
n Determining the appropriate length of a moving
average is an important task in decomposition
methods.
Example: Weekly Department Store Sales
Period (t) Sales (y)

n The weekly sales 1


2
5.3
4.4

figures (in millions of


3 5.4
4 5.8
5 5.6

dollars) presented in 6
7
8
4.8
5.6
5.6

the following table are 9


10
5.4
6.5

used by a major
11 5.1
12 5.8
13 5

department store to 14
15
16
6.2
5.6
6.7

determine the need for 17


18
5.2
5.5
19 5.8

temporary sales 20
21
5.1
5.8

personnel. 22
23
24
6.7
5.2
6
25 5.8
Example: Weekly Department Store Sales
Weekly Sales

5
Sales

4 Sales (y)

0
0 5 10 15 20 25 30

Weeks
Example: Weekly Department Store Sales
Period (t) Sales (y) MA(3) MA(5)
1 5.3
n Calculation of MA(3) and 2 4.4 5.03
MA(5) smoother for the weekly 3
4
5.4
5.8
5.20
5.60
5.3
5.2
department store sales. 5 5.6 5.40 5.44
6 4.8 5.33 5.48
n In applying a k-term moving 7 5.6 5.33 5.4
average, m=(k-1)/2 neighboring 8
9
5.6
5.4
5.53
5.83
5.58
5.64
points are needed on either side 10 6.5 5.67 5.68
of the observation. 11
12
5.1
5.8
5.80
5.30
5.56
5.72
n Therefore it is not possible to 13
14
5
6.2
5.67
5.60
5.54
5.86
estimate the trend-cycle close to 15 5.6 6.17 5.74

the beginning and end of series. 16


17
6.7
5.2
5.83
5.80
5.84
5.76
n To overcome this problem a 18
19
5.5
5.8
5.50
5.47
5.66
5.48
shorter length moving average 20 5.1 5.57 5.78
21 5.8 5.87 5.72
can be used. 22 6.7 5.90 5.76
23 5.2 5.97 5.9
24 6 5.67
25 5.8
Example: Weekly Department Store Sales
Weekly Department Store Sales

Sales (y)
Week

4 MA(3)
MA(5)

0
0 5 10 15 20 25 30
Sales
Centered Moving Average
n The simple moving average required an odd
number of observations to be included in
each average. This was to ensure that the
average was centered at the middle of the
data values being averaged.
n What about moving average with an even
number of observations?
n For example MA(4)
Centered Moving Average
n To calculate a MA(4) for the weekly sales data, the trend
cycle at time 3 can be calculated as
5.3 + 4.4 + 5.4 + 5.8
= 5.225
4
or
4.4 + 5.4 + 5.8 + 5.6
= 5.3
4

n The center of the first moving average is at 2.5 (half period


early) and the center of the second moving average is at
3.5 (half period late).
n How ever the center of the two moving averages is
centered at 3.
Centered Moving Average
n A centered moving average can be
expressed as a single but weighted moving
average, where the weights for each period
are unequal.
Y1 + Y2 + Y3 + Y4
T2.5 =
4
Y +Y +Y +Y
T3.5 = 2 3 4 5
4
T +T 1 Y +Y +Y +Y Y +Y +Y +Y
T3¢¢ = 2.5 3.5 = ( 1 2 3 4 + 2 3 4 5 )
2 2 4 4
Y + 2Y2 + 2Y3 + 2Y4 + Y5
= 1
8
Centered Moving Average
n The first and the last term in this average have
weights of 1/8 and all the other terms have
weights of 1/4.
n Therefore a 2´MA(4) smoother is equivalent to a
weighted moving average of order 5.
n In general a 2 ´MA(k) smoother is equivalent to a
weighted moving average of order k+1 with
weights 1/k for all observations except for the first
and the last observation in the average, which
have weights 1/2k.
Least squares estimates
n The general procedure for estimating the pattern
of a relationship is through fitting some functional
form in such a way as to minimize the error
component of equation
data = pattern + Error
n 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.
Least squares estimates
n A major consideration in forecasting is to identify
and fit the most appropriate pattern (functional
form) so as to minimize the MSE.
n A possible functional form is a straight line.
n Recall that a straight line is represented by the
equation
Y = a + bX
n Where the two parameters a, and b represent the
intercept and the slope respectively.
Least squares estimates
n The values a and b can be chosen by minimizing
the MSE.
n This procedure is known as simple linear
regression and will be examined in detail in
chapter 5.
n One way to estimate trend-cycle is through
extending the idea of moving averages to moving
lines.
n That is instead of taking average of the points, we
may fit a straight line to these points and estimate
trend-cycle that way.
Least squares estimates
n A straight trend line can be represented by the equation

Tt = a + bt
n The values of a and b can be found by minimizing the sum of squared
errors where the errors are the differences between the data values of
the time series and the corresponding trend line values. That is:
n

å t
(Y
t =1
- a - bt ) 2

n A straight trend line is sometimes appropriate, but there are many time
series where some curved trend is better.
Least squares estimates
n Local regression is a way of fitting a much
more flexible trend-cycle curve to the data.
n Instead of fitting a straight line to the entire
dataset, a series of straight lines will be
fitted to sections of the data.
Classical Decomposition
n Multiplicative Decomposition
n We assume the time series is multiplicative.
n This method is often called the “ratio-to
moving averages” method.
Deseasonalizing the data and Finding
Seasonal Indexes
n First the trend-cycle Tt is 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.
n These short-term fluctuations include both
seasonal and irregular variations.
n An appropriate moving average (MA) can do the
job.
Deseasonalizing the data and Finding
Seasonal Indexes
n The moving average should contain the
same number of periods as there are in the
seasonality that you want to identify.
n To identify monthly patter use MA(12)
n To identify quarterly pattern use MA(4).
n The moving average represents a “typical”
level of Y for the year that is centered on
that moving average.
Deseasonalizing the data and Finding
Seasonal Indexes
n Through the following hypothetical
example we will see how this procedure
works.
Year Quarter Time indexY 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
Deseasonalizing the data and Finding
Seasonal Indexes
n The centered moving averages represent the
deseasonalized data.
n The degree of seasonality, called seasonal
factor (SF), is the ratio of the actual value to
the deseasonalized value. That is
Yt
SFt =
CMAt
Deseasonalizing the data and Finding
Seasonal Indexes
n A seasonal factor greater than 1 indicates a
period in which Y is greater than the yearly
average, while a seasonal factor less than 1
indicates a period in which y is less than the
yearly average.
n In our example:
Y3 20
SF3 = = = 1.31
CMA3 15.25
Y4 12
SF4 = = = 0.76
CMA4 15.75
Deseasonalizing the data and Finding
Seasonal Indexes
n The seasonal indexes are calculated as follows:
n The seasonal factors for each of the four quarters (or
12 months) are summed and divided by the number of
observations to arrive at the average seasonal factors
for each quarter (or month).
n The sum of the average seasonal factors should equal
the number of periods (4 for quarters and 12 for
months).
n If it does not, the average seasonal factors should be
normalized by multiplying each by the ratio of the
number of periods to the sum of the average seasonal
factors.
Deseasonalizing the data and Finding
Seasonal Indexes
n In our example For the third quarter
Seasonal factors are 1.311475, 1.371429.
n Therefore the average is:
1.311475 + 1.371429
ASF3 = = 1.341
2
n The average of SF for the rest of the
quarters is: ASF 0.742063
4

ASF1 0.73697
ASF2 1.144451
Deseasonalizing the data and Finding
Seasonal Indexes
n 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.7222222
3 1 0.7466667
2 1.1210191
3
4

Total 3.964936 4
Finding the Long-Term Trend
n The long term movements or trend in a series can
be described by a straight line or a smooth curve.
n The long-term trend is estimated from the
deseasonalized data for the variable to be forecast.
n To find the long-term trend, we estimate a simple
linear equation as
CMA = f (Time)
CMA = a + b(Time)

n Where Time =1 for the first period in the data set and
increased by 1each quarter(or month) thereafter.
Finding the Long-Term Trend
n The method of least squares can be used to
estimate a and b.
n a and b values can be used to determine the
trend equation.
n The trend equation can be used to estimate the
trend value of the centered moving average for
the historical and forecast periods.
n This new series is the centered moving-average
trend (CMAT).
Finding the Long-Term Trend
n 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
Finding the Long-Term Trend
n The centered moving- 30

average trend equation 25

for this example is


20

CMAT = 13.40 + 0.6(TIME ) 15


Y
Centered moving average

This line is shown


Trend

n
10

along with the graph


of Y and the
5

deseasonalized data.
0
0 2 4 6 8 10 12 14
Measuring the Cyclical Component
n The cyclical component of a time series is
measured by a cycle factor (CF), which is the ratio
of the centered moving average (CMA) to the
Centered moving average trend (CMAT).
CMA
CF =
CMAT
n A cycle factor greater than 1 indicates that the
deseasonalized value for that period is above the
long-term trend of the data. If CF is less than 1,
the reverse is true.
Measuring the Cyclical component
n If the cycle factor analyzed carefully, it can be the
component that has the most to offer in terms of
understanding where the industry may be headed.
n The length and the amplitude of previous cycles may
enable us to anticipate the next tuning point in the current
cycle.
n An individual familiar with an industry can often explain
cyclic movements around trend line in terms of variables
or events that can be seen to have had some import.
n By looking at those variables or events in the present, one
can sometimes get some hint of the likely future direction
of the cycle movement.
Business Cycles
n Business cycles are
wavelike fluctuations
in the general level of
economic activity.
n They are often
described by a
diagram such as this.
Business Cycles
n Expansion Phase: The period
between the begging trough (A)
and the Peak (B).
n Recession, or Contraction
phase: the period from peak (B)
to the ending trough (C).
n The vertical distance between A
and B` provides a measure of
the degree of expansion
n The severity of a recession is
measured by the vertical
distance between B`` and C.
Business Cycles
n If business cycles
were true cycles, then
n they would have a
constant amplitude
(The vertical distance
from trough to peak).
n they would have a
constant periodicity
(the length of time
between successive
peaks or trough).
Business Cycle Indicators
n There are a number of possible business
cycle indicators, but the following three are
noteworthy
n The index of leading economic indicators
n The index of coincident economic indicators
n The index of lagging economic indicators
Components of the Composite Indexes
n Leading Index
n Average weekly hours, manufacturing
n Average weekly initial claims for unemployment insurance
n Manufacturers' new orders, consumer goods and materials
n Vendors performance, slower deliveries diffusion index
n Manufacturers’ new orders, nondefense goods
n Building permits, new private housing units
n Stock prices, 500 common stocks
n Money supply, M2
n Interest rate spread, 10 year treasury bonds less federal funds
n Index of consumer expectation
Components of the Composite Indexes
n Coincident Index
n Employees on nonagricultural payrolls
n Personal income less transfer payments
n Industrial production
n Manufacturing and trade sales
Components of the Composite Indexes
n Lagging Index
n Average duration of unemployment
n Inventories to sales ratio, manufacturing and trade
n Labor cost per unit of output, manufacturing
n Average prime rate
n Commercial and industrial loans
n Consumer installment credit to personal income ratio.
n Consumer price index for services.
n Source: www.globalindicators.org
Business Cycle Indicators
n It is possible that one of these indexes, or
one of the series that make up an index may
be useful in predicting the cycle factor in a
time series decomposition.
n These could be done in
n Regression analysis with the cycle factor (CF)
as the dependent variable.
n These indexes or their components may be used
as independent variable in a regression model.
Finding the Cyclical Factor
n The cyclical factors Year QuarterTime index Y CMA CMAT CF
1 1 1 10 14
for our example are: 2 2 18 14.6
3 3 20 15.3 15.2 1.003
CMA t
CFt = 4 4 12 15.8 15.8 0.997
CMATt
2 1 5 12 16.5 16.4 1.006
CMA3 15.3 2 6 20 17.1 17 1.007
CF3 = = = 1.003
CMAT3 15.2 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
Classical Decomposition
n Additive Decomposition
n We assume that the time series is additive. A
classical decomposition can be carried out
using the following steps.
n Step 1: The trend cycle is computed using a centered
MA of order k.
n Step2: The detrended series is computed by
subtracting the trend-cycle component from the data
Yt - Tt = St + Et
Classical Decomposition
n Additive Decomposition
n 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

You might also like