0% found this document useful (0 votes)
145 views38 pages

Time Series A Level Notes UPDATED (Precision) .

The document outlines the objectives and components of time series analysis, including definitions, trends, seasonality, cycles, and irregular patterns. It explains methods for data smoothing, particularly focusing on moving averages, and discusses their advantages and disadvantages. Additionally, it provides examples and solutions for calculating moving averages and plotting time series graphs.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
145 views38 pages

Time Series A Level Notes UPDATED (Precision) .

The document outlines the objectives and components of time series analysis, including definitions, trends, seasonality, cycles, and irregular patterns. It explains methods for data smoothing, particularly focusing on moving averages, and discusses their advantages and disadvantages. Additionally, it provides examples and solutions for calculating moving averages and plotting time series graphs.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 38

OBJECTIVES: After studying this topic students should be able to

 define time series key terms


 identify the components of time series
 draw time series graphs and trend lines
 identify trends
 explain the purpose of smoothening
 calculate moving averages
 Plot moving average graphs
 solve problems involving time series

TIME SERIES

 Time series can be defined as a series of data recorded and analysed in a time order, at
equally spaced time periods (e.g., per year, month, day, hour)
OR: Time series is a sequence of data points recorded at successive equally spaced points in
time.
OR: Time series is a set of statistical data arranged in chronological order.
OR: Time series is a data set that tracks a sample over time.
OR: A time series is a sequence of observations measured at successive times. Time series
can be monthly, trimestral, or yearly, weekly, daily, or hourly (e.g. study of road traffic;
sales),
OR A time series is a set of observation taken at specified times, usually at equal intervals
COMPONENTS OF TIME-SERIES:

A time series can have one or more of the following four components:
a) Trend or Secular trend component:
 A trend is long-term increase or decrease in the data which might be linear or not.
Sometimes the trend might change direction as time increases.
 A trend exists when there is a long-term increase or decrease in the dependent variable
as time passes. An example of a trend would be a long term increase in a company’s
sales data or network usage.
PRECISION +263775973880 CREATED BY MWEDZI S

Fig 1 shows the diagram of a linear trend

Fig 1
Tr
Tr
OR

Time
Time
A long term A long term
increase decrease

b) Seasonal component: exists when a series exhibits regular fluctuations based on the
season (e.g. every month/quarter/year).Seasonality is always of a fixed and known
period.

 A seasonal trend or pattern occurs when a time series is affected by seasonal


factors such as the time of the year or the day of the week.
 Seasonality occurs if there are regular and predictable fluctuations in the series
that are correlated with the calendar – could be quarterly, weekly, or even days of
the week, then the series includes a seasonality component. For example in
Zimbabwe winter clothing sales are usually higher in the winter season and low in
summer season.
Fig 2 shows the diagram of sales of smart phones that has Seasonal pattern.
Fig 2

Every year the sales are


increasing in the last
quarter

c) Cycle Component: exists when data exhibit rises and falls that are not of fixed period.
The average length of cycles is longer than the length of a seasonal pattern.
 Cyclic trend refers to repeating or oscillating periods that are not related to the
calendar. These includes business cycles such as economic downturns or
expansions, but aren’t related to the calendar in the weekly, monthly, or yearly
sense.
2
PRECISION +263775973880 CREATED BY MWEDZI S

 Cycle patterns correspond to periodical but not seasonal variations;


In a cycle time series the graph oscillates as show in fig 3

Fig 3

The business cycle model on Fig 4 shows how a nation's real GDP fluctuates over time

Fig 4

d) Irregular component

Irregular patterns are totally unpredictable. The irregular pattern are short term variations
mainly due to flood, draughts, famines, earthquakes, etc.
The irregular variations usually occurs in the midst of another variation (either a secular
trend or seasonal trend or cyclic trend).
Fig 4 shows the diagram of a time series that has an irregular pattern.

3
PRECISION +263775973880 CREATED BY MWEDZI S

Fig 4

The diagram below shows the patterns of 4 different components of time series

Fig 5

4
PRECISION +263775973880 CREATED BY MWEDZI S

TIME SERIES PLOT

It is a graph in which time is displayed as the independent variable along the x-axis and the other
variable being measured along the y-axis.
Data points are plotted and connected with straight lines.

Example
The table below shows the sales of a shop which were recorded over a two-week period.

week Day Sales


($)
1 Monday 162
Tuesday 143
Wednesday 138
Thursday 138
Friday 149
Saturday 204
Sunday 90
``2 Monday 155
Tuesday 130
Wednesday 123
Thursday 132
Friday 142
Saturday 200
Sunday 88

Using the information above draw a time series graph of the sales.

5
PRECISION +263775973880 CREATED BY MWEDZI S

Solution
The days are to be sequentially coded as day 1, day 2, day 3 etc. starting with the 1st Monday as day 1
and end with last Sunday as day 14

210

200

190

180

170

160

150
SALES

140

130

120

110

100

90

80
0 2 4 6 8 10 12 14 16
DAY

6
PRECISION +263775973880 CREATED BY MWEDZI S

DATA SMOOTHENING

Data smoothing can be defined as a statistical approach of eliminating outliers from datasets to
make the patterns more noticeable.
OR
It is a method of fitting a straight line or a line with few fluctuations on a time series.

 All components excluding secular trend are uneven (not smooth). Data smoothing is done
by using different smoothing techniques to remove such irregularities or noise from a
ORIGINAL OR ACTUAL data set.
 Noise: All-time series data will have noise or haphazardness in the data points that aren’t
correlated with any explained trends. Noise is unsystematic and is short term.
 The smoothening process levels out the irregular roughness to see a clearer signal. For
seasonal data, we might smooth out the seasonality so that we can identify the trend.
Benefits of Data Smoothing
 It can help in identifying trends in businesses, financial securities, and the economy.
 Data smoothing can help expose patterns in complicated data. It assists in the prediction of
the usual direction of the next observed data point. If users do not need certain data points,
data smoothening eliminates the data points if they are of no interest to the user.
 It also helps to generate smooth graphs that depict trends and patterns.

Limitations of Data Smoothing


 Data smoothing does not necessarily offer an interpretation of the themes or patterns it helps
to recognize.
 It can also contribute to certain data points being overlooked by focusing on others.
 Sometimes, data smoothing may eliminate the usable data points. It may lead to incorrect
forecasts if the data set is seasonal and not completely be reflective of the reality produced by
the data points.
 Moreover, data smoothing can be prone to considerable disruption from the outliers in the
data.

METHODS OF SMOOTHENING DATA.


A. Moving Average.
B. Free hand
C. Semi-average
D. Least square or line of best fit

A. Moving average (MA) method


The moving average is a statistical approach of smoothening data in a time series which involves
taking an average of a set of numbers in a given range while moving the range.
NB: Finding the moving average is finding the mean of the data points.

7
PRECISION +263775973880 CREATED BY MWEDZI S

Advantages of using Moving average method:


• MA method is easy to understand and easy to use because there are no mathematical
complexities involved.
• It is an objective method in the sense that anybody working on a problem with the method
will get the same trend values. It is in this respect better than the free hand curve method.

Disadvantages of using Moving average method


• It is not possible to calculate trend values for all the items of the series. Some information
is always lost at its ends.
• The trend values obtained by moving averages may not follow any mathematical pattern
i.e. fails in setting up a functional relationship between the values of X(time) and Y(values)
and thus, cannot be used for forecasting which perhaps is the main task of any time series
analysis.
• The selection of period of moving average is a difficult task and a great deal of care is
needed to determine it.
• Like arithmetic mean, the moving averages are too much affected by extreme values.

Example
Moving Average Smoothing with an Odd Number of Points E.g. 3 point MA; 5 point MA; 7
point MA; etc.
The number of babies born in a remote hospital over the period 1996 to 2005 is given below.

Year 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005
Number of 25 18 23 21 19 20 18 16 17 15
birth
a) Draw the time series graph of the number of babies born and calculate the 3-point
moving average.
b) Draw the 3-point moving average on the time series graph.

Solution

The years can be sequentially coded as year 1, year 2, year 3 etc. starting with 1996 as year 1 as
shown in the table below.

To calculate a three point moving average the following steps are followed:

 Add up the data from year 1 (1996), year 2 (1997) and year 3 (1998)
 Divide by three
 List the answer next to the data from the ‘middle’ year (year 2 (1997))
 Repeat the process, this time exclude the first year (1996) from the first calculation
and include the fourth year (1999) .
 Repeat for all months

8
PRECISION +263775973880 CREATED BY MWEDZI S

Year Year Number (t) No of Moving Averages


births (y)
1996 1 25

1997 2 18 𝟐𝟓 + 𝟏𝟖 + 𝟐𝟑
= 𝟐𝟐
𝟑
1998 3 23 𝟏𝟖 + 𝟐𝟑 + 𝟐𝟏
= 𝟐𝟎. 𝟕
𝟑
1999 4 21 𝟐𝟑 + 𝟐𝟏 + 𝟏𝟗
= 𝟐𝟏
𝟑
2000 5 19 𝟐𝟏 + 𝟏𝟗 + 𝟐𝟎
= 𝟐𝟎
𝟑
2001 6 20 𝟏𝟗 + 𝟐𝟎 + 𝟏𝟖
= 𝟏𝟗
𝟑
2002 7 18 𝟐𝟎 + 𝟏𝟖 + 𝟏𝟔
= 𝟏𝟖
𝟑
2003 8 16 𝟏𝟖 + 𝟏𝟔 + 𝟏𝟕
= 𝟏𝟕
𝟑
2004 9 17 𝟏𝟔 + 𝟏𝟕 + 𝟏𝟓
= 𝟏𝟔
𝟑
2005 10 15

The original data is will appear as in the table below.

Year number 1 2 3 4 5 6 7 8 9 10
Number of birth 25 18 23 21 19 20 18 16 17 15

In order to draw a trend line of 3-point moving average, each moving average point must be
aligned with the midpoint of the range of years that it includes eg 22 is the average of [year 1;
year 2 and year 3] therefore year 2 is the midpoint in that range. Hence the coordinate to be
plotted is (𝒚𝒆𝒂𝒓 𝟐; 𝟐𝟐)

The smoothed data is will appear as in the table below.

Year Number (t) 2 3 4 5 6 7 8 9


3-point MA 22 20.7 21 20 19 18 17 16

This table is used to draw the 3-point moving average trend line (3-point moving average
smoothed line)

9
PRECISION +263775973880 CREATED BY MWEDZI S

The trend above shows a general decrease of babies being born.

NB: the points of MAs are joined by straight lines.

10
PRECISION +263775973880 CREATED BY MWEDZI S

Moving Average smoothing with an Even Number of Points e.g. 2 point MA; 4 point MA; 6
point MA etc.

Example 3
The number of babies born in a remote hospital over the period 1996 to 2005 is given below.
Year 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005
Number of birth 25 18 23 21 19 20 18 16 17 15

a) Calculate the 4-point moving average

Solution

Year Year No of births Moving Averages


Number (t) (y)
1996 1 25

1997 2 18
𝟐𝟓 + 𝟏𝟖 + 𝟐𝟑 + 𝟐𝟏
= 𝟐𝟏. 𝟕𝟓
𝟒
1998 3 23
𝟏𝟖 + 𝟐𝟑 + 𝟐𝟏 + 𝟏𝟗
= 𝟐𝟎. 𝟐𝟓
𝟒
1999 4 21
𝟐𝟑 + 𝟐𝟏 + 𝟏𝟗 + 𝟐𝟎
= 𝟐𝟎. 𝟕𝟓
𝟒
2000 5 19
𝟐𝟏 + 𝟏𝟗 + 𝟐𝟎 + 𝟏𝟖
= 𝟏𝟗. 𝟓
𝟒
2001 6 20
𝟏𝟗 + 𝟐𝟎 + 𝟏𝟖 + 𝟏𝟔
= 𝟏𝟖. 𝟐𝟓
𝟒
2002 7 18
𝟐𝟎 + 𝟏𝟖 + 𝟏𝟔 + 𝟏𝟕
= 𝟏𝟕. 𝟕𝟓
𝟒
2003 8 16
𝟏𝟖 + 𝟏𝟔 + 𝟏𝟕 + 𝟏𝟓
= 𝟏𝟔. 𝟓
𝟒
2004 9 17
2005 10 15
In a table above each moving average point is not lined up with a specific year.

11
PRECISION +263775973880 CREATED BY MWEDZI S

NB: In every Moving Average with an Even Number of Points; each moving average point
does not line up with a specific year or week or day etc because the midpoint is not specific (not
a whole number).

In order to draw a trend line of 4-point moving average, each moving average point must be
aligned with its year which is not specific as shown in the table below.
Year no (t) 2 2.5 3 3.5 4 4.5 5 5.5 6 6.5 7 7.5 8 8.5 9
4-point MA 𝟐𝟏. 𝟕𝟓 𝟐𝟎. 𝟐𝟓 𝟐𝟎. 𝟕𝟓 𝟏𝟗. 𝟓 𝟏𝟖. 𝟐𝟓 𝟏𝟕. 𝟕𝟓 𝟏𝟔. 𝟓

The 4-point moving average trend is drawn after plotting the points from the table below.

Year Number (t) 2.5 3.5 4.5 5.5 6.5 7.5 8.5
4-point MA 𝟐𝟏. 𝟕𝟓 𝟐𝟎. 𝟐𝟓 𝟐𝟎. 𝟕𝟓 𝟏𝟗. 𝟓 𝟏𝟖. 𝟐𝟓 𝟏𝟕. 𝟕𝟓 𝟏𝟔. 𝟓

CENTERED MOVING AVERAGE.

The centered moving average technique is embraced when dealing with a Moving Average with
an Even Number of Points e.g. 2 point MA; 4 point MA etc.

Centering ensures that each moving average in a Moving Average with an Even Number of
Points is aligned to a specific year or week or day (time variable) etc.

Example 4

Year 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005
Number of birth 25 18 23 21 19 20 18 16 17 15

a) Calculate the 4-point moving average and the centered moving average
b) Draw the time series plot and the centered moving average trend line

12
PRECISION +263775973880 CREATED BY MWEDZI S

Solution

Year Year No of 4-point MA Centered MA


Number (t) births (y)
1996 1 25

1997 2 18
𝟐𝟓+𝟏𝟖+𝟐𝟑+𝟐𝟏
= 𝟐𝟏. 𝟕𝟓
𝟒
1998 3 23 𝟐𝟏. 𝟕𝟓 + 𝟐𝟎. 𝟐𝟓
= 𝟐𝟏
𝟐
𝟏𝟖+𝟐𝟑+𝟐𝟏+𝟏𝟗
= 𝟐𝟎. 𝟐𝟓
𝟒
1999 4 21 𝟐𝟎. 𝟐𝟓 + 𝟐𝟎. 𝟕𝟓
= 𝟐𝟎. 𝟓
𝟐
𝟐𝟑+𝟐𝟏+𝟏𝟗+𝟐𝟎
= 𝟐𝟎. 𝟕𝟓
𝟒
2000 5 19 𝟐𝟎. 𝟕𝟓 + 𝟏𝟗. 𝟓
= 𝟐𝟎. 𝟏𝟐𝟓
𝟐
𝟐𝟏+𝟏𝟗+𝟐𝟎+𝟏𝟖
= 𝟏𝟗. 𝟓
𝟒
2001 6 20 𝟏𝟗. 𝟓 + 𝟏𝟖. 𝟐𝟓
= 𝟏𝟖. 𝟖𝟕𝟓
𝟐
𝟏𝟗+𝟐𝟎+𝟏𝟖+𝟏𝟔
= 𝟏𝟖. 𝟐𝟓
𝟒
2002 7 18 𝟏𝟖. 𝟐𝟓 + 𝟏𝟕. 𝟕𝟓
= 𝟏𝟖
𝟐
𝟐𝟎+𝟏𝟖+𝟏𝟔+𝟏𝟕
= 𝟏𝟕. 𝟕𝟓
𝟒
2003 8 16 𝟏𝟕. 𝟕𝟓 + 𝟏𝟔. 𝟓
= 𝟏𝟕. 𝟏𝟐𝟓
𝟐
𝟏𝟖 + 𝟏𝟔 + 𝟏𝟕 + 𝟏𝟓
= 𝟏𝟔. 𝟓
𝟒
2004 9 17
2005 10 15

The centered MA trend is drawn after plotting the points from the table below.
Year Number (t) 3 4 5 6 7 8
Centered MA 𝟐𝟏 20.5 20.125 18.875 18 17.125

13
PRECISION +263775973880 CREATED BY MWEDZI S

B. Freehand Method
In this method a times series data points are plotted on graph paper, then a free hand trend
line is drawn through the plotted graph.
Procedure of drawing a freehand trend line
 First plot the actual/original data on the graph paper.
 Then observe the direction of the plotted data.
 Then draw a smooth line through the plotted points
NB: This method is however, inaccurate, since different persons may fit different trend lines
for the same set of data.

Conditions for fitting a trend line by the freehand -


When fitting a trend line by the freehand method, make an effort to ensure that the fitted curve or
trend line meets these conditions.
• . The curve or trend line should be smooth either a straight line or a combination of long gradual
curves.
• The trend line or curve should be drawn through the graph of the data in such a way that the areas
below and above the trend line are equal to each other.
• The vertical deviations of the data above the trend line must equal to the deviations below the
line.

Advantages of freehand

• This is the simplest method of measuring trend, requires no mathematical calculations.


• This method is very flexible in that it can be used regardless of whether the trend is a
straight line or a curve.
• This method can be used even if trend is not linear.
• If the observations are relatively stable, the trend can easily be approximated by this
method.
• Being a non-mathematical method, it can be applied even by a non-statisticians.
14
PRECISION +263775973880 CREATED BY MWEDZI S

Disadvantages of freehand method


• It is subjective method. The values of trend, obtained by different statisticians would be
different and hence, not reliable.
• Since freehand curve fitting is subjective, it cannot have much value if it is used as a
basis for predictions.
• This method appears simple and direct. However, it is very time- consuming to construct a
freehand trend if a careful and conscientious job is done.
• It is only after long experience in trend fitting that a statistician should attempt to fit a trend line
by inspection.

Example:

Draw a free hand curve on the basis of the following data:

Years 1989 1990 1991 1992 1993 1994 1995 1996

Profit 148 149 149.5 149 150.5 152.2 153.7 153


(in
‘000)

15
PRECISION +263775973880 CREATED BY MWEDZI S

Solution

154

153

152

151

150

149

148

147
1989 1990 1991 1992 1993 1994 1995 1996 1997

16
PRECISION +263775973880 CREATED BY MWEDZI S

C. Semi-average method
In this method the given data are divided in two parts, preferable with the equal number of
years, days, hours etc.

For example, if the given data ranges from Monday to Saturday , i.e., over a period of 6
days, the two equal parts will be first 3 days, i.e., Monday to Wednesday and then from
Thursday to Saturday.

In case of odd number of days like, 9, 13, 17, etc.., two equal parts can be made simply by
ignoring the middle year. For example, if data are given for 7 days from Monday to Sunday
the two equal parts would be from Monday to Wednesday and then from Friday to Sunday -
the middle day (Thursday) will be ignored.

Advantages of semi-average method

• This method is simple to understand as compared to the moving average method and the
method of least squares.

• This is an objective method of measuring trend as everyone who applies the method is
bound to get the same result.

Disadvantages of semi-average method


• This method assumes straight line relationship between the plotted points regardless of
the fact whether that relationship exists or not.
• The limitations of arithmetic average shall automatically apply. If there are extremes in
either half or both halves of the series, then the trend line will not give a true picture of
the growth factor. This danger is greatest when the time period represented by the
average is small. Consequently, trend values obtained are not precise enough for the
purpose either of forecasting the future trend or of eliminating trend from original data.
• For the above reasons if the arithmetic averages of the data are to be used in estimating
the secular movement, it is sometimes better to use moving averages than semi-averages.

17
PRECISION +263775973880 CREATED BY MWEDZI S

Semi-average on an even number of points.

Example: Find the trend line from the following data by Semi – Average Method.

Year 1989 1990 1991 1992 1993 1994 1995 1996

Production 150 152 153 151 154 153 156 158


(kg)

Solution

There are total 8 trends: they are to be distributed equally each part with 4.

150 + 152 + 153 + 151


𝐹𝑖𝑟𝑠𝑡 𝑝𝑎𝑟𝑡 = = 151.5
4
154 + 153 + 156 + 158
𝑠𝑒𝑐𝑜𝑛𝑑 𝑝𝑎𝑟𝑡 = = 155.25
4

Yr Production (kg) Semi-


average
1989 150
1990 152
1990.5(midst of 1995) 151.5
1991 153
1992 151
1993 154
1994 153
1994.5 (midst of 1994) 155.25
1995 156
1996 158

18
PRECISION +263775973880 CREATED BY MWEDZI S

159

158

157

156
PRODUCTION

155.25

155

154

153

152

151.5
151

150

149
1989 1990 1991 1992 1993 1994 1995 1996 1997
YEAR

19
PRECISION +263775973880 CREATED BY MWEDZI S

Semi-average on an odd number of points.

The following table shows the enrolment of students at Gumbonzvanda High School from year
2003 to 2009.

Year 2003 2004 2005 2006 2007 2008 2009


Number of students 201 238 392 507 484 648 742

a) Obtain the semi-averages trend line

Solution

Year Number of Semi Average


students
2003 201
2004 238 201 + 238 + 392
= 277
3
2005 392
2006 507
2007 484
2008 549 484 + 549 + 742
= 625
3
2009 742

20
PRECISION +263775973880 CREATED BY MWEDZI S

700

625
600
NUMBER OF STUDENTS

500

400

300
277

200

100

0
2002 2003 2004 2005 2006 2007 2008 2009 2010
YEAR

21
PRECISION +263775973880 CREATED BY MWEDZI S

D. Least Squares
 Least Squares Least Square is the method for finding trend line of best fit to a time series
data.
 This line is termed as the line of best fit from which the sum of squares of the distances
from the points is minimized.

Advantages of Least Squares


• The least squares method is an objective method.
• Unlike the moving average method, it is possible to compute trend values for all the
periods and predict the value for a period lying outside the observed data.

Disadvantages of Least Squares


• As compared with the moving average method, it is burdensome method.
• It is not flexible like the moving average method. If some observations are added, then the
entire calculations are to be done once again.
• It can predict or estimate values only in the immediate future or past.

Line of best fit or least squares (linear trend)

Linear trend line Y is defined by the following equation: 𝑌 = 𝑎 + 𝑏 𝑋; where Y = predicted


value of the dependent variable;
• a = Y-axis intercept
• b = gradient of the line i.e. annual increase, monthly increase, weekly increase etc.
When b is positive the slope is upwards, when b is negative, the slope is downwards
𝑋 = 𝑖𝑛𝑑𝑒𝑝𝑒𝑛𝑑𝑒𝑛𝑡 𝑣𝑎𝑟𝑖𝑎𝑏𝑙𝑒 (In this case it is time)

 Line of best fit/ Least squares and other smoothening methods are also used for
forecasting.
 Least squares is the common method which produces a trend line used for forecasting
periods outside the actual data.

Forecasting
 Time series forecasting method involves projection of future values of a variable based
entirely on the past and present observation of that variable.
 Method of Least Squares (linear trend forecasting) is one of the methods used for
forecasting
 Linear trend can be used as a means of analysing historic data so that forecasts can be
made for the future

22
PRECISION +263775973880 CREATED BY MWEDZI S

Example on Least Squares


The annual TV sales at Chiripi shop for past 5 years.
Year 2006 2007 2008 2009 2010
Sales of T.V(in 000) 12 18 20 23 27

a) Fit a trend line to the data.


b) Forecast the sales for the year 2012.

Solution

The years can be sequentially coded as year 1, year 2, year 3 etc. starting with 2006 as year 1 and
they are labelled as X variables whilst the sales are labelled as Y variables.

NB: A trend line to the data is a regression line of y on x.

a)
Year 𝑿 Sales 𝒀 𝑿² 𝑿𝒀
1 12 1 12
2 18 4 36
3 20 9 60
4 23 16 92
5 27 25 135
∑𝑋 = 15 ∑𝑌 = 100 ∑𝑋² = 55 ∑𝑋𝑌 = 335 𝑁=5

𝒏∑𝑋𝑌−∑𝑋∑𝑌 𝟓(𝟑𝟑𝟓)−15(100) 𝟏𝟕𝟓


𝒃 = 𝒏∑𝑋 2 −(∑𝑋)2 = = = 𝟑. 𝟓
𝟓(55)−(15) 2 𝟓𝟎

̅ = 𝟏𝟓 = 𝟑
𝑿 ̅ = 𝟏𝟎𝟎 = 𝟐𝟎
𝒀
𝟓 𝟓

𝒀 − 𝟐𝟎 = 𝟑. 𝟓(𝑿 − 𝟑)

Therefore 𝒀 = 𝟗. 𝟓 + 𝟑. 𝟓𝑿

b) If the years are sequentially coded as year 1, year 2, year 3 and so on from 2006. 2012
becomes year 7 meaning that in 2012, 𝑿 = 𝟕. Therefore X is substituted by 7 to find
the value of Y (2012 sales)

𝒀 = 𝟗. 𝟓 + 𝟑. 𝟓(𝟕) = 𝟑𝟒 Thus the likely sale of T.V in 2012 will be 34 000.

23
PRECISION +263775973880 CREATED BY MWEDZI S

40

35
34

30

ACTUAL DATA
25
Y (SALES)

20

15 SMOOTHED DATA

10

0
0 1 2 3 4 5 6 7
X (YEAR NUMBER)

 Looking closely at the data, it is clear that although the line of best fit or smoothed data
(black line) is linear, the actual data time plot (Red line) fluctuates around this line. In
some years the sales are above the trend line, in others the sales are below it.
 The scatter plot cannot go beyond year 5 (2010) based on the data but the line
 𝒀 = 𝟗. 𝟓 + 𝟑. 𝟓𝑿 can go beyond year 2010, therefore it can be used to predict any year
ahead of 2010.
 The gap between the actual data and the trend line is known as the SEASONAL
VARIATION.

24
PRECISION +263775973880 CREATED BY MWEDZI S

SEASONAL VARIATION

 Can be described as the difference between the trend of data and the actual figures for the
period in question.

 A seasonal variation can be a numerical value (additive) or a percentage


(multiplicative). The term ‘seasonal’ is applied to a time period, not necessarily a
traditional season (summer, autumn etc.) .

a. Additive.

𝑨𝑪𝑻𝑼𝑨𝑳 𝑫𝑨𝑻𝑨 = 𝑺𝑴𝑶𝑶𝑻𝑯𝑬𝑫 𝑫𝑨𝑻𝑨 + 𝑺𝑬𝑨𝑺𝑶𝑵𝑨𝑳 𝑽𝑨𝑹𝑰𝑨𝑻𝑰𝑶𝑵

Or 𝑺𝑬𝑨𝑺𝑶𝑵𝑨𝑳 𝑽𝑨𝑹𝑰𝑨𝑻𝑰𝑶𝑵 = 𝑨𝑪𝑻𝑼𝑨𝑳 𝑫𝑨𝑻𝑨 − 𝑺𝑴𝑶𝑶𝑻𝑯𝑬𝑫 𝑫𝑨𝑻𝑨

Or 𝑺𝑴𝑶𝑶𝑻𝑯𝑬𝑫 𝑫𝑨𝑻𝑨 = 𝐴𝐶𝑇𝑈𝐴𝐿 𝐷𝐴𝑇𝐴 – 𝑆𝐸𝐴𝑆𝑂𝑁𝐴𝐿 𝑉𝐴𝑅𝐼𝐴𝑇𝐼𝑂𝑁

b. Multiplicative.
The variation is expressed as a percentage of the average figure
𝒂𝒄𝒕𝒖𝒂𝒍 𝒅𝒂𝒕𝒂
𝑺𝒆𝒂𝒔𝒐𝒏𝒂𝒍 𝒗𝒂𝒓𝒊𝒂𝒕𝒊𝒐𝒏 % = 𝒔𝒎𝒐𝒐𝒕𝒉𝒆𝒏𝒆𝒅 𝒅𝒂𝒕𝒂 × 𝟏𝟎𝟎

Example
The following data is a series of data representing sales of a product in units over a 12 months
period.

Calculate the three point moving average for the data and

25
PRECISION +263775973880 CREATED BY MWEDZI S

a) The seasonal variations using the additive model


b) The seasonal variations using the multiplicative model

Solution

a) Additive model

The negative variation means the actual value is below the trend whilst the positive variation
means the actual value is above the trend.

b) Multiplicative model.
The variation is expressed as a percentage of the average figure
𝒂𝒄𝒕𝒖𝒂𝒍 𝒅𝒂𝒕𝒂(𝒇𝒐𝒓𝒆𝒄𝒂𝒔𝒕)
𝑺𝒆𝒂𝒔𝒐𝒏𝒂𝒍 𝒗𝒂𝒓𝒊𝒂𝒕𝒊𝒐𝒏 % = × 𝟏𝟎𝟎
𝒕𝒓𝒆𝒏𝒅

Month Actual data 3 point MA Seasonal variation


January 4680
February 2970 3420 87%
March 2610 3510 74%
April 4950 3600 138%
May 3240 3690 88%
June 2880 3780 76%
July 5220 3870 135%
august 3510 3960 89%
September 3150 4050 78%
October 5490 4140 133%
November 3780 4230 89%
December 3420
This means that February`s sales is usually 87% of the trend; March is 74%, April is 138% etc.
The multiplicative model is better method to use when the trend is increasing or decreasing over
time, as the seasonal variation will also likely to be increasing or decreasing.
26
PRECISION +263775973880 CREATED BY MWEDZI S

Practice Questions

1. Zimsec Past Exam question:


The table below shows the sales of a shop which were recorded over a two-week period.

Week Day Sales


($)
1 Monday 162
Tuesday 143
Wednesday 138
Thursday 138
Friday 149
Saturday 204
Sunday 90
2 Monday 155
Tuesday 130
Wednesday 123
Thursday 132
Friday 142
Saturday 200
Sunday 88
a) Using the information above draw a time series graph of the sales. [3]
b) Calculate the 7 day moving average correct to the nearest whole number. [4]
c) Plot the moving averages on your time series and draw a trend line through the points. [3]
d) The seasonal component on Monday is 14.2. Estimate the sales realized by the shop on
Monday of week 3. [6]

27
PRECISION +263775973880 CREATED BY MWEDZI S

SOLUTION
The days are to be sequentially coded as day 1, day 2, day 3 etc. starting with the 1 st Monday as day 1 and
end with last Sunday as day 14
a) ;b) and c)

Week day Sales 7 point MA


1 162
2 143
1 3 138
4 138 146
5 149 145
6 204 143
7 90 141
8 155 140
9 130 139
2 10 123 139
11 132 139
12 142
13 200
14 88

28
PRECISION +263775973880 CREATED BY MWEDZI S

210

200

190

180

170

160

150
SALES

140

130

120

110

100

90

80
0 2 4 6 8 10 12 14 16
Day

29
PRECISION +263775973880 CREATED BY MWEDZI S

d)

X (Day Y (7pnt
Number) MA)
XY 𝑿𝟐
4 146 584 16
5 145 725 25
6 143 858 36
7 141 987 49
8 140 1120 64
9 139 1251 81
10 139 1390 100
11 139 1529 121
∑𝑋 = 60 ∑𝑌 =1132 ∑𝑋𝑌 = 8444 ∑𝑋 2 = 492

𝒎 = −1.38 𝑋̅ = 7.5 𝑌̅ = 141.5

𝑌 − 141.5 = −1.095(𝑋 − 7.5)

𝑌 = 149.7 − 1.095𝑋

Monday of the third week will be day 15 and will have a trend value of 𝑌=
149.7 − 1.095(15) = 133.28

To find the forecast value or the actual value if given the trend value and the seasonal component
(variation) numerically the additive model formula below is used

𝑨𝑪𝑻𝑼𝑨𝑳 𝑫𝑨𝑻𝑨 = 𝒔𝒎𝒐𝒐𝒕𝒉𝒆𝒅 𝒅𝒂𝒕𝒂(𝒇𝒐𝒓𝒆𝒄𝒂𝒔𝒕) + 𝑺𝑬𝑨𝑺𝑶𝑵𝑨𝑳 𝑽𝑨𝑹𝑰𝑨𝑻𝑰𝑶𝑵

𝐹𝑜𝑟𝑒𝑐𝑎𝑠𝑡 𝑣𝑎𝑙𝑢𝑒 = 133.28 + 14.2 = 147.48

2. The table gives information about the number of students who enrol for a course in each term
in 2011, in 2012 and in 2013.

30
PRECISION +263775973880 CREATED BY MWEDZI S

Year Term Number of students

Autumn 330

2011 Spring 180

Summer 90

Autumn 390

2012 Spring 230

Summer 170

Autumn 460
2013 Spring 260
Summer 210

a) Draw a time-series graph for student`s enrollment for the three years.
b) Calculate the 3-point moving averages, giving your answer correct to 3 significant figures.

c) Plot the 3-point moving averages on the time-series graph and draw the trend line through
those points.
d) Draw the line of best fit and use it to find an estimate for the mean seasonal variation in
numbers enrolling for the Autumn Term.
e) Predict the number of students who will enroll in the Autumn Term of 2014.

31
PRECISION +263775973880 CREATED BY MWEDZI S

SOLUTION.
a);c);d)
500

450

400

350

310
NO OF STUDENTS

300 297
287
263
250
237
220
200 200

150

100

50

0 A S S A S S A S S A
0 1
U 2P 3 4 5 6 7 8 9 10
U U P U U P U U
2011 2012 2013 TIME 2014

32
PRECISION +263775973880 CREATED BY MWEDZI S

b)

Term Number
Term No of students
3-point MA
Autumn 1 330
Spring 2 180 200
Summer 3 90 220
Autumn 4 390 237
Spring 5 230 263
Summer 6 170 287
Autumn 7 460 297
Spring 8 260 310
Summer 9 210

d) Method of least squares is used to draw the trend line of best fit.

X Y
2 200
3 220
4 237
5 263
6 287
7 297
𝒚 = 𝟏𝟓𝟗. 𝟏𝟐 + 𝟐𝟎. 𝟑𝟒𝒙
 𝑻𝒉𝒆 𝒕𝒓𝒆𝒏𝒅 𝒇𝒐𝒓 𝒂𝒖𝒕𝒖𝒎 𝟐𝟎𝟏𝟏 ; , 𝒔𝒆𝒂𝒔𝒐𝒏𝒂𝒍 𝒗𝒂𝒓𝒊𝒂𝒕𝒊𝒐𝒏 = 𝟑𝟑𝟎 − 𝟏𝟖𝟎 = 𝟏𝟓𝟎
 𝑻𝒉𝒆 𝒕𝒓𝒆𝒏𝒅 𝒇𝒐𝒓 𝒂𝒖𝒕𝒖𝒎 𝟐𝟎𝟏𝟐 𝒊𝒔 𝒂𝒑𝒑𝒓𝒐𝒙𝒊𝒎𝒂𝒕𝒆𝒍𝒚 𝟐𝟒𝟎
𝒔𝒆𝒂𝒔𝒐𝒏𝒂𝒍 𝒗𝒂𝒓𝒊𝒂𝒕𝒊𝒐𝒏 = 𝟑𝟗𝟎 − 𝟐𝟒𝟎 = 𝟏𝟓𝟎
 𝑻𝒉𝒆 𝒕𝒓𝒆𝒏𝒅 𝒇𝒐𝒓 𝒂𝒖𝒕𝒖𝒎 𝟐𝟎𝟏𝟑 𝒊𝒔 𝒂𝒑𝒑𝒓𝒐𝒙𝒊𝒎𝒂𝒕𝒆𝒍𝒚 𝟑𝟎𝟎.
𝒔𝒆𝒂𝒔𝒐𝒏𝒂𝒍 𝒗𝒂𝒓𝒊𝒂𝒕𝒊𝒐𝒏 = 𝟒𝟓𝟎 − 𝟑𝟎𝟎 = 𝟏𝟓𝟎
150 + 150 + 150
𝑚𝑒𝑎𝑛 𝑠𝑒𝑎𝑠𝑜𝑛𝑎𝑙 𝑣𝑎𝑟𝑖𝑎𝑡𝑖𝑜𝑛 = = 𝟏𝟓𝟎
3
e) Autumn term of 2014: Trend value is 𝒂𝒑𝒑𝒓𝒐𝒙𝒊𝒎𝒂𝒕𝒆𝒍𝒚 = 𝟑𝟓𝟎 and the
𝑠𝑒𝑎𝑠𝑜𝑛𝑎𝑙 𝑣𝑎𝑟𝑖𝑎𝑡𝑖𝑜𝑛 = 𝟏𝟓𝟎
Using the additive model to find the forecast value
𝐹𝑜𝑟𝑒𝑐𝑎𝑠𝑡 𝑣𝑎𝑙𝑢𝑒 = 350 + 150 = 500

33
PRECISION +263775973880 CREATED BY MWEDZI S

3. Zimsec P2 2022
The table below shows the daily records of the sales of eggs in a supermarket in 8 days.
Week Mon Tue Wed Thu Fri Sat Sun Mon
Day
No of crates sold 2 5 4 4 9 7 6 8

(a) Define the term time series


(b) Draw a time series graph to illustrate the data.
(c) Describe the variation of the data
(d) Explain the purpose of smoothering
(e) Calculate the 3 point moving averages and hence draw a trend line.
(f) Use the trend line to forecast the number of crates sold on Tuesday of the following week.

34
PRECISION +263775973880 CREATED BY MWEDZI S

Solution

a) A time series is a data set that tracks a sample over time. OR A time series is a set of
observation taken at specified times, usually at equal intervals.
b) .
10

8
No of crates

35

0
Mon Tue Wed Thur Fri Sat Sun Mon TIME
PRECISION +263775973880 CREATED BY MWEDZI S

c) The time series is showing a general increase of sales with first Monday recording the
lowest sales and Friday recording the highest.
d) The purpose of smothering is to level out the irregular fluctuations in a time series to see a clearer
trend.
e)
day Sales 3 point MA
1 (Mon) 2
2 (Tue) 5 3.7
3 (Wed) 4 4.3
4 (Thu) 4 5.7
5 (Fri) 9 6.7
6 (Sat) 7 7.3
7 (Sun) 6 7
8 (Mon) 8

f) .
𝑥 (𝑑𝑎𝑦 𝑜𝑓 𝑤𝑒𝑒𝑘) 𝒚 (𝒔𝒂𝒍𝒆𝒔)
5 3.7
4 4.3
4 5.7
9 6.7
7 7.3
6 7

The data gives the regression line: 𝒚 = 𝟎. 𝟕𝟓𝟕𝟏𝒙 + 𝟐. 𝟑𝟕𝟔𝟐 which is then used for forecasting.

𝒙 Represents the days of the week. Tuesday of the following week becomes the day 9

𝒚 = 𝟎. 𝟕𝟓𝟕𝟏(𝟗) + 𝟐. 𝟑𝟕𝟔𝟐 = 𝟗. 𝟏𝟗𝟎𝟏 ≈ 𝟗 𝒄𝒓𝒂𝒕𝒆𝒔

36
PRECISION +263775973880 CREATED BY MWEDZI S

SHIFTING THE ORIGIN OF A LINEAR TREND TIME SERIES (𝒚 = 𝒂 + 𝒃𝒙)

Annual linear trend

The annual trend (𝒚 = 𝒂 + 𝒃𝒙) can have its origin shifted annually either backward or forward.

If the annual trend is shifted by c years

 Forward: it becomes 𝒚 = 𝒂 + 𝒃(𝒙 + 𝒄) which simplifies to 𝒚 = 𝒂 + 𝒃𝒄 + 𝒃𝒙


 Backward: it becomes 𝒚 = 𝒂 + 𝒃(𝒙 − 𝒄) which simplifies to 𝒚 = 𝒂 − 𝒃𝒄 + 𝒃𝒙

NB: The gradient does not change after the annual time series is shifted to another origin; only the
constant changes.

Conversion of annual trend equations to monthly, quarterly half yearly etc

Monthly Quarterly Half yearly


𝒂 𝒃 𝒙 𝒂 𝒃 𝒙 𝒂 𝒃 𝒙
𝒚= + ( )( ) 𝒚 = +( )( ) 𝒚 = +( )( )
𝟏𝟐 𝟏𝟐 𝟏𝟐 𝟒 𝟒 𝟒 𝟐 𝟐 𝟐

Example: Zimsec 2020 P1

The following trend equation is given as

𝑦 = 284 + 14.4𝑥 with the origin 1 July 1974.

𝑥 𝑢𝑛𝑖𝑡 = 1 𝑦𝑒𝑎𝑟

𝑦 𝑢𝑛𝑖𝑡 = 𝑎𝑛𝑛𝑢𝑎𝑙 𝑠𝑎𝑙𝑒𝑠 × ($1000)

a) If 1982 was the last year of the data, find the number of years of data used to determine the
equation assuming that the origin has not been moved. [1]
b) Calculate the projected sales for 1985. [2]
c) Find the annual dollar increase. [1]
d) Convert the equation to a monthly equation with the 𝑥 unit = 1month and set the origin at 15
July 1980.
Estimate sales for September 1980. [5]

Solution
a) 1982 − 1974 = 8
b) 1985 − 1974 = 11

37
PRECISION +263775973880 CREATED BY MWEDZI S

There are 11 year so 𝑥 = 11


𝑦 = 284 + 14.4(11) = $442 400

c) Annual increase = gradient of the equation of the trend line=14.4

d) Converting annual trend to monthly

Annual Monthly
𝒚 = 𝒂 + 𝒃𝒙 𝒂 𝒃 𝒙
𝒚= +( )( )
𝟏𝟐 𝟏𝟐 𝟏𝟐
𝑦 = 284 + 14.4𝑥 284 14.4 𝑥
𝑦= +( )( )
12 12 12

284 14.4 𝑥
𝑦= +( )( )
12 12 12
284 14.4𝑥
𝑦= +
12 144
284 14.4𝑥
𝑦= +
12 144
71
𝑦= + 0.1𝑥
3
1 July 1974 to 15 July 1980 there are 72.5 months

Shifting the origin forward to 15 July 1980:

71
𝑦= + 0.1(𝑥 + 72.5)
3

𝑦 = 30.9166667 + 0.1𝑥

Forecasting or predicting sales for September 1980:

• From 15 July 1980 to September 1980 there are 2.5 months


• 𝑦 = 30.9166667 + 0.1(2.5) = 31.17

38

You might also like