moving averages objectives: d gradeinterpret a time series graph b grade construct a time series...
TRANSCRIPT
Moving AveragesMoving Averages
Objectives:D Grade Interpret a Time Series Graph
B Grade Construct a Time Series Graph and Plot the Moving Averages
Moving AveragesMoving Averages
A line graph is a series of points joined with straight lines
e.g. a patient’s temperature was recorded every 2 hours after receiving medication:
Temperature over time
35
36
37
38
39
40
41
42
0 2 4 6 8 10 12
Time after medication (hrs)
Tem
per
atu
re o
C
Note the features:
Title
Axis Labels
The points are plotted as coordinates
The points are joined with straight lines
A second set (or more) of data may be added to the graph.
What does this line represent?
Normal body temperature
Moving AveragesMoving Averages
Because the line graph of temperature was plotted against timeit can also be called a ‘Time Series Graph’
Time Series Graphs are often used by people to identify trends overa period of time where they may be natural fluctuations.
For example, after installing loft and cavity wall insulation ahouseholder wants to review his gas bills to see if he is saving money.
Moving AveragesMoving Averages
A graph of gas bills plotted against time.
Why is the x axis labelled with years and 1st, 2nd, 3rd, 4th?Why is there so much fluctuation in the graph – is there a pattern?
Cost of Gas Bill
0
50
100
150
200
250
300
1st 2nd 3rd 4th 1st 2nd 3rd 4th
Year / Quarter
Co
st (
£)
2006 2007
Utility (gas, electric, water, etc.,) bills are sent out every 3 months (quarter of a year)The 1st quarter is winter when you would expect to use a lot of gas for heating,the 3rd quarter is the summer when you don’t use the heating.
Moving AveragesMoving Averages
A different number of points for a moving average can be selecteddepending upon the data being analysed. Different types of datasuit different moving averages
Electricity Bill Three-point moving average
Gas Bill Four-point moving average
Half-term test results Five-point moving average
Phone Bill Six-point moving average
Daily Superstore Sales Seven-point moving average
Termly test results
Which type of moving average which suit which data set?
Moving AveragesMoving Averages
Time Series GraphYear 2006 2007 2008Quarter 1st 2nd 3rd 4th 1st 2nd 3rd 4th 1st 2nd 3rd 4th
Ice Cream Sales (£) 340 525 965 470 355 510 1100 375 410 555 1150 485
Plot the data as a time series graph:This is essentially a line graph. The time is always plotted on the x-axis
200
1200
1000
800
600
400
1 st Qtr2 nd Qtr3 rd Qtr4thQtr1 st Qtr
3 rd Qtr4 th Qtr1 st Qtr2 nd Qtr3 rd Qtr
2 nd Qtr
4 th Qtr
2006 2007 2008
Ice
Cre
am S
ales
(£) x
xx x
x
xx
x
xx
x x
Representing DataRepresenting DataMoving AveragesMoving Averages are a way of looking at a trend over a period of time.For a four-point the mean is calculated from the first four pieces of data, then the next point is calculated by moving the selection one place across to calculate the mean of 4 points again
Year 2006 2007 2008Quarter 1st 2nd 3rd 4th 1st 2nd 3rd 4th 1st 2nd 3rd 4th
Ice Cream Sales (£) 340 525 965 470 355 510 1100 375 410 555 1150 485Moving Average
1
The moving average point is plotted in the middle of the 4 points the average is taken from
575 609 585 599 610 623
200
1200
1000
800
600
400
1 st Qtr2 nd Qtr3 rd Qtr4thQtr1 st Qtr
3 rd Qtr4 th Qtr1 st Qtr2 nd Qtr3 rd Qtr
2 nd Qtr
4 th Qtr
2006 2007 2008
Ice
Cre
am S
ales
(£)
xx
x
x
xx
x
xx
x x
x
x x x x x x x x You can see there is a general increase in sales over time
For a 3 point moving averagetake the mean over 3 points,for a 5 point moving averagetake the mean over 5 points,etc.
575
Ice Cream Sales (£) 340 525 965 470 355 510 1100 375 410 555 1150 485Moving Average 575
2579
Calculate the mean of the first 4 points i.e.340+525+965+470 = 575
4
Calculate the mean of the second 4 points i.e.525+965+470 +355= 579
4
Moving AveragesMoving AveragesP20 Q 5
P21 Q 6
Year 2006 2006 2006 2006 2007 2007 2007 2007Quarter 1st 2nd 3rd 4th 1st 2nd 3rd 4thCost £230 £120 £50 £80 £215 £120 £25 £55Four-point moving
average£120 £116
Day Mon Mon Tue Tue Wed Wed Thu Thu Fri FriSession a.m. p.m. a.m. p.m. a.m. p.m. a.m. p.m. a.m. p.m.Number 220 210 243 215 254 218 251 201 185 152
Two point moving average
215 226.5 229 234.5
Moving AveragesMoving AveragesP21 Q 7
P21 Q 8
Quarter Jul-04 Oct-04 Jan-05 Apr-05 Jul-05 Oct-05 Jan-05 Apr-06Shop Sales
Jul-0
4
Oct-04
Jan-
05
Apr-0
5
Jul-0
5
Oct-05
Jan-
05
Apr-0
6
120
100
80
60
40
20
0
Sal
es (
£ th
ousa
nds)
x
x
x
x
x
x
x
Year 2005 2006 2006 2006 2007 2007 2007Session Autumn Spring Summer Autumn Spring Summer AutumnExam Result (%) 86 93 70 83 93 67 77
x
Moving AveragesMoving AveragesP20 Q 5
Year 2006 2006 2006 2006 2007 2007 2007 2007Quarter 1st 2nd 3rd 4th 1st 2nd 3rd 4thCost £230 £120 £50 £80 £215 £120 £25 £55Four-point moving
average£120 £116
1st 2nd 3rd 4th 1st 2nd 3rd 4th 2006 2007
Time (year, quarter)
250
200
150
100
50
0
Cos
t (£)x
x
xx
x
x
xx
£116.25 £110 £103.75
x x x x
The trend is moving downwards which means that the electricity costs are falling
Moving AveragesMoving Averages
P21 Q 6
Day Mon Mon Tue Tue Wed Wed Thu Thu Fri FriSession a.m. p.m. a.m. p.m. a.m. p.m. a.m. p.m. a.m. p.m.Number 220 210 243 215 254 218 251 201 185 152
Two point moving average
215 226.5 229 234.5 M
on a.
m.
Mon
p.m
.Tue
a.m
.Tue
p.m
.W
ed a
.m.
Wed
p.m
.
Thu p
.m.
Thu a
.m.
Fri
a.m.
Fri
p.m
.
270
250
230
210
190
170
150
Num
ber
Pre
sent
xx
x
x
x
x
x
x
x
x
236 234.5 226 193 168.5
xx
x x x xx
x
x
The trend is downwards – starting low on Monday, then rising to Wednesday, butFalling sharply towards Friday.
Moving AveragesMoving AveragesP21 Q 7
P21 Q 8
Jul-0
4
Oct-04
Jan-
05
Apr-0
5
Jul-0
5
Oct-05
Jan-
05
Apr-0
6
120
100
80
60
40
20
0
Sal
es (
£ th
ousa
nds)
x
x
x
x
x
x
x
Year 2005 2006 2006 2006 2007 2007 2007Session Autumn Spring Summer Autumn Spring Summer AutumnExam Result (%) 86 93 70 83 93 67 77
83 82 82 81 79
Quarter Jul-04 Oct-04 Jan-05 Apr-05 Jul-05 Oct-05 Jan-05 Apr-06Shop Sales 100 40 10 80 110 50 12 86
x x x x x x
57.5 60 62.5 63 64.5
c. The trend is slightly upwards
d. The next point would probably lie at 6767= 50+12+86 +x
467 × 4 = 50 + 10 + 86 + x
268 = 146 + x
x = 122 So the next quarter sales would be about £122 000
100
90
80
70
60
Aut-0
5
Spr-0
6
Sum
-06
Aut-0
6
Spr-0
7
Sum
-07
Aut-0
7
x
x
x
x
x
x
xx x x x x
x