Here are the steps to calculate a 4-point moving average for an even number of data points:
1) List the salary data:
Jan: 8
Feb: 4
Mar: 6
Apr: 10
May: 8
2) Calculate the average of the first 4 data points:
(8 + 4 + 6 + 10) / 4 = 7
3) Calculate subsequent averages by removing the earliest data point and adding the next data point:
(4 + 6 + 10 + 8) / 4 = 7
(6 + 10 + 8 + 8) / 4 = 8
4) Plot the original data and the moving averages on a chart.
So the 4-point
2. • Sequence of observations of the same variable
taken at equally spaced points in time.
• Each observation records both the value of the
variable and the time it was made.
• Tell us where we are and suggest where we are
going.
• Time series data are used to predict future values
for forecasting.
2
3. Time plots
• Can reveal the main features of a time series.
• Look for the overall pattern and for deviations from the
pattern.
• Time on x-axis, measured variable on y-axis.
• Plot the points and connect them with straight lines.
3
4. Time plots – Example
SA Fuel Price
800
700
600
Rand
500
400
300
200
100
0
J F M A M J J A S O N D J F M A M J J A S
Months 2008 - 2009
4
5. Components of a time series
• Trend – (T)
• Seasonal variations – (S)
• Cyclical Variations – (C)
• Irregular (random) variations – (I)
5
6. Components of a time series
• Trend – (T)
– Overall smooth pattern and show long-term upward or
downward movement.
– Trend analysis isolate the long-term movement and is
used to make long-term forecasting.
6
7. Components of a time series
• Seasonal variation – (S)
– Rises and falls occurring in particular times of the year
and repeated every year.
• Period of times may be years, months, days, hours or
quarters.
– Seasonal effect can be taken into account to evaluate
activity and can be incorporated into forecasts of future
activity.
7
8. Components of a time series
• Cyclical variation – (C)
– Patterns that repeat over time periods that exceed one
year.
– Time period for the cycle usually differ form each other.
• Business cycles – recession, depression, recovery or boom.
• Changes in governmental monetary and fiscal policy, etc.
8
9. Components of a time series
• Irregular variation – (I)
– Variation left after the trend, seasonal and cyclical
variations have been removed.
– Have an irregular, saw-tooth pattern.
– Cannot be predicted.
– Unusual events.
• Political events, war, riots, strikes, etc.
– Cannot be analysed statistically or forecasted.
9
11. Decomposition of a time series
• Multiplicative time series model:
– Original observed value Yt
– Yt = TSCI
• Decomposing a time series into four components.
• Isolate the influence of each of the four components.
• Statistical methods can isolate trend and seasonal
variations.
• To isolate cyclical and irregular variation is of less value.
11
12. Decomposition – Trend analysis
• Shows the general direction in which the series is
moving.
– Regression analysis – linear trend line
– Moving average method – smooth curve
12
13. Decomposition – Trend analysis – Linear trend
• ŷt = a + bx
– ŷt = estimated time series values
– x = time
• List the values of x and yt
– Code x
• 1st time period – x =1
• 2nd time period – x =2 ……….
• nth time period – x = n
– yt = original time series values 13
14. Decomposition – Trend analysis – Linear trend
• Determine the values of a and b:
2
x 1 n(n 1) 6
x 2 1 n(n 1)(2n 1)
yt 1
n yt x 1
nx
S XX x x xy x y
2 1 2 1
n
S XY t n t
S XY
b
S XX
a yt bx
14
15. Decomposition – Trend analysis – Linear trend
• ŷt = a + bx
• Substitute each value of xi into the trend equation to
find the trend component.
• Draw the trend line on the same graph as the
original time series.
• The trend line can now be used to estimate future
values of the dependent variable (ŷt).
15
16. Decomposition – Linear trend – Example
• The table below lists the quarterly number of foreign visitors
at a game ranch in Limpopo for the past 3 years.
2006 2007 2008
I II III IV I II III IV I II III IV
23 59 64 32 26 45 69 29 15 36 47 38
16
17. Decomposition – Linear trend – Example
Visitors at a game ranch
80
Number of visitors
70
60
50
40
30
20
10
0
I II III IV I II III IV I II III IV
Quarters 2006 - 2008
17
18. Decomposition – Linear trend – Example
• Determine the values of a and b
2006 2007 2008
I II III IV I II III IV I II III IV
yt 23 59 64 32 26 45 69 29 15 36 47 38
x 1 2 3 4 5 6 7 8 9 10 11 12
x n(n 1) 12(12 1) 78
1
2
1
2
x n(n 1)(2n 1) 12(12 1)(2(12) 1) 650
2 1
6
1
6
y 483
t
xy 3044t
yt 12 (483) 40, 25
1
x 12 (78) 6,5
1
18
19. Decomposition – Linear trend – Example
• Determine the values of a and b:
S XX x x 650 12 (78) 2 143
2 1 2 1
n
S XY xyt 1 x yt 650 12 (78)(483) 95,5
n
1
S XY 95,5
b 0, 668
S XX 143
a yt bx 40.25 (0, 668)(6,5) 44,592
yt 44,592 0,668 x
ˆ 19
20. Decomposition – Linear trend – Example
• Determine the values of the isolated trend component
If x = 1 then yt 44,592 0,668(1) 43,924
ˆ
If x = 2 then yt 44,592 0,668(2) 43, 256
ˆ
20
21. Decomposition – Linear trend – Example
• Plot the trend line on the graph
Visitors at a game ranch
80
Number of visitors
70
60
yt 44,592 0,668x
ˆ
50
40
30
20
10
0
I II III IV I II III IV I II III IV
Quarters 2006 - 2008
21
22. Decomposition – Linear trend – Example
• Forecast the values for the next four quarters
• Determine the x-values for the next four quarters.
• Determine the estimated number of visitors for the next
four quarters.
If x = 13 then yt 44,592 0,668(13) 35,908
ˆ
If x = 14 then yt 44,592 0,668(14) 35, 24
ˆ
22
23. IMPORTANT
• Forecasting in this way assumes the same
linear trend holds true for future time
periods
• Remember:-
23
24. ALSO IMPORTANT
• Without seeing the trend line graphically it is still possible
to determine whether the trend is increasing or
decreasing over time
• Slope of line is given by b. If b is +ve the slope is +ve
and the trend is increasing over time. If b is –ve the
slope is –ve and the trend is decreasing over time
• The strength of the trend influence can be assessed by
looking at b. A string upward/downward trend is shown
by large +ve/-ve values of b. Values of b close to 0
indicate a wek trend
24
25. EXAMPLE
The table below shows the annual expenditure of Exel Ltd
on salaries (in R100,000), for each semester for a 4 year
period.
Year Semester1 Semester 2
2002 140.3 160.6
2003 139.6 158.2
2004 141.4 163.8
2005 143.5 167.3
A. What is the value of the slope of the linear trend line for
this time series?
B. What is the value of the intercept (line crosses Y axis)
of the linear trend line for this time series?
C. Forecast the expenditure on salaries (in rands) for the
second semester in 2006 25
26. EXAMPLE ANSWER
A. x = 36
x = 204
2
x = 4,5
y = 1 214,7
y = 151,8375
xy = 5 545,8
SXX = 42
SXY = 79,65
S
b = XY
SXX
79,65
=
42
= 1,8964
B.
a = y – b x
= 151,8375 – 1,8964(4,5)
= 143,3037
C.
ˆ
y = 143,3037 + 1,8964(10)
26
= 162,2677
27. Decomposition – Trend analysis – Moving average
• Removes the short term fluctuations in a time series.
– Smoothing a time series
• Remove the effect of seasonal and irregular
variations.
• Reflect the trend and cyclical movements.
– TC
27
28. Decomposition – Trend analysis – Moving average
• How to calculate a k-point moving average if k is odd
3-point moving 5-point moving
Time (X) Price (yt)
average average
2008 - O 564.03
564.03 519.03 358.03
N 519.03 480.37 3
D 358.03 381.02 406.81 480.37
2009 - J 265.98 317.00 368.40
F 326.98 321.65 338.09
519.03 358.03 265.98
M 371.98 355.48 339.38 3
A 367.48 367.98 362.06 381.02
M 364.48 370.45 379.94
J 379.38 386.75 383.54
J 416.38 395.25 395.23
A 389.98 410.76
28
S 425.93
29. Decomposition – Trend analysis – Moving average
• How to calculate a k-point moving average if k is odd
3-point moving 5-point moving
Time (X) Price (yt)
average average
2008 - O 564.03
N 519.03 480.37
D 358.03 381.02 406.81
2009 - J 265.98 317.00 368.40
F 326.98 321.65 338.09
M 371.98 355.48 339.38
A 367.48 367.98 362.06
M 364.48 370.45 379.94
J 379.38 386.75 383.54
J 416.38 395.25 395.23
A 389.98 410.76
29
S 425.93
30. EXAMPLE
Calculate a 3 point moving average and a 5 point moving
average for the 2011 salaries of Rinto Ltd. The monthly
salary data (in R10,000’s) is as follows:-
Month Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
Sal (y) 8 4 6 10 8 10 13 5 11 14 10 11
30
32. Decomposition
– Trend analysis
– Moving average
• How to calculate a k-point
moving average if k is
even.
32
33. Decomposition – Trend analysis – Moving average
• Plot the original time series data and moving average.
Visitors at a game ranch
80
Number of visitors
70
60 yt
50
40
30 centred
20 moving
10 average
0
I II III IV I II III IV I II III IV
Quarters 2006 - 2008
33
34. EXAMPLE
Calculate a 4 point moving average average for the 2011
salaries of Rinto Ltd. The monthly salary data (in R10,000’s)
is as follows:-
Month Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
Sal (y) 8 4 6 10 8 10 13 5 11 14 10 11
34
36. TERM OF MOVING AVERAGE
Given a set of time series data how do we
chose an appropriate moving average
term (k) for the series?
Months 12
Quarters 4
Workdays 5
36
37. Decomposition – Seasonal analysis
• Isolates the seasonal components in a time series.
• Dominates short-term movement.
• Find seasonal index for each period.
– Specific seasonal index
• specific year
• short term
– Typical seasonal index
• number of years
• long term 37
38. MOVING AVERAGES
• Dampens short term fluctuations
• Shorter terms still show some variations; longer
terms produce a much smoother curve
• Disadvantages of moving averages:-
• Loss of information on both sides of the series
• Not a specific mathematical equation therefore
cannot be used in isolation to make objective
forecasts
38
39. SEASONAL ANALYSIS
• Isolates the seasonal component in a time
series
• Most business and economic time series
contain seasonal variations
• To isolate the seasonal component we
must find a seasonal index for each time
period
• Seasonal indices important because they
are used to forecast future values
39
40. SEASONAL INDICES
• Two types:-
– Specific seasonal index – measures
seasonal change during a specific year
– Typical seasonal index – measures
seasonal changes over a number of years
40
41. Decomposition – Seasonal analysis
– Ratio-to-moving-average method
• Use moving average to smooth time series:
– Isolates trend and cyclical variations – Yt = TC
– Y TSCI 100 SI 100 - seasonal and irregular
t
TC
• Find a typical seasonal index for each period.
• Remember that sum of k mean seasonal indices must = k x
100.Calculate a series of seasonally adjusted values:
– Y TSCI 100 TCI 100
t
S
• Construct a trend line for the seasonally adjusted data.
• Construct forecasts of the time series values. 41
52. Decomposition – Seasonal analysis
• Represent the real predicted values graphically:
Visitors at a game ranch
60.00
Number of visitors
50.00
40.00
30.00
20.00
10.00
0.00
I II III IV I II III IV I II III IV I II III IV
Quarters 2006 - 2009
52
53. EXAMPLE
MONTH PRICE
Jan 355
Feb 326
Mar 371
Apr 375
May 389
Jun 365
Jul 362
Aug 351
Sep 346
Oct 364
Nov 399
Dec 338
53