Department of Mathematics: Business Statistics 1
Department of Mathematics: Business Statistics 1
Department of Mathematics
Business Statistics 1
MTU 07203
Time series and Forecasting processes in
Business
Content
• Define time series and forecasting
• Explain time series cycle
• Analyze the time series
• The techniques for extracting the trend and seasonal variations
• Deseasonalization of time series
• Solve and measure the forecasting error
• Forecasting using different methods
1. Trend projection method
2. Classical decomposition method
3. Smoothing techniques
• Explain the criteria for choosing an appropriate forecasting
method
Definition
• A time series is any arrangement of a
statistical data in accordance to their time of
their occurrence.
• A time series is a name given to numerical
data that is described over a uniform set of
time period.
• Hence, time series is a chronological
arrangement of statistical data
Examples of time series
Time series occurs naturally in a
sphere of business activities, example
a. Annual production of tea in Tanzania
over the ten years
b. Annual turnover of a firm for ten
successive years
c. The import of a country over a
period of 5 years
Importance of time series
i. It helps in the understanding of the past behaviour.
An essential aspect of managing any organization is
to use past and present available data to plan for the
future
ii. It is usually applicable in forecasting or predicting
the behaviour of a phenomenon in future.
iii. Organizations usually employ forecasting techniques
to determine future inventory, costs, capacities,
interest rate changes, etc
Time series cycle
Cycles are general patterns that repeat and occur
in most types of time series.
Examples:
a. Monthly sales for a business will exhibits
some natural 12 – monthly cycle
b. Governmental report for each quarter for a
year will exhibits 4 – quarter cycle
Graphing time series
• Standard graphs for a time series is a line diagram
known as Historigram
• Time Series Data is usually plotted on a graph to
determine various characteristics or components of
the time series data.
• There are 4 Major Components or factor affecting
time series
a. Trend
b. Cyclical variation
c. Seasonal variation, and
d. Irregular variation
Trend
25
20
15
Sales
10
0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 22 23 24
year
Seasonal Variation
• These are short term cyclic fluctuations in a
time series data kushuk
a
• The seasonal component of the series accounts
for regular patterns of variability within certain
time periods, such as over a year.
• Data exhibit upward and downward swings over
a very long time frame, such as annual sales of a
product.
• There can be, for example, within-week or
within-day “seasonal” behavior.
Seasonal Variation
.
Cyclical component
• This is a periodic movement of time series
data, with the period more than one year.
• Cyclical component is fairly regular pattern of
sequences of values above and below the trend
line
• Usually, this component is due to multiyear
cyclical fluctuation movements exists in
business and economic time series.
• Business cycle contain four phases namely
prosperity, decline, depression and recovery
Cyclical Component
.
Irregular component
• The irregular component of the series is
caused by short-term, unanticipated and
non-recurring factors that affect the
values of the time series.
• One cannot attempt to predict its impact
on the time series in advance.
• In other words we can say this is due to
erratic and unpredictable variations in the
data over time with no discernable pattern
Irregular or random component
Example 1
100
80
60
sales
40
20
0
Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4
Quarter
Interpreting the Time Series Graph
30
20
10
0
0 2 4 6 8 10 12 14
Quarter
2 50
year 1 183 45.75
3 79 46.6
190 47.5
4 32 47.8
192 48
1 29 48.4
195 48.75
2 52 49.5
year2
201 50.25
3 82 50.6
204 51
4 38 51.8
210 52.5
1 32 53.6
219 54.75
2 58 55.1
year 3
222 55.5
3 91
4 41
Seasonal variation
• Component give an average effect on
the trend which is solely attributable
to the season itself.
• They are expressed in terms of
deviations from (additive model) or
percentages of (multiplicative model)
the trend
Determination of appropriate
model to use
To determine which model to use when confronted with
time series data, the following procedure is
recommended
1. Plot the time series on the graph paper
2. Study the pattern of seasonality on the plotted data
3. If the pattern of seasonality keeps on increasing with
the rising of trend, the data should obey a
multiplicative data. Alternatively, if the pattern of
seasonality does not increase with the rising trend,
the time series data should be analysed using
additive model
Technique for calculating
seasonal variation
• Additive model
• Given the original time series (y) values together with
a trend(t) values, the procedure for calculating the
seasonal variation are
1st : Calculate, for each time point, value of y – t
2nd: For each season in turn, find the average
(arithmetic mean) of the y - t
3rd: if the total from averages differs from zero adjust
one or more of them so that their total is zero
Example
The sales of a company (y, in Tshs “000”) are given
below, together with previously calculated trend (t). The
subsequent calculation to find the seasonal variation are
shown, laid out in a standardized way. step 1
Years Quarter y t y-t
1 20 23 -3
2 15 29 -14
Year 1
3 60 34 26
4 30 39 -9
1 35 45 -10
2 25 50 -25
Year 2
3 100 55 45
4 50 61 -11
Step 2 Deviations (y-t)
Q1 Q2 Q3 Q4 Sum
Year 1 -3 -14 26 -9
Year 2 -10 -25 45 -11
Total -13 -39 71 -20
Average -6.5 -19.5 35.5 -10 -0.5
Q1 Q2 Q3 Q4 Sum
Initials values -6.5 -19.5 35.5 -10
Adjustment + 0.125 + 0.125 + 0.125 + 0.125
Adjustments values (s) -6.375 -19.375 35.625 -9.875 0
Interpretation:
The average seasonal effect for quarter 1. For instance is to deflate the
trend by 6.375 and that for the quarter 3 is to inflate the trend by
35.625
Multiplicative model
Given the original time series (y) values together with a
trend(t) values, the procedure for calculating the
seasonal variation are
1. calculate for each time point, the value of (y-t)/t
2. for each season in turn, find the arithmetic mean of
the above proportional changes.(note this should
strictly involve calculating the geometric mean of
1+proportional change values. In practice however
this is felt to be too complex!)
3. if the total of averages differs from zero, adjust one
or more of them so that their total is zero
Example
The sales of a company (y, in Tshs “000”) are given
below, together with previously calculated trend (t). The
subsequent calculation to find the seasonal variation are
shown, laid out in a standardized way. step 1
Number of
passengers 2.2 5 7.9 3.2 2.9 5.2 8.2 3.8 3.2 5.8 9.1 4.1
Treand (t) 4.66 4.78 4.84 4.95 5.06 5.18 5.36 5.51
Solution
Q1 Q2 Q3 Q4 Sum
year 1 3.24 -1.58
year2 -1.94 0.25 3.14 -1.38
year 3 -2.16 0.29
Totaal -4.1 0.54 6.38 -2.96
Average -2.05 0.27 3.19 -1.48 -0.07
Adjustment 0.02 0.01 0.02 0.02 0.07
Adjusted average -2.03 0.28 3.21 -1.46
Solution
Centred seasonal seasonally
moving Deviation variation adjustiment
Years Qtr y average (t) (y-t) (s) data (y-s)
1 2.2 -2.03 4.23
2 5 0.28 4.72
3 7.9 4.66 3.24 3.21 4.69
Year 1 4 3.2 4.87 -1.67 -1.46 4.66
1 2.9 4.84 -1.94 -2.03 4.93
2 5.2 4.95 0.25 0.28 4.92
3 8.2 5.06 3.14 3.21 4.99
Year 2 4 3.8 5.18 -1.38 -1.46 5.26
1 3.2 5.36 -2.16 -2.03 5.23
2 5.8 5.51 0.29 0.28 5.52
3 9.1 3.21 5.89
Year 4 4.1 -1.46 5.56
Forecasting Processes in Business
Definition
• Forecasting is the estimation of future outcomes of
random variable.
• Example of business situation where forecasting is
used in prediction are:
i. When a marketing consultant predicts the cost of
sales in the business plan preparation by gauging
on the anticipated level of sales
ii. When the sales person predicts the level of sales
by analysing how much has been spend on
advertising
Time series forecasting Techniques
• There are three method used to forecast time
series data
a) Trend projection method
b) Classical decomposition method
c) Smoothing techniques
a) Fit the line that can used to forecast the time series using
trend projection
b) Forecast the value for months 11 and 12
Solution
a) From the data given above, we find the trend line to
be T = 20.4+1.1x
b) The trend forecasts for months 11 and 12 are
month Forecast
11 32,500
12 33,600
Classical Decomposition
• The method Involves the decomposition of
time series data into it is components
• Then the forecasting are obtained by excluding
the error / irregular component that are
actually not required in the final forecast
• The technique also needs a through
understanding of the model obeyed by the time
series data in question
Analysis of multiplicative model
• In analysis of multiplicative model we use the
following methods
a) Ratio of moving average(Percent moving
average)
b) The average percent method
c) Ratio trend (percentage trend method)
Ratio of moving average
(Percent moving average)
• The following are procedures
1st: Compute the moving averages based on length of
seasonality
2nd: Divide actual data by corresponding centered moving
average
3rd : Average the ratios to eliminate as much randomness as
possible
4th : Compute the normalization factor to adjust the mean ratios
so that they sum to 4 (for quarter data) or 12 (for monthly
data)
5th : Multiply the mean ratios by the normalisation factor to get
the final seasonal indices
The average percent method
• The following are procedures
1st: Compute figure for each year based on the length of
seasonality
2nd: Express the monthly or quarterly data as percentage of the
average for year
3rd : Average the corresponding percentages to eliminate
randomness error
4th : Compute the normalization factor to adjust the percentage
if they do not sum up to 400% (for quarter data) or
1200% (for monthly data)
5th : Multiply the percentage by the normalisation factor to get
the final seasonal indices
Ratio trend (percentage trend method)
• The following are procedures
1st: Fit the trend line on the time series data
2nd: with the help of the trend fitted line, determine the trend
forecasts for each period (month or quarter)
3rd : Express the periodic actual time series data as percentage
of the corresponding trend values
4th : average percentages to eliminate the random error /
irregular component
5th : Compute the normalization factor to adjust the percentage
if they do not sum up to 400% (for quarter data) or
1200% (for monthly data)
6th : Multiply the percentage by the normalisation factor to get
the final seasonal indices
Assessing the Accuracy of the Forecast
method
• There are two methods
a) Mean Absolute Deviation (MAD)
b) Mean Squared error (MSE)
Determining the mean Square Error
(MSE)
• The following are procedures
1st: determine the adjusted seasonal indices using the
technique to be assessed
2nd: Deseasonalise the actual data by dividing by the seasonal
indices obtained in step 1
3rd : Forecast the desonalised data using appropriate
forecasting technique (linear regression method is
recommended) to get pure trends
4th : Seasonalize the forecasts obtained in step 3 to get final
forecasts .
5th : Calculate the MSE using the seasonalized forecasts for
the forecasting sample
Example 1
2 66
1999 68.00
3 65 69.125 0.9403
70.25
4 71 70.250 1.0107
70.25
1 79 70.500 1.1206
70.75
2 66 72.125 0.9151
2000
73.50
3 67 74.125 0.9039
74.50
4 82 75.125 1.0915
75.50
1 84 75.125 1.1034
76.75
2 69 77.375 0.8918
2001
78.00
3 72 79.250 0.9085
80.50
4 87
2002 1 94
Solution cont …
• Calculation of seasonal indices
Year Q1 Q2 Q3 Q4 Sum
MSE
E 2
13.344
1.026
n 13
• MSE used to assess the degree of accuracy associated
with the a forecasting technique.
• The higher the value of MSE the less accurate the
technique is.
• If two methods of forecasting is compared then that
with smaller value of MSE is recommended
Solution Cont…
c) To determine the forecast levels of production for
year 2002 quarters.
Quarter S T F= S x T
1 1.1164 83.649 93.3857
2 0.9070 85.012 77.1059
3 0.9212 86.375 79.5687
4 1.0553 87.738 92.5899
The seasonal adjusted trend forecasts follow the same
distribution pattern like the actual data
Example 2
2 201
229.75
3 182 240.375 -58.375
251
1999 4 297 260.625 36.375
270.25
1 324 279.625 44.375
289
2 278 299.875 -21.875
310.75
3 257 321.5 -64.5
332.25
2000 4 384 342.5 41.5
352.75
1 410 362.5 47.5
372.25
2 360 382 -22
391.75
3 335 400.625 -65.625
409.5
2001 4 462
2002 1 481
Solution cont …
b) To determine the seasonal indices
Year Quarter 1 Quarter 2 Quarter 3 Quarter 4 Sum
2000 -58.375 36.375
2001 44.375 -21.875 -64.5 41.5
2002 47.5 -22
Average 45.9375 -21.9375 -61.4375 38.9375 1.5000
Adjusted
Seasonal
Indices 45.5625 -22.313 -61.813 38.5625 0.0000
Solution cont …
c) Forecast the level of sales for the April – June and
July – September quarters for 2003
Quarter S T F= S +T
14 1.1164 83.649 84.7654
15 0.907 85.012 85.919
MSE
E 2
169.8659
13.067
n 13
Smoothing methods
• Is the standard forecasting technique used in statistics
• There two methods in practice namely moving average
methods and the exponential smoothing
1.Moving Average
• Is the method of forecasting or smoothing a time series
by averaging each successive group of the points
• Fist decide on the step to compute the moving averages
• A step is a umber of periods that form the basis for
computing moving average
• The longer the step taken the smoother will be the final
forecasts.
2. Exponential Smoothing
• Exponential smoothing takes care of some of
limitations of the moving average method of
forecasting
• The technique gives weight to pat data and that weight
keeps decreasing exponentially with time
• That is the most current observation is given the
greatest weighting and the older observations are given
less weight
• The method can be looked at as a weighted moving
average
Exponential Smoothing cont …
• The exponential moving average is given by
Ft 1 Ft αA t Ft
where F t+1 = forecast for period t+1
A t = Actual time series data for time t
F t = Forecast for period t
α = weighting factor lying between 0 and 1
i.e 0 < α < 1
Example
• The data below shows the number of petrol sold by
Shekilango Petrol Station over the past 12 weeks
Week Sales “000” of litres
1 17
2 21
3 19
4 23
5 18
6 16
7 20
8 18
9 22
10 20
11 15
12 22
Questions
a) Determine moving average forecasts
using a step of 4 period
b) Determine the exponential smoothing
forecasts for petrol sales using a
smoothing constant, α = 0.2 and α = 0.8.
Solution
a)Moving average forecasts using a step of 4 period
Week Sales “000” of litres
Forecast (F)
1 17
2 21
20
3 19
20.25
4 23
19
5 18
19.25
6 16
18
7 20
19
8 18
20
9 22
18.75
10 20
19.75
11 15
12 22
Solution cont …
Week Sales “000” Exponential Smoothing Exponential Smoothing
of liters Forecasts with = 0.2 Forecasts with = 0.8
1 17 - -
2 21 17.00 17.00
3 19 17.80 20.20
4 23 18.04 19.24
5 18 19.03 22.25
6 16 18.83 18.85
7 20 18.26 16.57
8 18 18.61 19.31
9 22 18.49 18.26
10 20 19.19 21.25
11 15 19.35 20.25
12 22 18.48 16.05
Choice of Forecasting method
• There are numerous forecasting methods that exist. The
following can serve as a guide in selecting the appropriate
forecasting techniques
a) Availability of data
b) Time horizon. The longer the time over which the
forecasts are required, the more one may have to depend
on qualitative method
c) Cost consideration
d) Accuracy
e) Forecast from required
f) Underlying data pattern
g) Ease of operation and understanding of the technique