1
00:00:00,000 --> 00:00:09,202
So now, the whole point of this
bootstrapping section was to show how we

2
00:00:09,202 --> 00:00:15,530
can use a very simple method for
computing, say, the standard error on a

3
00:00:15,530 --> 00:00:19,039
more complicated statistic like value at
risk.

4
00:00:19,039 --> 00:00:26,082
So if we estimate our five percent value
of risk, our estimate is, is e to the five

5
00:00:26,082 --> 00:00:30,064
percent quantile minus one times my
initial wealth, okay?

6
00:00:30,064 --> 00:00:37,041
Now, we are going to use the bootstrap to
compute a standard error for this value of

7
00:00:37,041 --> 00:00:43,061
risk estimate, and then we will see how
accurate is our estimate value of risk,

8
00:00:44,096 --> 00:00:51,085
alright?
So, we have to write a function that will

9
00:00:51,085 --> 00:00:54,094
evaluate value at risk on our observed
data.

10
00:00:54,094 --> 00:00:59,079
So, this function is slightly more
complicated than the other ones.

11
00:00:59,079 --> 00:01:04,064
It has two lines, three lines of code
instead of two lines of code.

12
00:01:04,312 --> 00:01:10,012
This function takes in data or randomly
commuted indices and there are two

13
00:01:10,012 --> 00:01:14,858
additional arguments, the probability
level for your value at risk and your

14
00:01:14,858 --> 00:01:19,703
initial wealth, right?
So, how do you compute value at risk?

15
00:01:19,703 --> 00:01:25,025
This is my return data.
So, the first thing I do is I compute the

16
00:01:25,025 --> 00:01:31,048
quantile for the continuously compounded
return, which is the mean evaluated at my

17
00:01:31,048 --> 00:01:37,063
randomly permuted data plus the standard
deviation on the randomly permuted data

18
00:01:37,063 --> 00:01:41,911
times the quantile of a standard normal
based on the probability.

19
00:01:41,911 --> 00:01:47,641
Then, my value at risk is e to the
quantile minus one times my initial

20
00:01:47,641 --> 00:01:51,580
wealth.
And then, I return the result, okay?

21
00:01:51,580 --> 00:01:57,031
So, I run the boot function and here's the
output.

22
00:01:57,031 --> 00:02:04,014
So, my estimate for variant risk is
-13,769, right?

23
00:02:04,014 --> 00:02:12,085
The bootstrap estimate of bias is 210.
So, this is saying that, I over-predict my

24
00:02:12,085 --> 00:02:19,829
value at risk by $210 on average, okay?
So, there's you know, again, the, is this

25
00:02:19,829 --> 00:02:24,702
a large bias?
Well, again, this is an estimate of loss

26
00:02:24,702 --> 00:02:30,807
of $13,000 and I have a bias of $200.
So, the bias from a, from a economic

27
00:02:30,807 --> 00:02:36,424
perspective is not very big.
What about the standard error of my

28
00:02:36,424 --> 00:02:39,625
estimate?
The standard error of the estimate is

29
00:02:39,625 --> 00:02:43,262
$1,800.
So, you think of the help, so the standard

30
00:02:43,262 --> 00:02:48,772
error is about, you know, a little less
than one, a little more than one-tenth of

31
00:02:48,772 --> 00:02:54,094
the size of the value at risk number.
So, there's a little bit of uncertainty.

32
00:02:54,094 --> 00:03:00,009
And then, you would like to compute a 95
percent confidence interval, then we can

33
00:03:00,009 --> 00:03:05,307
either do estimate plus or minus two times
the standard error or, or look at the

34
00:03:05,307 --> 00:03:09,036
quantiles.
So, here's the bootstrap distribution of

35
00:03:09,036 --> 00:03:14,513
value at risk and we can see that it's a
little asymmetric, right?

36
00:03:14,513 --> 00:03:21,603
So, it's dipping down a little bit in the
q, q plot but, so this isn't quite normal.

37
00:03:21,603 --> 00:03:27,487
So, the percentile confidence interval is
probably more accurate than the estimate

38
00:03:27,487 --> 00:03:30,081
plus or minus two times the standard
error.

39
00:03:31,024 --> 00:03:36,354
So, we're going to run the boot CI
function, we'll compute the two confidence

40
00:03:36,354 --> 00:03:42,051
intervals like we did before and so here's
the normal confidence intervals.

41
00:03:42,051 --> 00:03:47,038
So, this is estimate plus or minus two
times the bootstrap standard error.

42
00:03:47,038 --> 00:03:52,854
So, on the low end, we loose $17,000 and
on the upper of the confidence interval,

43
00:03:52,854 --> 00:03:58,048
we loose $10,000.
So, with 95 percent confidence, we think

44
00:03:58,048 --> 00:04:03,076
our true loss is somewhere between 17,000
and 10,000.

45
00:04:03,076 --> 00:04:09,074
Now, that's a difference of $7,000.
That's, that's actually pretty big.

46
00:04:10,292 --> 00:04:16,790
The percentile method is similar on the
low end, we lose $17,000 and on the high

47
00:04:16,790 --> 00:04:22,070
end, we lose $10,000.
You know, again, the range of values here

48
00:04:22,070 --> 00:04:28,039
is about $7,000 and again, that's a pretty
wide confidence interval.

49
00:04:28,087 --> 00:04:35,075
So how, how well do we estimate value at
risk at the five percent level?

50
00:04:36,013 --> 00:04:40,070
Okay, I mean the confidence interval is
reasonably wide.

51
00:04:41,228 --> 00:04:47,247
Now, one of the things that you will learn
as, as you go out in the real world, is

52
00:04:47,247 --> 00:04:54,039
nobody when they, when you see s value at
risk report and practice, you never see

53
00:04:54,039 --> 00:05:00,094
confidence intervals on these reports.
And you know, and that could be quiet

54
00:05:00,094 --> 00:05:06,422
dangerous particularly, because, you know,
we see there is a, a fair bit of

55
00:05:06,422 --> 00:05:11,019
uncertainty here.
So, your risk manager is saying, you know,

56
00:05:11,019 --> 00:05:16,316
my best guess is, you know, in the middle
of the confidence interval, right?

57
00:05:16,316 --> 00:05:21,754
But they are not saying, well, this guess
could be off by a certain amount.

58
00:05:21,754 --> 00:05:28,913
And, and that's important to know.
So anyway, its just a, it's just a fact of

59
00:05:28,913 --> 00:05:33,046
life that you often, don't often see these
things.

60
00:05:33,046 --> 00:05:38,122
And one of the things that you should take
away from this lecture is there's no

61
00:05:38,122 --> 00:05:42,030
reason why you shouldn't report a
confidence interval, right?

62
00:05:42,030 --> 00:05:47,004
It was three lines of code to compute the
standard error on value at risk.

63
00:05:47,004 --> 00:05:51,077
It was extremely simple to do.
And because it's so easy to do, it should

64
00:05:51,077 --> 00:05:55,061
be done routinely.
And, and, and you, and you do get much

65
00:05:55,061 --> 00:06:00,655
more information that way.
When you read about the bootstrap, most,

66
00:06:00,655 --> 00:06:07,028
you often see this quotation that the
bootstrap gets its name from this phrase,

67
00:06:07,028 --> 00:06:13,007
picking yourself up from your bootstraps.
And, and so literally, a bootstrap is a

68
00:06:13,007 --> 00:06:16,091
strap on a boot, right?
And so, the idea is, you know, maybe it's

69
00:06:16,091 --> 00:06:20,068
the idea is you're, you're kind of
starting from the ground up.

70
00:06:20,270 --> 00:06:23,081
I don't know, that's sort of my
interpretation.

71
00:06:24,155 --> 00:06:27,058
So, I mean, that's the origin of the
phrase bootstrapping.

72
00:06:27,058 --> 00:06:32,088
The origin of this word for the technique
comes from picking yourself up from your

73
00:06:32,088 --> 00:06:36,000
bootstraps.
And you know, how you're supposed to

74
00:06:36,000 --> 00:06:39,056
interpret that.
I sort of, kind of, interpret that as you

75
00:06:39,056 --> 00:06:43,787
know, kind of you know, you're doing a
calculation that, you know, starting from

76
00:06:43,787 --> 00:06:46,820
the original sample.
And then, you know, you know, coming up

77
00:06:46,820 --> 00:06:52,059
from there or something like that I guess.
It's a little bit of an unusual word.

78
00:06:54,250 --> 00:06:59,720
Sometimes you will hear the bootstrap
referred to as a re-sampling algorithm.

79
00:06:59,720 --> 00:07:04,243
And that is very descriptive because
that's exactly what you are doing.

80
00:07:04,243 --> 00:07:10,115
When you are bootstrapping, you are just
re-sampling from your observed data and,

81
00:07:10,115 --> 00:07:15,006
and doing a computation.
You want to re-sample from the data object

82
00:07:15,006 --> 00:07:18,014
that you are computing your statistics
from.

83
00:07:18,014 --> 00:07:23,032
So you know, I'm computing a mean of the
continuously compounded returns.

84
00:07:23,032 --> 00:07:28,029
Well, returns are computed from prices.
So, and the prices are and, and the

85
00:07:28,029 --> 00:07:31,052
returns are the first difference in the
prices.

86
00:07:31,052 --> 00:07:38,578
So, if you re-sample just from the prices,
then when you're computing returns it's a

87
00:07:38,578 --> 00:07:44,050
little bit weird because returns depend
upon two adjacent observations.

88
00:07:44,050 --> 00:07:51,060
If you bootstrap from prices you know,
you've destroyed this relationship between

89
00:07:51,060 --> 00:07:56,041
prices that you've seen in the day, you
know, the prices are sort of going up.

90
00:07:56,041 --> 00:08:02,515
And if you ran, if you just bootstrap from
prices then, then you kind of destroy the,

91
00:08:02,740 --> 00:08:07,862
the price distribution.
I, I guess the answer is the return data

92
00:08:07,862 --> 00:08:13,007
is closer, is generally close to being
covariant stationary.

93
00:08:13,007 --> 00:08:17,020
It's not trending, it's uncorrelated over
time and so on.

94
00:08:17,020 --> 00:08:22,050
But the price data is nonstationary, and
it's not uncorrelated over time.

95
00:08:22,050 --> 00:08:28,009
The price today is correlated with the
price yesterday and, and so on and so

96
00:08:28,009 --> 00:08:30,679
forth.
So, so, for the purpose of what we're

97
00:08:30,679 --> 00:08:35,527
doing here, it's not the same thing to
boot strap from prices and then compute

98
00:08:35,527 --> 00:08:41,010
returns and then compute your statistics.
You would not get the same distribution of

99
00:08:41,010 --> 00:08:44,053
returns as you would get from this
bootstrapping return.
