1
00:00:11,100 --> 00:00:15,210
OK, so in this lecture, we are going to discuss Etes for Beginners.

2
00:00:15,810 --> 00:00:20,840
This is the lecture you should watch to gain some intuition behind the techniques in this section,

3
00:00:20,850 --> 00:00:24,070
but you don't necessarily care about how or why it works.

4
00:00:24,750 --> 00:00:30,240
So to recap what we said in the intro, the basic premise of this section is the moving average.

5
00:00:30,780 --> 00:00:32,810
The moving average is a simple concept.

6
00:00:33,150 --> 00:00:36,120
You take a window and slide it across the time series.

7
00:00:36,450 --> 00:00:40,920
And at each point in the Time series, you take the average of all the numbers in that window.

8
00:00:41,320 --> 00:00:44,190
That's called the simple moving average in pendas.

9
00:00:44,190 --> 00:00:46,470
You can do this in just one line of code.

10
00:00:47,520 --> 00:00:53,460
Now, you might think that this is too simplistic for the real world, but in fact, this simple concept

11
00:00:53,610 --> 00:00:58,350
is used for algorithmic trading, for presenting covid counts to the public and so forth.

12
00:01:02,760 --> 00:01:08,640
Now, the simple moving average is, in fact, a bit too simple, one way to view it is it's equally

13
00:01:08,640 --> 00:01:12,670
weighted since each point you, including your average, matters the same amount.

14
00:01:13,290 --> 00:01:16,880
Basically, if you have end points, then each point gets a weight of one over end.

15
00:01:18,240 --> 00:01:23,820
In contrast, we also have the exponentially weighted moving average, which weights each point exponentially

16
00:01:24,030 --> 00:01:25,170
going back in time.

17
00:01:26,070 --> 00:01:30,960
So in this case, we don't have a sliding window, but instead all past data points count.

18
00:01:31,320 --> 00:01:33,420
Going back to the start of your Time series.

19
00:01:34,810 --> 00:01:40,420
The intuition behind this is it's saying Newar points matter more than older points, so they get higher

20
00:01:40,420 --> 00:01:41,020
weights.

21
00:01:41,470 --> 00:01:46,390
But essentially the effect is the same for both the ESMAY and the WEMA.

22
00:01:46,570 --> 00:01:49,150
The output looks like a smoothed out version of the input.

23
00:01:50,050 --> 00:01:54,070
That's the meat tends to lag a bit more, but they both basically do the same thing.

24
00:01:58,780 --> 00:02:03,940
So how can we use the exponentially weighted moving average to actually build a forecasting model?

25
00:02:04,960 --> 00:02:08,500
Well, the simplest method is called a simple exponential smoothing.

26
00:02:09,340 --> 00:02:14,300
Basically, this assumes that your time series fluctuates around some constant value in time.

27
00:02:15,370 --> 00:02:21,050
Therefore, what the model tries to do is it tries to learn what this average value is by using the

28
00:02:21,290 --> 00:02:25,430
WEMA in order to forecast beyond the data.

29
00:02:25,600 --> 00:02:30,420
It simply assumes that the final GWM value will propagate into the future.

30
00:02:30,970 --> 00:02:35,770
And of course, this makes sense according to the assumptions of the model, which is that the TIME

31
00:02:35,770 --> 00:02:38,920
series is a constant value, plus some random noise.

32
00:02:40,030 --> 00:02:44,170
Note that in its terminology, we call this constant value the level.

33
00:02:48,940 --> 00:02:53,500
OK, so the next model we are going to learn about is Holtze linear trend model.

34
00:02:54,160 --> 00:02:56,210
Basically, it's exactly how it sounds.

35
00:02:56,710 --> 00:03:00,290
This is a model that assumes there is a linear trend in your Time series.

36
00:03:00,730 --> 00:03:02,590
Now, how it does this is pretty cool.

37
00:03:02,890 --> 00:03:07,520
It basically uses two exponentially weighted moving averages at the same time.

38
00:03:08,470 --> 00:03:14,050
So you have one moving average for the level and you also have one moving average to learn the trend.

39
00:03:14,620 --> 00:03:19,060
The forecast is then just a linear equation using this level and trend.

40
00:03:20,660 --> 00:03:25,430
You may recall from your high school math studies that the equation for a line is Y equals M, X plus

41
00:03:25,430 --> 00:03:29,930
B or slope multiplied by X value plus intercept.

42
00:03:31,190 --> 00:03:33,170
In this case, our slope is the trend.

43
00:03:33,410 --> 00:03:37,640
Our X value is the number of steps in the forecast and our intercept is the level.

44
00:03:38,360 --> 00:03:44,060
So you can see that with this model, our forecast becomes a line that can go in any direction which

45
00:03:44,060 --> 00:03:48,050
is more powerful than the previous forecast, which had to be a horizontal line.

46
00:03:52,780 --> 00:03:56,230
The next model we will learn about is the full whole winters' model.

47
00:03:56,710 --> 00:03:59,380
This model is a model that adds seasonality.

48
00:04:00,070 --> 00:04:05,260
Basically, it's still the same concepts where we use an exponentially weighted moving average to learn

49
00:04:05,260 --> 00:04:06,010
each component.

50
00:04:06,610 --> 00:04:12,340
That is to say, in addition to the level and trend, we now have yet another moving average to estimate

51
00:04:12,340 --> 00:04:13,500
the seasonal component.

52
00:04:15,170 --> 00:04:19,050
So the seasonal component is assumed to be constant over each season.

53
00:04:19,520 --> 00:04:24,980
So what that means is if I add plus five in May, twenty twenty one, it will also add plus five and

54
00:04:24,980 --> 00:04:28,840
May twenty, twenty two plus five and May twenty, twenty three and so forth.

55
00:04:29,330 --> 00:04:30,790
So that's the basic idea.

56
00:04:31,400 --> 00:04:35,770
The seasonal component is the part of the time series that repeats every season.

57
00:04:40,570 --> 00:04:44,980
The final thing I want to mention in this lecture is that there are different ways to combine each of

58
00:04:44,980 --> 00:04:46,030
these components.

59
00:04:47,080 --> 00:04:49,800
Initially, we assume that each component was additive.

60
00:04:50,320 --> 00:04:55,810
That is the time series value is equal to the level plus the trend plus the seasonal component.

61
00:04:57,150 --> 00:05:02,100
However, it's also possible for any of these relationships to be multiplicative instead.

62
00:05:02,700 --> 00:05:07,140
So, for example, we could have the level times, the trend times, the seasonal component.

63
00:05:08,740 --> 00:05:14,170
Note that this is yet another motivation for why we take the log as a useful transformation for Time

64
00:05:14,170 --> 00:05:14,800
series.

65
00:05:15,700 --> 00:05:20,980
Recall that when you take the log of two variables being multiplied together, it turns into addition.

66
00:05:21,490 --> 00:05:25,180
In other words, the log of a product is equal to the sum of logs.

67
00:05:26,050 --> 00:05:29,590
OK, so that's the basic intuition for each technique we will study.

68
00:05:30,070 --> 00:05:32,160
Thanks for listening and I'll see you in the next lecture.
