1
00:00:00,810 --> 00:00:04,690
Welcome back to practical
time series analysis.

2
00:00:04,690 --> 00:00:07,440
In these lectures we're
looking at forecasting.

3
00:00:07,440 --> 00:00:09,500
We're trying to say
something interesting and

4
00:00:09,500 --> 00:00:15,720
intelligent about a future state of the
system based upon present and past states.

5
00:00:15,720 --> 00:00:18,730
We've already seen how to
simple exponential smoothing.

6
00:00:18,730 --> 00:00:21,480
We will determine a smooth level.

7
00:00:21,480 --> 00:00:25,720
We've done double exponential smoothing
where we come up with a smooth level and

8
00:00:25,720 --> 00:00:28,020
a smooth trend.

9
00:00:28,020 --> 00:00:33,980
And now we're going to bring in a seasonal
effect with triple exponential smoothing.

10
00:00:36,950 --> 00:00:40,300
Our goals in this lecture
are somewhat modest.

11
00:00:40,300 --> 00:00:42,006
We'll be engaging software and

12
00:00:42,006 --> 00:00:45,618
datasets more fully in the next
lecture in the follow on to this one.

13
00:00:45,618 --> 00:00:49,780
But for this lecture, we're going to
try to work you through the basic steps

14
00:00:49,780 --> 00:00:53,675
of triple exponential smoothing in
such a way that you could state and

15
00:00:53,675 --> 00:00:55,840
explain it to a friend or a colleague.

16
00:00:58,926 --> 00:01:03,557
There's a really terrific website
from Nikolaos Kourentzes to try to

17
00:01:03,557 --> 00:01:08,678
capture the difference between additive
and multiplicative seasonality.

18
00:01:08,678 --> 00:01:12,900
If you want to explain to
somebody what a cat is,

19
00:01:12,900 --> 00:01:14,710
I think you're going to have a hard time.

20
00:01:14,710 --> 00:01:17,600
But if you show them 20 different cats,
I think they'll get the idea.

21
00:01:17,600 --> 00:01:20,837
In the same spirit, in the readings and

22
00:01:20,837 --> 00:01:25,850
in past lectures, we've already discussed
additive or multiplicative seasonality.

23
00:01:25,850 --> 00:01:30,450
The virtue of this website and
the exercises that he has there for

24
00:01:30,450 --> 00:01:35,580
you is that you can look at additive and
multiplicative seasonality, and

25
00:01:35,580 --> 00:01:40,340
try to understand in a very intuitive way,
the differences between the two.

26
00:01:40,340 --> 00:01:45,380
I mean, as I look here on
the additive seasonal series,

27
00:01:45,380 --> 00:01:49,710
you can see that there is
certainly a repeating pattern.

28
00:01:49,710 --> 00:01:53,315
There is a seasonality to this dataset.

29
00:01:54,620 --> 00:01:56,792
When I look at the variability,

30
00:01:56,792 --> 00:02:00,980
the variability appears to be
somewhat constant in time.

31
00:02:00,980 --> 00:02:02,670
Okay, perhaps with a little bit of noise.

32
00:02:02,670 --> 00:02:04,140
But basically,

33
00:02:04,140 --> 00:02:08,820
I don't see any systematic changes
in the variability as I move along.

34
00:02:08,820 --> 00:02:13,040
Multiplicative seasonality gives you
more characters to fanning structure.

35
00:02:13,040 --> 00:02:16,760
And the variability really does seem
to be in this case growing in time.

36
00:02:18,020 --> 00:02:21,330
So there's a difference
between additive seasonality,

37
00:02:21,330 --> 00:02:25,320
where to look into the future
we just add a constant amount.

38
00:02:25,320 --> 00:02:29,790
And multiplicative seasonality where
we'll multiply by a constant amount.

39
00:02:32,350 --> 00:02:36,980
Let's see which one Holt Winters
exhibits in their famous example here,

40
00:02:36,980 --> 00:02:38,980
Air Passenger Miles.

41
00:02:38,980 --> 00:02:43,031
So we have an original source for
the data set, but

42
00:02:43,031 --> 00:02:47,757
what these guys were looking
at was during the 1950s,

43
00:02:47,757 --> 00:02:52,881
air passenger miles and
essentially the volume of air travel.

44
00:02:52,881 --> 00:02:57,903
So as I go from the late 40s to
the very early 60s, I certainly

45
00:02:57,903 --> 00:03:03,855
would expect the volume of air passenger
miles to be increasing, and I think

46
00:03:03,855 --> 00:03:10,010
I can talk myself into believing that
there'd be a seasonality there as well.

47
00:03:13,173 --> 00:03:15,780
And the data set does not disappoint.

48
00:03:15,780 --> 00:03:17,900
As I move from the left to the right,

49
00:03:17,900 --> 00:03:22,980
I certainly see that there
is a season involved here.

50
00:03:22,980 --> 00:03:27,230
So I get this repetitive
structure every 12 months.

51
00:03:27,230 --> 00:03:30,430
And also, as I move from left to right,

52
00:03:30,430 --> 00:03:35,630
there's a trend upwards and
the variability also seems to be growing.

53
00:03:35,630 --> 00:03:40,110
So I see the same essential structure
in the data set as I look here.

54
00:03:40,110 --> 00:03:43,650
But as I move from left to right,
the magnitude of the structure,

55
00:03:43,650 --> 00:03:45,660
the size of the structure
seems to be increasing.

56
00:03:46,790 --> 00:03:48,380
If we take logs,

57
00:03:48,380 --> 00:03:53,720
we can look at something that seems to
have more apparent additive seasonality.

58
00:03:53,720 --> 00:03:54,920
This is an old trick.

59
00:03:54,920 --> 00:04:00,810
You know that the log whatever base E,
10, 2 are very common bases

60
00:04:00,810 --> 00:04:06,240
that the logarithm is going to take
multiplication and turn it into addition.

61
00:04:06,240 --> 00:04:09,920
Log of a times b is log a plus log b.

62
00:04:09,920 --> 00:04:13,060
So we're not surprised that we can get
from multiplicative seasonality to

63
00:04:13,060 --> 00:04:15,800
additive based upon taking logs.

64
00:04:17,810 --> 00:04:22,460
Now our current methods are pretty
disappointing on this data set.

65
00:04:22,460 --> 00:04:29,810
If I look on the graph on the left, then I
can see the actual time series in black.

66
00:04:29,810 --> 00:04:34,440
The forecasts are in red and

67
00:04:34,440 --> 00:04:38,250
the amount of error here is I
guess I would say unacceptable.

68
00:04:38,250 --> 00:04:41,930
There's really,
the forecast is not very good using

69
00:04:41,930 --> 00:04:44,440
this first kind of simple
exponential smoothing.

70
00:04:45,520 --> 00:04:49,610
Perhaps a little surprisingly as you
move to double exponential smoothing,

71
00:04:49,610 --> 00:04:52,160
we still have a pretty poor forecast.

72
00:04:52,160 --> 00:04:56,540
So it's really important to include
this seasonal effect in our modeling,

73
00:04:56,540 --> 00:04:58,830
if we want to have a good forecast.

74
00:05:00,380 --> 00:05:04,630
Just as a reminder, the types of
exponential smoothing we've been doing,

75
00:05:04,630 --> 00:05:08,370
of course, have a geometric
series lurking in the background.

76
00:05:08,370 --> 00:05:12,240
But there's some simplifications that you
can make, as we discussed in the readings.

77
00:05:12,240 --> 00:05:15,690
And our terms tend to look like this.

78
00:05:15,690 --> 00:05:20,690
We'll take some Greek letter that
controls how much of the current value of

79
00:05:20,690 --> 00:05:23,140
the system you want to
see compared to history.

80
00:05:23,140 --> 00:05:27,864
We'll take Greek letter times
some sort of fresh new value +

81
00:05:27,864 --> 00:05:32,890
1- Greek letter times
the history of the system.

82
00:05:32,890 --> 00:05:35,030
So this is the common pattern here.

83
00:05:36,070 --> 00:05:39,483
If we want to weight
the new information higher,

84
00:05:39,483 --> 00:05:43,906
that's going to come at the expense
of the history of the system.

85
00:05:47,245 --> 00:05:52,408
Triple exponential smoothing, we can
look at sums of squares of errors or

86
00:05:52,408 --> 00:05:55,930
whatever you like for
your criterion of quality.

87
00:05:55,930 --> 00:06:02,800
Triple exponential smoothing visually
in fact is quite strikingly better.

88
00:06:02,800 --> 00:06:06,810
So we seem to be onto something good here
with this triple exponential smoothing.

89
00:06:06,810 --> 00:06:10,990
We want to be able to include level,
trend, and seasonality.

90
00:06:13,110 --> 00:06:17,480
So we're going to look at,
first, smoothing the level.

91
00:06:18,750 --> 00:06:25,140
So x sub n is a data point and
this is our seasonal bump.

92
00:06:25,140 --> 00:06:27,840
So either adding or
subtracting a certain amount.

93
00:06:29,190 --> 00:06:32,622
And the way we'll smooth the level is by

94
00:06:32,622 --> 00:06:37,519
looking at our smooth level
as alpha times fresh value.

95
00:06:37,519 --> 00:06:43,060
There's your current data point minus
the current seasonal smooth piece.

96
00:06:43,060 --> 00:06:47,944
And in fact, we're assuming
that there are m data points as

97
00:06:47,944 --> 00:06:52,948
we get through a cycle or
a season, I think people would say.

98
00:06:52,948 --> 00:06:56,838
So seasonal n- m is sitting right here.

99
00:06:56,838 --> 00:07:02,560
We've got 1- alpha over on this
side times level n plus trend.

100
00:07:02,560 --> 00:07:08,440
So the smooth level essentially looks
like what we did before, only now instead

101
00:07:08,440 --> 00:07:14,830
of just having alpha times x sub n,
we're doing a seasonally adjusted level.

102
00:07:14,830 --> 00:07:18,100
And we'll try to pick up the seasonal
bump differently in a moment.

103
00:07:20,640 --> 00:07:24,257
We're going to smooth the trend so
the trend,

104
00:07:24,257 --> 00:07:30,029
the current smooth trend is going to
look like beta times level minus level.

105
00:07:30,029 --> 00:07:34,761
Again we're using these smooth levels to
try to get rid of the effects of noise,

106
00:07:34,761 --> 00:07:38,153
and look at the more persistent,
or systematic pieces,

107
00:07:38,153 --> 00:07:41,210
plus 1- beta times
the history here trend n-1.

108
00:07:41,210 --> 00:07:43,750
This is just what we did
in the last lecture.

109
00:07:45,318 --> 00:07:50,118
Finally, we want to smooth the season, and
so we'll bring in a new parameter gamma.

110
00:07:50,118 --> 00:07:55,459
We'll take a gamma times and now here
we're going to bring in new information

111
00:07:55,459 --> 00:08:00,905
as current data point minus the current
smooth level and we'll add to that.

112
00:08:00,905 --> 00:08:02,625
Now look at this piece,

113
00:08:02,625 --> 00:08:08,100
we're going to take 1- gamma times
the past smooth seasonal piece.

114
00:08:08,100 --> 00:08:13,080
So seasonal at time n is going to
look at seasonal at time n- m.

115
00:08:13,080 --> 00:08:15,768
So we're going to reach back along

116
00:08:15,768 --> 00:08:20,650
the time series to the start
of that little cycle going on.

117
00:08:20,650 --> 00:08:25,032
And we'll take our old best
guess at the seasonal bump and

118
00:08:25,032 --> 00:08:29,240
augment it with gamma times
this new piece right here.

119
00:08:32,205 --> 00:08:36,006
In order to update the forecast for
additive seasonality,

120
00:08:36,006 --> 00:08:39,740
it's really quite simple and intuitive.

121
00:08:39,740 --> 00:08:44,790
We'll get our prediction h into
the future as our current smooth level,

122
00:08:45,870 --> 00:08:47,170
and now remember what we did.

123
00:08:47,170 --> 00:08:52,290
We'll take our smooth trend,
that's essentially the step size, and

124
00:08:52,290 --> 00:08:56,850
we'll walk up or
down depending upon the sign, h steps.

125
00:08:56,850 --> 00:08:59,350
So this first piece is accounting for

126
00:08:59,350 --> 00:09:04,190
the smooth level then we'll
bring in our trend contribution.

127
00:09:04,190 --> 00:09:06,660
And we're also going to bring
in a seasonal contribution.

128
00:09:06,660 --> 00:09:11,582
So we're going to get our seasonal
bump as we're looking for

129
00:09:11,582 --> 00:09:15,508
the forecast that n + h,
so h into the future.

130
00:09:15,508 --> 00:09:21,135
So we'll take our seasonal piece here,
n + h, and then- m,

131
00:09:21,135 --> 00:09:28,188
and that's going to give us the updated
forecast using additive seasonality.

132
00:09:32,080 --> 00:09:35,271
If you want multiplicative seasonality,

133
00:09:35,271 --> 00:09:38,911
then instead of adding
you're going to multiply.

134
00:09:38,911 --> 00:09:43,590
So instead of adding a fixed
amount you multiply by 120%, 150%,

135
00:09:43,590 --> 00:09:46,240
whatever's appropriate in your model.

136
00:09:47,880 --> 00:09:51,710
Now people enjoy programming will go out
and write their own code to find alpha,

137
00:09:51,710 --> 00:09:53,500
beta, and gamma, and that's fine.

138
00:09:53,500 --> 00:09:58,440
I solute you, but I think for
our approach here, we'll let the software

139
00:09:58,440 --> 00:10:01,600
find the best values for us, and
also do the predictions for us.

140
00:10:04,770 --> 00:10:09,357
So at this point, you should be able to
turn around to somebody next to you and

141
00:10:09,357 --> 00:10:13,440
explain the whole triple
exponential smoothing approach.

142
00:10:13,440 --> 00:10:15,170
That we're going to smooth level,

143
00:10:15,170 --> 00:10:20,170
we're going to smooth trend, we're
going to smooth the seasonal contribution.

144
00:10:20,170 --> 00:10:24,390
And then for additive seasonality,
we'll add the three of them together.

145
00:10:24,390 --> 00:10:26,820
And in the multiplicative seasonality,

146
00:10:26,820 --> 00:10:32,170
we'll get the seasonal effect
as level plus H trend.

147
00:10:32,170 --> 00:10:35,841
And then, instead of adding we'll be
multiplying by the seasonal bump.