Abbreviations
Appendix 1: Information and consent forms
A time series is based on a sequence of evenly spaced (weekly, monthly, quarterly, and so on) data points. Examples include weekly sales of HP personal computers, quarterly earnings reports of Microsoft Corporation, daily shipments of Eveready batteries, and annual Nigeria consumer price indices. Forecasting time-series data implies that future values are predicted only from past values of that variable (such as we saw in Table 1) and that other variables, no matter how potentially valuable, are ignored.
Components of a Time Series
Analyzing time series means breaking down past data into components and then projecting them forward. A time series typically has four components:
1. Trend (T) is the gradual upward or downward movement of the data over time.
2. Seasonality (S) is a pattern of the demand fluctuation above or below the trend line that repeats at regular intervals.
103
3. Cycles (C) are patterns in annual data that occur every several years. They are usually tied into the business cycle.
4. Random variations (R) are ―blips‖ in the data caused by chance and unusual situations; they follow no discernible pattern.
Figure 5 shows a time series and its components.
There are two general forms of time-series models in statistics. The first is a multiplicative model, which assumes that demand is the product of the four components.
It is stated as follows:
Demand = T × S × C × R (4)
An additive model adds the components together to provide an estimate. Multiple regression is often used to develop additive models. This additive relationship is stated as follows:
Demand = T + S + C + R (5)
There are other models that may be a combination of these. For example, one of the components (such as trend) might be additive while another (such as seasonality) could be multiplicative. Understanding the components of a time series will help in selecting an appropriate forecasting technique to use. If all variations in a time series are due to random variations, with no trend, seasonal, or cyclical component, some type of averaging or smoothing model would be appropriate. The averaging techniques in this unit are moving average, weighted moving average, and exponential smoothing. These methods will smooth out the forecasts and not be too heavily influenced by random variations. However, if there is a trend or seasonal pattern present in the data, then a technique which incorporates that particular component into the forecast should be used.
Two such techniques are exponential smoothing with trend and trend projections. If there is a seasonal pattern present in the data, then a seasonal index may be developed and used with any of the averaging methods. If both trend and seasonal components are present, then a method such as the decomposition method should be used.
Figure 5: Product Demand Charted over 4 Yrs, with Trend and Seasonality Indicated
104
The time series forecasting models are discussed below:
3.1.4.1 Moving Averages
Moving averages are useful if we can assume that market demands will stay fairly steady over time. For example, a four-month moving average is found simply by summing the demand during the past four months and dividing by 4. With each passing month, the most recent month‘s data are added to the sum of the previous three months‘ data, and the earliest month is dropped. This tends to smooth out short-term irregularities in the data series. An n-period moving average forecast, which serves as an estimate of the next period‘s demand, is expressed as follows:
Sum of demands in previous n periods Moving average forecast
n (6)
Mathematically, it can be written as:
1 1
1
t t ... t n
t
Y Y Y
F n
(7)
Where
1
Ft = Forecast for time period t+1 Yt= Actual value in time period t n = number of periods to average
A 4-month moving average has n = 4 a 5-month moving average has n = 5 Example
Storage shed sales at Wallace Garden Supply are shown in the middle column of Table 3.
A 3-month moving average is indicated on the right. The forecast for the next January, using this technique, is 16. Were we simply asked to find a forecast for next January, we would only have to make this one calculation. The other forecasts are necessary only if we wish to compute the MAD or another measure of accuracy.
Table 3: Wallace Garden Supply Shed Sales
Month Actual Shed Sales 3 Months Moving Average January 10
February 12
March 13
April 16 (10+12+13)/3 = 11.67
May 19 (12+13+16)/3 = 13.67
June 23 (13+16+19)/3 = 16.00
July 26 (16+19+23)/3 = 19.33
August 30 (19+23+26)/3 = 22.67
September 28 (23+26+30)/3 = 26.33
October 18 (26+30+28)/3 = 28.00
November 16 (30+28+18)/3 = 25.33
December 14 (28+18+16)/3 = 20.67
January - (18+16+14)/3 = 16.00
105
A modified version of the moving averages can be applied called the weighted moving average. A simple moving average gives the same weight to each of the past observations being used to develop the forecast. On the other hand, a weighted moving average allows different weights to be assigned to the previous observations. As the weighted moving average method typically assigns greater weight to more recent observations, this forecast is more responsive to changes in the pattern of the data that occur. However, this is also a potential drawback to this method because the heavier weight would also respond just as quickly to random fluctuations. A weighted moving average may be expressed as:
1
t
Weight in period i Actual value in period i
F weights
Mathematically, it can be written as:
1 2 1 1
1
1 2
...
...
t t n t n
t
n
w Y w Y w Y
F w w w
(8)
where
wi = weight for ith observation
Wallace Garden Supply decides to use a 3-month weighted moving average forecast with weights of 3 for the most recent observation, 2 for the next observation, and 1 for the most distant observation.
3.1.4.2 Exponential Smoothing
Exponential smoothing is a forecasting method that is easy to use and is handled efficiently by computers. Although it is a type of moving average technique, it involves little record keeping of past data. The basic exponential smoothing formula can be shown as follows:
New forecast = Last period‘s forecast + (Last period‘s actual demand – Last
period‘s forecast) (9)
where is a weight (or smoothing constant) that has a value between 0 and 1, inclusive.
Equation (9) can be re-written in mathematical form as:
1 ( )
t t t t
F F Y F (10)
Where
Ft+1 = new forecast (for time period t +1) Ft = previous forecast (for time period t)
= smoothing constant (0 1) Yt = previous period‘s actual demand
The concept here is not complex. The latest estimate of demand is equal to the old estimate adjusted by a fraction of the error (last period‘s actual demand minus the old estimate).
106
The smoothing constant,, can be changed to give more weight to recent data when the value is high or more weight to past data when it is low. For example, = 0.5, when it can be shown mathematically that the new forecast is based almost entirely on demand in the past three periods. When = 0.1, the forecast places little weight on any single period, even the most recent, and it takes many periods (about 19) of historic values into account.
Example 1
For example, in January, a demand for 142 of a certain car model for February was predicted by a dealer. Actual February demand was 153 autos. Using a smoothing constant of = 0.20, we can forecast the March demand using the exponential smoothing model. Substituting into the formula, we obtain
New forecast (for march demand) = 142 + 0.2(153 – 142), = 144.2 Example 2
Let us apply this concept with a trial-and-error testing of one value of in an example.
The port of Baltimore has unloaded large quantities of grain from ships during the past eight quarters. The port‘s operations manager wants to test the use of exponential smoothing to see how well the technique works in predicting tonnage unloaded. He assumes that the forecast of grain unloaded in the first quarter was 175 tons. Two values of is examined. Table 4 shows the detailed calculations for = 0.10 and the already calculated own of = 0.50.
Table 4: Forecasting using the Exponential Smoothing Method Quarter Actual Tonnage
Unloaded
Forecast using = 0.10 Forecast using
= 0.50
1 180 175 175
2 168 175.5 = 175.00 + 0.10(180 – 175) 177.5
3 159 174.75 = 175.50 + 0.10(168 – 175.50) 172.75 4 175 173.18 = 174.75 + 0.10(159 – 174.75) 165.88 5 190 173.36 = 173.18 + 0.10(175 – 173.18) 170.44 6 205 175.02 = 173.36 + 0.10(190 – 173.36) 180.22 7 180 178.02 = 175.02 + 0.10(205 – 175.02) 192.61 8 182 178.22 = 178.02 + 0.10(180 – 178.02) 186.30
9 ? 178.60 = 178.22 + 0.10(182 – 178.22) 184.15
3.1.4.3 Trend Projections
Another method for forecasting time series with trend is called trend projection. This technique fits a trend line to a series of historical data points and then projects the line into the future for medium- to long-range forecasts. There are several mathematical trend equations that can be developed (e.g., exponential and quadratic), but in this section we
107
look at linear (straight line) trends only. A trend line is simply a linear regression equation in which the independent variable (X) is the time period. The form of this is:
0 1
Yˆ X Where
Yˆ= Predicted Value
0= Intercept
1 = Slope of the line
X = time period (i.e. X = 1, 2, 3, …, n)
The least squares regression method may be applied to find the coefficients that minimize the sum of the squared errors, thereby also minimizing the mean squared error (MSE).
The formula for the coefficients are:
0 1
ˆ Y ˆ X
(11)
1 2
ˆ X X Y Y
X X
(12)The least squares regression method may be applied to find the coefficients that minimize the sum of the squared errors, thereby also minimizing the mean squared error (MSE).
Example
Let us consider the case of Midwestern Manufacturing Company. That firm‘s demand for electrical generators over the period 2004–2010 was given. A trend line to predict demand (Y ) based on the time period can be developed using a regression model. If we let 2004 be time period 1 then 2005 is time period 2 and so forth. The regression line can be developed using the formula. From this we get:
Table 5: Forecasting using trend
Year X Y
X X
YY
XX
Y Y
X X
22004 1 74 -3 -24.8571 74.57143 9
2005 2 79 -2 -19.8571 39.71429 4
2006 3 80 -1 -18.8571 18.85714 1
2007 4 90 0 -8.85714 0 0
2008 5 105 1 6.142857 6.142857 1
2009 6 142 2 43.14286 86.28571 4
2010 7 122 3 23.14286 69.42857 9
28 692 295 28
Following equation (11) and (12) ˆ0
= 56.71,
108
ˆ1
= 10.54
Therefore, the trend equation is given as ˆ 56.71 10.54
Y X
To project demand in 2011, we first denote the year 2011 in our new coding system as X
= 8;
(sales in 2011) = 56.71 + 10.54(8) = 141.03 or 141 generators We can estimate demand for 2012 by inserting in the same equation:
(sales in 2012) = 56.71 + 10.54(9) = 151.57, or 152 generators 3.1.4.4 Seasonal Variations
Time-series forecasting such as that in the example of Midwestern Manufacturing involves looking at the trend of data over a series of time observations. Sometimes, however, recurring variations at certain seasons of the year make a seasonal adjustment in the trend line forecast necessary.
Figure 6: Electrical Generators and the Computed Trend Line
Steps Used to Compute Seasonal Indices Based on Centred Moving Averages 1. Compute a Centered Moving Averages for each observation (where possible).
2. Compute seasonal ratio = Observation/ Centered Moving Averages for that observation.
3. Average seasonal ratios to get seasonal indices.
4. If seasonal indices do not add to the number of seasons, multiply each index by (Number of seasons)/(Sum of the indices).
SELF ASSESSMENT
Show the workings of the last column in table 4.