1
00:00:11,010 --> 00:00:16,440
OK, so the next step in our notebook, now that we know how the forecast function works, is to actually

2
00:00:16,440 --> 00:00:19,690
use the forecast function to see how our model behaves.

3
00:00:20,430 --> 00:00:25,740
We'll start by plotting the conditional volatility that our model has learned from some arbitrary date

4
00:00:25,740 --> 00:00:27,080
I chose beforehand.

5
00:00:27,630 --> 00:00:30,660
As you recall, I've stored this in a column called Arche one.

6
00:00:36,430 --> 00:00:42,280
Now, the reason I chose this date is because the conditional volatility on this day has a very high

7
00:00:42,280 --> 00:00:45,040
value compared to the others, as you can see.

8
00:00:46,570 --> 00:00:52,030
So what we want to observe is how does the forecast evolve over time starting from this value?

9
00:00:53,050 --> 00:00:57,880
OK, so just keep in your mind that this date is 2011, 08, 09.

10
00:01:02,550 --> 00:01:08,490
The next step is to create a forecast, well, sit index to true, although this isn't needed and will

11
00:01:08,490 --> 00:01:12,390
set start equal to August one, which includes the date of interest.

12
00:01:18,620 --> 00:01:23,910
The next step is to check the variance of our forecast for the dates surrounding our start date.

13
00:01:25,010 --> 00:01:30,350
This is just so we can observe once again that any date before the start date we passed in the forecast,

14
00:01:30,590 --> 00:01:32,480
we'll have not a number of values.

15
00:01:38,860 --> 00:01:43,510
OK, so we can see that any date before August one does not have a forecast.

16
00:01:49,050 --> 00:01:54,810
The next step as a sanity check is to get the shape of a single row of our variance forecast.

17
00:01:58,520 --> 00:02:03,230
So as you can see, we have five hundred values, which is what we set for the horizon.

18
00:02:06,440 --> 00:02:10,360
The next step is to get the index of the date we are interested in.

19
00:02:11,390 --> 00:02:17,210
The reason we want to do this is we would like to know what the date is, 500 steps ahead, since that

20
00:02:17,210 --> 00:02:18,980
will be the end of our forecast.

21
00:02:22,350 --> 00:02:25,320
OK, so the index of interest is four zero to.

22
00:02:28,480 --> 00:02:33,020
The next step is to check the index value at four zero two plus five hundred.

23
00:02:33,490 --> 00:02:36,190
Again, this represents the end of our forecast.

24
00:02:39,900 --> 00:02:45,090
OK, so the date at the end of our forecast is 12, 13, 08, 06.

25
00:02:49,190 --> 00:02:55,360
The next step is to take what we've just learned and store our variance forecast in our to data frame,

26
00:02:56,240 --> 00:02:58,620
so for the first index into the log function.

27
00:02:58,910 --> 00:03:04,460
Notice I've passed in 2011, 08, 10 up to 2013, 08, 06.

28
00:03:05,150 --> 00:03:09,410
For the second index, we're going to create a new column called Arche one forecast.

29
00:03:11,060 --> 00:03:16,550
On the right side, you can see that we're getting the variance forecasts for 2011, 08, 09.

30
00:03:17,690 --> 00:03:23,570
I've also converted this into an umpire, Ray, since we do not want this to be represented as a series

31
00:03:23,570 --> 00:03:24,510
or a data frame.

32
00:03:25,070 --> 00:03:30,190
If we did use a series or a data frame, it would not have the right indices to match up with the other

33
00:03:30,210 --> 00:03:30,620
two.

34
00:03:31,160 --> 00:03:34,070
So it's simpler to just convert it into an umpire.

35
00:03:35,900 --> 00:03:40,040
Furthermore, notice that we take the square root since we want the volatility.

36
00:03:44,970 --> 00:03:50,530
OK, so the next step is to plot our forecast, along with the predicted conditional volatility.

37
00:03:51,090 --> 00:03:56,940
Note that I've set the dates to surround at the beginning of our forecast, but to cut off around 2012,

38
00:03:57,510 --> 00:04:02,010
as you'll see, the forecast will converge much faster than the full five hundred steps.

39
00:04:07,360 --> 00:04:13,630
OK, so as expected, what we see is that the volatility forecast starts off at a very high value and

40
00:04:13,630 --> 00:04:16,420
then gets lower and lower until it converges.

41
00:04:20,050 --> 00:04:26,710
The next step is to get the index for another specially chosen date, which is 2011, 08 17.

42
00:04:28,410 --> 00:04:34,480
So the reason I chose this date is because this date happens to have an uncharacteristically low volatility.

43
00:04:35,610 --> 00:04:40,740
The goal of all this is to see for ourselves that no matter where the volatility starts from, they

44
00:04:40,740 --> 00:04:42,690
end up converging to the same value.

45
00:04:46,690 --> 00:04:49,600
OK, so the index of interest is four zero eight.

46
00:04:52,670 --> 00:04:57,770
The next step is to check the end date of our forecast, which is four zero eight plus five hundred.

47
00:05:01,280 --> 00:05:04,970
As you can see, it's 12, 08, 14.

48
00:05:07,820 --> 00:05:13,170
So the next step is to grab a forecast for the second date and stored in our data data frame.

49
00:05:13,700 --> 00:05:18,650
This code is pretty much the same as what we had before, except we have different dates and have stored

50
00:05:18,650 --> 00:05:21,530
this in a new column called Arche one for Carcillo.

51
00:05:26,750 --> 00:05:30,850
OK, so the next step is to plot both forecasts at the same time.

52
00:05:37,090 --> 00:05:42,850
So we can see that the result is what I've said you should expect, no matter what the starting volatility

53
00:05:42,850 --> 00:05:46,440
is, both forecasts end up converging to the same value.

54
00:05:50,620 --> 00:05:55,690
So the next step in this script will be to show that this value, which the forecasts converge to,

55
00:05:55,930 --> 00:05:59,270
is actually the theoretical, unconditional variance.

56
00:06:00,070 --> 00:06:04,810
So let's start by using the results objects from earlier and looking at the programs attribute.

57
00:06:09,410 --> 00:06:13,910
So we can see that this is a series that stores Mu, Omega and Alpha1.

58
00:06:17,350 --> 00:06:22,390
The next step is to use the formula we derived earlier for the unconditional variance.

59
00:06:22,780 --> 00:06:26,140
This is a mega divided by one minus Alpha one.

60
00:06:30,300 --> 00:06:32,400
OK, so we get about one point four.

61
00:06:35,380 --> 00:06:40,900
The next step is to check the final value of our first forecast, which started at a very high number,

62
00:06:40,900 --> 00:06:41,740
as you recall.

63
00:06:45,220 --> 00:06:49,510
As you can see, the final value is the same, which is about one point for.

64
00:06:52,130 --> 00:06:57,350
The next step is to check the final value of our second forecast, which started at a very low number.

65
00:07:01,360 --> 00:07:04,610
Again, you can see that the final value is still the same.

66
00:07:04,630 --> 00:07:06,130
About one point four.
