Time Series and Forecasting
Time Series and Forecasting
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
Trend
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
• 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.5
12 33.6
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
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
G.MEAN 3.907
1.1119 0.9034 0.8417 1.0503
0.093
0.093
Adjusted 1.2039 0.9034 0.8417 1.0503 4.0000
Solution Cont…
b) To determine the forecast levels of production for
year 2002 quarters.
Quarter S T F= S x T
1 1.2039 80.51 96.92599
2 0.9034 81.7756 73.8761
3 0.8417 83.0413 69.8958
4 1.0503 84.3069 88.5475
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 -61.813 480.75 418.937
15 38.562 500.7813 539.3433