Professional Documents
Culture Documents
Time Series-1
Time Series-1
A time series is a set of observations of the same phenomenon taken at specified times,
usually at equal intervals. Examples may include; annual production of cement in Ghana over
six years, daily closing price of a share on the stock exchange over a one month period,
annual members of unemployed (in thousands) for 12 successive years, etc.
Time series analyses are basic to understanding past behavior, evaluating current
accomplishments, planning future operations, and comparing different times.
LEARNING OBJECTIVES
A time series may contain one or more of the following four components: trend, cyclical,
seasonal, and irregular variations. Let us take them one after the other and see what they are.
TREND COMPONENT: Trend is defined as the long term movement in a time series. In
other words, an increase or decrease in the values of a variable occurring a period of several
years gives a trend. A trend curve shows the long-run pattern in the growth or decline in a
time series that may represent a variable such as sales, inventories, revenues, profits,
employment, investment, expenditure etc.
33
It indicates the presence of factors that persist for a considerable duration – factors such as
demographic changes, technological improvements, price level changes, changes in tastes
and preference of consumers etc.
The value(Y) of a time series depends on the four components, T, C, S and I. That is, the
value of Y is determined by the values of T, C, S and I; representing Trend, Cyclical,
Seasonal and Irregular respectively.
Two classical time series models that present Y as function of the four components are
additive and multiplicative time series models.
34
ADDITIVE TIME SERIES MODEL
According to this model the actual value (Y) of a time series is given by the sum of the four
components. The model is written as
Suppose we have data on quarterly sales (in millions of cedis) of an auto company. The for
this time series, Y will be the actual sales for a given quarter. The values of T, C, S and I will
give the four components that when added together equal the value of Y. For example, for
the 4th quarter of 20 x 2 for this company,
then the additive model gives
These values show that based on past historical data the trend indicates that this company’s
sales should have been GH¢513m for value because of poor economic conditions; because
the sale of automobiles in the 4th quarter for this company usually are higher than the sales in
other quarters; it is GH¢2m above the average sales because of chance.
With this time series model, the actual value of a time series is obtained by multiplying the
values of the four components. This model is written as
In this model, whereas the value of T is measured in the same units as that of Y, the values of
C, S and I are measured in relative terms. For example, suppose that for the sales of the auto
company in the 1st quarter of 20 x 2, T = GH¢300m, C = 0.90, S =1.30 and I = 1.20 then the
multiplicative model gives
It is to be noted that a value of more than 1.0 for any components C, S, or I indicates that the
relative effect of that component is above the trend, and a value of less than 1.0 for any of
these 3 components means that the relative effect of that component is below the trend.
MEASURING LINEAR TREND: The long-term trend of many business series, such as
sales, exports, and production, often approximates a straight line. A number of methods can
35
be used to estimate the long-term trend in a time series. One method to measure the linear
trend is the least squares method that is using the simple linear regression model.
let the trend equation be
where Y = trend value
a= the Y – intercept
b= the slope of the line or the average change in Y for each change of
one unit of x
Example 1
The sales of PQR Ltd a small retail store since 20x1 are
Solution 1
(a) To simplify the calculations, the years are replaced by coded values. That is, we let
20x1 be I, 20x2 be 2 and so on (see the table below) representing values of x.
36
Let the trend equation be Y a bx , where
1109500
5660.7
196
y x 684000 28
and a b a 5660.7
n n 7 7
97714.3 22642.8 75071.5
The trend equation is Y 75071.5 5660.7 x
The moving average method is used in smoothing out a time series. Unlike the least squares
method (which expresses the trend in terms of a mathematical equation), the moving average
method merely removes the fluctuations in the data. The n-order moving average are the
means of each set of n consecutive observations. To calculate each successive n-order
moving average, we drop the first calculate the previous n-order moving average and include
the next available observation.
Thus, given a set of numbers, Y1, Y2, Y3… we define a moving average of order n to be
given by the sequence of arithmetic means
Y1 Y2 Y3 Yn Y2 Y3 Y4 Yn 1 Y3 Y4 Yn 1 ,
, ,
n n n
The sums in the numerators are called moving totals of order n. Each moving average value
is associated with the mid-point of the time period it represents. The moving average curve
gives a general idea of the trend.
37
Example 2
The following table shows the numbers of babies born in a village from 1993 to 2003.
Year 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003
No. of 500 300 800 600 1200 700 1400 1300 1200 1700 1500
Babies
SOLUTION
38
b.
NOTE
To obtain the moving average for a five year period, we add up 500 300 800 600 1200
and divide by 5. The result is placed by 1995. For the next year, we add up
300 800 600 1200 700 and again divide by 5 and place the results by 1996 and so on.
Each moving-average trend value calculated must correspond with an appropriate time point.
This can always be determined as the median of the time points for the values being
averaged. For moving-averages with an odd-numbered period, the median is one of the time
points. For example, where the moving average obtained was set against the third value of
the respective set being averaged.
However, when the moving averages have an even-numbered period, there is no obvious and
natural time point corresponding to each calculated average and this has to place in between
two corresponding time points. To overcome this problem, a method known as centering is
used where the calculated averages are themselves averaged in successive overlapping pairs.
This method ensures that each calculated (trend) value “lines up” with a time point.
39
Example 3
When using a moving average method described before, each of the observations used to
compute the forecasted value is weighted equally. In certain cases, it might be beneficial to
put more weight on the observations that are closer to the time period being forecast. When
this is done by using weighted moving average technique. The weighted moving average
models assume that closet time periods is more accurate predictor of future. And that large
weight is given to the closet periods.
w1 At n 1 w2 At n 2 w3 At n 3 ... wn At
Weighted MA(n) Ft 1 n
wi
i 1
w1 At 2 w2 At 1 w3 At
For example Weighted MA(3) Ft 1
w1 w2 w3
Note:
n
If the sum of the weights 1(i.e. wi 1 ), we can write our weighted MA(n) as
i 1
40
Where At n 1 , At n 2 , At n 3 ... At are the actual observations of the respective periods; and
Example
The demand for labour hours for a certain project is given each month as follows:
Month 1 2 3 4 5 6 7 8 9 10
Demand 120 110 90 115 125 117 121 126 132 128
The project officer is asked to forecast the demand for the 11th month using three period
weighted moving average techniques using the weights.
i. 0.2, 0.3 and 0.5
ii. 4,6 and 8
Solution
i. Using the weights 0.2, 0.3 and 0.5, we calculate the weighted moving average for the
11th month as follows.
Weighted MA(3) F11 0.2(126) 0.3(132) 0.5(128) 25.2 39.6 64 128.8
NB: 0.2+0.3+0.5=1
ii. Using the weights 4, 5 and 8, we calculate the weighted moving average for the 11th
month as follows.
4(126) 6(132) 10(128) 504 792 1280
Weighted MA(3) Ft 1
4 6 10 20
2576
128.8
20
SEASONAL VARIATION
Business series such as sales of clothes, alcoholic beverages, shoes, automobile etc exhibit
seasonal characteristics. There are periods where sales are above average and others where
sales are below average activity each year.
41
There is the need to analyse seasonal effects on time series values so as to know how to plan
production and sales to match demand fluctuations.
Analysis of seasonal variations over a period of years can help in evaluating current sales. In
the area of production, analysing seasonal variations will also help management to have
sufficient supply of raw materials on hand to meet the varying seasonal demand.
One of the methods used to find the seasonal pattern is the ratio-to-moving-average method.
This method eliminates the trend cyclical and irregular components from a time series and
isolates the seasonal variations.
Example 4
Sales of a company specialising in garden equipment are given in GH¢’m in the following
table:
YEAR 1 2 3 4
2001 2.34 9.26 6.53 4.31
2002 2.75 9.78 7.04 4.72
2003 2.96 10.03 7.28 4.98
42
Solution
Computations needed for the specific seasonal indexes are shown in the table below:
Quarter
YEAR 1 2 3 4
2001 1.154 0.746
2002 0.465 1.624 1.149 0.763
2003 0.474 1.594
Total 0.939 3.218 2.303 1.509
Mean 0.47 1.611 1.151 0.755
Seasonal Index 0.471 1.615 1.157 0.756
The following steps explain how columns four through seven in the table have been
constructed:
43
Step 1 Calculate the 4 –period moving totals
Step 2 Calculate the 4 –period moving averages
Step 3 Compute the centered moving averages
Step 4 Calculate the seasonal relatives
The seasonal indexes are computed from the seasonal relatives using the following steps:
The following steps can be followed in determining the seasonal index using the least squares
method:
Step 1 Calculate the trend equation using the least squares method
Step 2 Estimate the values for each quarter using t he trend equation calculated in
step 1.
Step 3 Calculate the percentage variation of each quarter’s actual values from the
estimated values obtained in step 2.
Step 4 Compute the average percentage variations from step 3. This establishes
the average seasonal variations.
Example 5
Using the data for example
(a) establish the trend equation by the least squares method
(b) compute the average seasonal variations
44
Solution
Year` Quarter Sales XY X2 Ye Y/Ye %
X Y
2001 1 2.34 2.34 1 5.382 43.48
2 9.26 18.52 4 5.494 168.55
3 6.53 19.59 9 5.606 116.48
4 4.31 17.24 16 5.718 75.38
2002 5 2.75 13.75 25 5.830 47.17
6 9.78 58.68 36 5.942 164.59
7 7.04 49.28 49 6.054 116.29
8 4.72 37.76 64 6.166 76.55
2003 9 2.96 26.64 81 6.278 47.15
10 10.03 100.30 100 6.390 156.96
11 7.28 80.08 121 6.502 111.97
12 4.98 59.76 144 6.614 75.29
79 71.98 483.94
n xy x y 12 4883.94 78 71.98
Where b 2 2
n x 2
x 12 650 78
y x 71.98 78
and a b 0.112 5.998 0.728 5.27
n n 12 12
45
Quarter
YEAR 1 2 3 4
% % % %
2001 43.48 168.55 116.48 75.38
2002 47.17 164.59 116.29 76.55
2003 47.15 156.96 111.97 75.29
Total 137.80 490.10 344.74 227.22
Average 45.93 163.37 114.91 75.74
Step 1: Compute the trend values either suing the moving average method or the
least squares method
Step 2: Get the difference between the trend values and the actual values
Step 3: Compute the mean of the variations for the same quarter of all years.
Example 6
The sales of a company specialising in garden equipment are given (in millions of cedis) in
the following table:
46
Quarter
YEAR 1 2 3 4
2001 2.34 9.26 6.53 4.31
2002 2.75 9.78 7.04 4.72
2003 2.96 10.03 7.28 4.98
Using the method of least squares, establish the trend equation and compute the average
seasonal variations in absolute terms.
Solution
From example 5 Ye 5.27 0.112 x and using columns 2, 3 and 6, column 7 is obtain
by applying Y Ye
Quarter Y Ye Y –Ye
X
1 2.34 5.382 -3.042
2 9.26 5.494 3.766
3 6.53 5.606 0.924
4 4.31 5.718 -1.408
5 2.75 5.830 -3.08
6 9.78 5.942 3.830
7 7.04 6.054 0.986
8 4.72 6.166 -1.446
9 2.96 6.278 -3.318
10 10.03 6.390 3.64
11 7.28 6.502 0.778
12 4.98 6.64 -1.634
Finding the average seasonal variations
47
Quarter
YEAR 1 2 3 4
2001 -3.04 3.77 0.92 -1.41
2002 -3.08 3.84 0.99 -1.45
2003 -3.32 3.64 0.78 -1.63
Total -9.44 11.25 2.69 -4.49
Average -3.15 3.75 0.9 -1.50
Business life would be much easier if level of activities for the future were known with
certainty. But knowing what will happen in the next one hour or so is very difficult to predict.
Businesses therefore depend on estimates of future values which are based on previous or
historical values.
Time series analysis is one of the techniques used in forecasting or estimating future values
of a business activity. The following steps may be followed when using time series for
forecasting:
Step 1: Compute a trend value for the time point using either the least squares
method or the moving average method.
Step 2: Identify the seasonal variation value appropriate to the time point
Step 3: Add these two values together if seasonal variation values are given in
absolute terms (Additive model) OR multiply these two values of seasonal
variation values are given in relative terms (multiplicative model)
Solution
48
The trend estimates are
Quarter 1: Ye 5.27 0.112 13 6.726
2: Ye 5.27 0.112 14 6.838
3: Ye 5.27 0.112 15 6.95
4: Ye 5.27 0.112 16 7.062
Step 3 Multiply the trend values by the seasonal variation values to obtain the
required forecasts.
Seasonal variation:
Quarter 1 -19.5
2 202.0
3 –242
4 59.5
49
Solution
Estimate trend values for the relevant time points.
Range of trend values 688 650 38
The last trend value given is 688 for 2003 quarter 2. This is used as a base value of which is
added the appropriate number of multiplies of 5.
Add the trend values to seasonal variation to give the required forecasts.
EXPONENTIAL SMOOTHING
A weighted averaging method based on previous forecast plus a percentage of the forecast
error. Each new forecast is based on the previous forecast plus a percentage of the difference
between that forecast and the actual value of the series at that point. That is:
Ft 1 Ft ( At Ft )
Where
Ft 1 =the smoothed forecast for the next time period
50
Ft =the forecast for the current time period
The smoothing constant represents a percentage of the forecast error. Each new forecast is
equal to the previous forecast plus a percentage of the previous error. For example, suppose
the current forecast is 40 units, actual demand is 35 units, and 0.2 . The new forecast,
Ft 1 , would be computed as follows:
Ft 1 40 0.2(35 40) 40 1 39
Selecting a smoothing constant is basically a matter of judgment or trial and error, using
forecast errors to guide the decision. The goal is to select a smoothing constant that balances
the benefits of smoothing random variations with the benefits of responding to real changes if
and when they occur.
Commonly used values of range from to . Low values of are used when the
underlying average tends to be stable; higher values are used when the underlying average is
susceptible to change.
Exponential smoothing should begin several periods back to enable forecasts to adjust to the
data, instead of starting one period back. A number of different approaches can be used to
obtain a starting forecast, such as the average of the first several periods, a subjective
estimate, or the first actual value as the forecast for period 2 (i.e., the naïve approach). For
simplicity, the naive approach is used in this book. In practice, using an average of, say, the
first three values as a forecast for period 4 would provide a better starting forecast because
that would tend to be more representative.
Each business has its forecast model to provide the forecast. However, forecasters need to
monitor a forecast to determine when it might be advantageous to change or update the
model. A tracking signal provides a method for doing this by quantifying bias. The most
51
frequently used tracking method is to compute the cumulative forecast error divided by the
value of MAD at that point in time:
( At Ft )
Tracking Signal =
MAD
MAD (mean absolute deviation) is a common measure of forecast error. It is easily calculated
by adding the absolute value of forecast errors in each period, and taking the average of this
total.
Example
Actual 0.5
Period Forecast Error Absolute Error
Demand Forecast
1 120
2 100 120 -20 20
3 90 110 -20 20
4 130 100 30 30
5 140 115 25 25
6 160 127.5 32.5 32.5
MAD = (20+20+30+25+32.5)/5=25.5
A Tracking Signal indicates if the forecast is consistently biased high or low.
1 120
2 100 120 -20 -20 20
3 90 110 -20 -40 20 (20+20)/2 = 20 -40/20= -2
-
4 130 100 30 -10 30 (20+20+30)/3= 23.33 10/23.33=-
0.43
(20+20+30+25)/4= 5/23.75 =
5 140 115 25 5 25
23.75 .21
(20+20+30+25+32.5)/5
6 160 127.5 32.5 37.5 32.5 37.5/25.5=
= 25.5
1.47
52
The movement of the tracking signal is compared to control limits; as long as the tracking
signal is within these limits, the forecast is in control. Control limits of ±2 to ±4 are used
most frequently. Values outside this rage indicate that you should re-evaluate the model used.
Therefore, our example shows that this forecast is in control.
Forecast Accuracy
Actualt Forecastt e
MAD
n n
2
( Actualt Forecastt ) e2
MSE
n 1 n 1
Actualt Forecast e
x100 x100
Actualt Actualt
MAPE
n n
One use for these measures is to compare the accuracy of alternative forecasting methods.
For instance, a manager could compare the results to determine one which yields the lowest
MAD, MSE, or MAPE for a given set of data.
Another use is to track error performance over time to decide if attention is needed. Is error
performance getting better or worse, or is it staying about the same?
Example
ERN Consult is bidding for forecasting of sales contract from Ama Nkrabea. The tendering
documents should include the forecast alternatives of Ama Nkrabea sales over 10 months and
an evaluation of the accuracy of the particular model. Table xx presents sales and
forecast under moving average and exponential smoothing models.
53
Forecasts
Actual Moving Exponential
period sales Average Smoothing
1 100
2 130 115 100
3 110 120 118
4 140 125 106
5 150 140 124
6 150 155 136
7 165 160 130
8 160 150 136
9 165 160 148
10 170 175 154
a. Are the two forecast in control if the control limit for Ama Nkrabea is ±5
b. Compare the forecast accuracy of the two model using
i. mean absolute deviation (MAD)
ii. mean squared error (MSE), and
iii. mean absolute percent error (MAPE).
54
Solution
a. To check whether the forecasts are in control, we need to compute the Tracking Signal of
the two forecasts
The tracking signals falls within the control limit of ±5 and therefore the forecast is in
control.
55
Tracking Signal of Moving Average forecast
Actual Exponential Forecast Cum Absolute Tracking
Period sales Smoothing Error error error MAD signal
1 100
2 130 100 30 30 30
3 110 118 -8 22 8 19 1.16
4 140 106 34 56 34 24 2.33
5 150 124 26 82 26 24.5 3.35
6 150 136 14 96 14 22.4 4.29
7 165 130 35 131 35 24.5 5.35
8 160 136 24 155 24 24.43 6.34
9 165 148 17 172 17 23.5 7.32
10 170 154 16 188 16 22.67 8.29
The tracking signal for periods 7,8,9 and 10 fall outside the control limit of ±5 and therefore
the forecast is not in control. In cases like this it is recommended you re-forecast using
different model or change the smoothing constant for the case of exponential smoothing.
56
b.
We compute the MAD, MSE and MAPE of the moving average as follows
e 80
MADMA 8.89
n 9
e2850
MSEMA 106.25
n 1 9 1
e
x100
Actualt 56.59
MAPEMA 6.29
n 9
Similarly, we compute MAD, MSE and MAPE of the exponential smoothing as follows
e 204
MADExp 22.67
n 9
e2 5338
MSEMA 667.25
n 1 9 1
e
x100
Actualt 166.56
MAPE MA 18.51
n 9
57
For each of MAD, MSE and MAPE, the forecast with the lowest value is preferred. From
our computations, the moving average forecast is more accurate than the exponential
smoothing forecast.
REVIEW QUESTIONS
2. Briefly explain the additive and the multiplicative time series models.
3. For an additive time series model, the values for Y,C, S and I for the third quarter of
2003 sales for a company are GH¢7 million and - GH¢5 million respectively. What is
the trend value for this quarter’s sales?
4. For a multiplicative time series model, the values for Y, T, S and I are GH¢200
million, 170 million 1.25 and 1.20 respectively. Calculate the approximate value of
C.
5. The following tables show the sales in millions of cedis of a supermarket for the
months of 2003.
Month Jan Feb March April May June July Aug Oct Nov Dec
Sales (GH¢’m) 47 56 50 55 72 71 72 75 79 83 79
(a) Find the Linear trend line using the least squares method. Show the actual time series
curve and the trend line for the sales on a graph.
(b) Using the estimated trend line, predict the sales for January and February 2004.
6. The managers of a company are preparing revenue plans for the last quarter of 2003
and for the first three quarters of 2004. The data below refer to one of the main
products:
58
Quarter
59