00:02
Right.
00:02
So we're looking at simple moving averages, specifically a four week and a five week moving average.
00:10
And then ultimately we want to find the mean square error of these.
00:14
So we're looking at a table that contains the gasoline sales in thousands of dollars.
00:23
These are in thousands.
00:26
These are weeks right here.
00:31
And let's go ahead and do this.
00:32
So the four week moving average is computed by taking a few week.
00:40
Four weeks, add them together, divided by how many error, and that's going to be the forecast for week five.
00:45
So the week five value would be equal to week one plus week two, plus week three, plus week four, all divided by four.
01:04
So in our case, it's going to be 18 plus 21 plus 18 plus 24, all divided by four.
01:16
That number is going to go here.
01:18
And then week six would be equal to week one plus week two, plus week three.
01:36
Let me fix this, my pen kind of bled there, plus week four plus week five, all divided by five.
01:52
Excuse me four.
01:53
Whoops, not week one.
01:54
Sorry, i jumped ahead myself.
01:56
Sorry about that.
01:57
Week two, plus week three, plus week four, plus week five, divided by four.
02:02
And that, for our case, this example is going to be these.
02:07
Numbers add together 18 no excuse me 21 plus 18 plus 24 plus 18 all over 4 and then just for completeness or just to make sure we're seeing the trend i should say week 7 is going to be week 3 plus week 4 plus week 5 plus week 6 all over 5 all over 4 so in that case we these ones add together 18 plus 24 plus 18 plus 15 all over four then that would go in week seven so we go so i've done that already with our spreadsheet here uh that's just making life a lot easier so here are the the four week moving averages right here so 21 the 20 and a quarter are these four added together whatever four is that same thing down here it's actually it's kind of interesting it's the same thing well, actually, it's not too surprising, because if you notice, the values are the same, right? it's just 18s moved down here.
03:33
And then for the 7 week 7, it's these ones add together, and that goes here.
03:37
That's the 18 .75, and so on and so forth.
03:40
So there we go.
03:41
There's moving averages.
03:44
And now to find the mean square error in general, it's the following.
03:58
So mean square error, what that means is we're squaring some values.
04:01
So what that means is you're taking the x value at some week.
04:08
Minus the five week, in this case the four week moving average.
04:16
Four week moving average squared.
04:22
So that's what i mean when we say squared error.
04:25
We take the x value.
04:26
So 18 minus this number, and we take that number and square it.
04:30
And this number we're subtracting is the moving average value.
04:35
Four week moving average.
04:36
We square that difference.
04:39
But we're doing that for all the values.
04:41
So we're going to take the sum of all those and divide by how many there are.
04:47
So in this case, there's going to be 1, 2, 3, 4, 7, 8.
04:52
In this case, it's going to be 8.
04:53
So it's going to be n is how many there are.
04:57
And just for completeness, we'd probably have the sigma where you start with i is 1 up to n, where x would be i here.
05:10
The 4 -week moving average, 4 -week moving average index to i.
05:18
There we go.
05:19
So, again, spreadsheets are great for that.
05:25
And this is what we get...