BSC Honours in Statistics: HSTS 203: Time Series Analysis University of Zimbabwe
BSC Honours in Statistics: HSTS 203: Time Series Analysis University of Zimbabwe
L Dhliwayo
Department of Statistics
University of Zimbabwe
Contents
1 Review of Elementary Time Series 1
1.1 What this Unit is all About . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Introduction to Time Series . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.3 Time Series Plot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.4 Components of a Time Series . . . . . . . . . . . . . . . . . . . . . . . . 2
1.5 Decomposition of a Time Series . . . . . . . . . . . . . . . . . . . . . . . 3
1.6 Trend Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.6.1 Methods of Trend Isolation . . . . . . . . . . . . . . . . . . . . . 3
1.6.2 Methods of Moving Average . . . . . . . . . . . . . . . . . . . . . 3
1.7 Trend Line Using Regression Analysis . . . . . . . . . . . . . . . . . . . 7
i
Unit 1
Review of Elementary Time
Series
Time Series is defind as any variable measured over time in sequential order.
The objective of time series is to analyse how observed data changes over time, inorder
to detect recurring patterns that enable us to forecast the future behaviour of the data.
The assumption underlying time series is that those factors that have influenced pat-
terns of economic or environmental activity in the past and present will to do so in
more or less the same manner in the future. Thus time series analysis helps us to cope
with uncertainty about the future.
Time series analysis attempts to isolate and quantify the influence of different envi-
ronmental/economic factors operating on the time series into a number of different
components. This is achieved by a process called decompositionof the time series.
Once identified and quantified, those components are used to estimate future values of
the time series.
Before we can venture to understand and analyse a time series we need to appreciate
how it looks like over time. There may be patterns in the time series that we can
visually see and thus, we are guided in our analysis.
A time series plot gives us a visual impression of the time series. This is usually a plot
of the response or variable of interest (Z) against time (t), denoted Zt
1
2 Review of Elementary Time Series
Trend (T),
Trend (T)
This is the general increase or decrease in the time series over an extended period of
time caused by long-term trends, for example, population growth.
The cyclical component of a time series describes alternating periods of relative expan-
sion and contraction of more than one year duration. These periods are known as cycles.
Cyclical variations occur because of upward and downward swings in the general cy-
cle of prosperity, recession, depression and recovery. This wavelike patterns, with the
periods of expansion and contraction not of equal length, describes a long term trend
that is generally apparent over a number of years.
Seasonal variation occurs over short repetitive calender periods and have a duration of
less than a year and represent predictive deviation from the trend, for example, anual
agricultural crop yield.
Random variations occur over short intervals and are unpredictable, with no patterns
to their behaviour. They tend to link the existence of the other more predictable
components. Examples of what causes these movements are unexpected changes in the
weather, political unrest, theft and war.
Review of Elementary Time Series 3
Multiplication Model
Z =T ×C ×S×I
where
We can use statistical analysis to isolate the trend and the seasonal components.
Additive Model
Z =T +C +S+I
The moving average method smoothies out peaks and valleys in a set of observations.
The objective is to bring out the trend by eliminating any obscuring seasonal, cyclical
or random fluctuations. One of its drawbacks is that value for some years are lost at
the beginning and end of the series.
Step 1. Sum the 1st three values and record the total against the middle value of the 3
in the 3-point moving average total column.
Step 2. Average this total value and record in the 3-point moving average column
204
= 68
3
Step 3. Move one point down and sum the next 3 values and record the total against the
middle value of the 3 in the 3-point moving average total column.
Step 4. Average this total value and record in the 3-point moving average column
206
= 68.7
3
Step 5. Continue calculating 3-point averages by moving down 1 point at a time.
Note: There will be no values against the 1st and the last quarters in the series,
because the values are entered against the middle value of 3-point.
Calculating a 4-point moving average.
The principle is the same for that of the 3-point moving average.
Step 1. Sum the 1st four values and record the total half-way between 2nd and 3rd values
of the 4 in the 4-point moving average total column.
Step 2. Average this total value and record in the 4-point moving average column
258
= 64.5
4
Step 3. Move one point down and sum the next 4 values and record the total between
the 2nd and 3rd value of this 2nd group of the 4 in the 4-point moving average
total column.
Step 4. Average this total value and record in the 4-point moving average column
263
= 65.75
4
Step 5. Continue calculating 4-point averages by moving down 1 point at a time.
Step 6. We now find ourselves with values in the 4-point moving average column which
don’t line up with the x-values. Inorder to rectify this, the values need to be
centred. This is achieved by averaging 2 values at a time in a moving sequence.
64.50 + 65.75
= 65.125
2
65.75 + 67.75
= 66.75
2
As you can see from the final centred column, the values have been smoothed signifi-
cantly from the original fluctuating values.
Note: A moving average removes the effect of short term fluctuations (i.e, seasonal
and irregular fluctuations) from the original observations. Thus, moving average values
can be seen to be mainly reflecting the trend and cyclical movements.
Using Mathematical symbols for ultiplicative model we have:
T ×C ×S×I
Moving Average = =T ×C
S×I
Actual Z
SeasonalRatios = × 100 (1.1)
corresponding MA
Averaging the seasonal ratios [Median]
k × 100
Adjusted factor = P (1.2)
(Median Seasonal Indices)
6 Review of Elementary Time Series
Adjustment seasonal indices are a measure of the seasonal influence on the actual values
of the time series for each given time period.
Actual Z
Deseasonalize Z = (1.4)
Seasonal Index
Step 4. Calculate the median for each quarter. The median is calculated be removing the
highest and lowest values and averaging the remaining values. If only one value
remains after eliminating the highest and lowest values, then that remaining value
becomes the modified mean. If there are only 2 values to start with, then the two
values are averaged to give the mean.
Step 5. Total the modified mean percentages for all quarters. These should add up to
400% (there are 4 quarters). If they don’t add up to 400%, use an adjustment
factor to increase or decrease each value to achieve a total of 400% to finale the
seasonal indices. The adjustment factor is calculated as:
k × 100
Adjustment factor = P (1.6)
(Total of Median Seasonal Indices)
Step 6. Adjust each modified mean value by the adjustment factor to achieve the seasonal
index for that quarter
Adjustment seasonal indices are a measure of the seasonal influence on the actual values
of the time series for each given time period.
Actual Z
Deseasonalize Z = (1.8)
Seasonal Index
Let
Zt = β0 + β1 t + ε (1.9)