1 00:00:00,780 --> 00:00:02,950 We will now go through a derivation of the 2 00:00:02,950 --> 00:00:04,790 law of total variance. 3 00:00:04,790 --> 00:00:08,500 This particular derivation is not insightful. 4 00:00:08,500 --> 00:00:11,380 It will not really give you any intuition as to why the 5 00:00:11,380 --> 00:00:13,580 law of total variance is correct. 6 00:00:13,580 --> 00:00:17,270 On the other hand, it involves some interesting manipulations 7 00:00:17,270 --> 00:00:21,630 that will be useful to be able to follow, and understand the 8 00:00:21,630 --> 00:00:24,870 kinds of objects that they're being moved around, and why 9 00:00:24,870 --> 00:00:26,560 each step is valid. 10 00:00:26,560 --> 00:00:30,400 Our derivation relies on the standard formula that we have 11 00:00:30,400 --> 00:00:32,610 on how to calculate variances. 12 00:00:32,610 --> 00:00:35,630 And our first step is to apply this formula to the 13 00:00:35,630 --> 00:00:37,170 conditional variance. 14 00:00:37,170 --> 00:00:40,170 Now, the conditional variance is like an ordinary variance, 15 00:00:40,170 --> 00:00:43,630 except that it is calculated in a conditional universe. 16 00:00:43,630 --> 00:00:48,400 So we apply this formula, except that the expectation of 17 00:00:48,400 --> 00:00:51,520 X squared is the expectation calculated in 18 00:00:51,520 --> 00:00:53,240 the conditional universe. 19 00:00:53,240 --> 00:00:56,880 And similarly, for the next term it is the square of the 20 00:00:56,880 --> 00:01:00,460 expected value of X. But it's the expected value of X as 21 00:01:00,460 --> 00:01:02,360 calculated in the conditional universe. 22 00:01:06,220 --> 00:01:09,430 So this is an equality between numbers. 23 00:01:15,289 --> 00:01:19,060 What does it translate to? 24 00:01:19,060 --> 00:01:22,450 This has been defined as a random variable that takes 25 00:01:22,450 --> 00:01:27,400 this value when capital Y is equal to little y. 26 00:01:27,400 --> 00:01:31,070 What is the random variable that takes this value when 27 00:01:31,070 --> 00:01:33,500 capital Y is little y? 28 00:01:33,500 --> 00:01:39,740 Well, this random variable here is a random variable that 29 00:01:39,740 --> 00:01:44,390 takes this value when capital Y is equal to little y. 30 00:01:44,390 --> 00:01:51,580 And this random variable here is a random variable that 31 00:01:51,580 --> 00:01:54,910 takes this numerical value when capital Y is 32 00:01:54,910 --> 00:01:56,350 equal to little y. 33 00:01:56,350 --> 00:02:00,290 So to summarize, this is the random variable that takes 34 00:02:00,290 --> 00:02:02,430 this numerical value when capital Y is 35 00:02:02,430 --> 00:02:04,130 equal to little y. 36 00:02:04,130 --> 00:02:07,630 And this is a random variable that takes this value when 37 00:02:07,630 --> 00:02:10,300 capital Y is equal to little y. 38 00:02:10,300 --> 00:02:13,520 This expression, the left hand side is equal to the right 39 00:02:13,520 --> 00:02:16,010 hand side for all y's. 40 00:02:16,010 --> 00:02:19,350 And therefore, this random variable and that random 41 00:02:19,350 --> 00:02:23,140 variable always take the same numerical values no matter 42 00:02:23,140 --> 00:02:25,560 what y happens to be. 43 00:02:25,560 --> 00:02:28,220 So these are identical random variables. 44 00:02:28,220 --> 00:02:31,940 And so we have this equality between random variables. 45 00:02:31,940 --> 00:02:36,000 The next step as we're working towards calculating this first 46 00:02:36,000 --> 00:02:39,310 term here in the law of total variance is to take the 47 00:02:39,310 --> 00:02:41,720 expectation of this expression. 48 00:02:41,720 --> 00:02:43,079 What is it? 49 00:02:43,079 --> 00:02:45,460 We take the expectation of the first term. 50 00:02:45,460 --> 00:02:48,740 It's the expectation of a conditional expectation. 51 00:02:48,740 --> 00:02:52,780 And according to the law of iterated expectations, it is 52 00:02:52,780 --> 00:02:56,460 the same as the unconditional expectation. 53 00:02:56,460 --> 00:03:00,272 And then we have the expected value of the next term. 54 00:03:07,888 --> 00:03:12,110 Next, we want to make some progress towards calculating 55 00:03:12,110 --> 00:03:15,280 this second quantity in the law of total variance. 56 00:03:15,280 --> 00:03:19,329 And the way to calculate it is to just apply this general 57 00:03:19,329 --> 00:03:23,810 property of variances to the special case where X gets 58 00:03:23,810 --> 00:03:28,160 replaced by the expected value of X given Y. 59 00:03:28,160 --> 00:03:32,520 So the first term will be the expected value of our random 60 00:03:32,520 --> 00:03:33,910 variable squared. 61 00:03:33,910 --> 00:03:40,170 Our random variable is the expected value of X given Y. 62 00:03:40,170 --> 00:03:44,490 And the second term involves the expected value of the 63 00:03:44,490 --> 00:03:47,530 random variable whose variance we're considering. 64 00:03:47,530 --> 00:03:52,110 So it's the expected value of this random variable. 65 00:03:52,110 --> 00:03:55,115 So it's the expected value of the conditional expectation. 66 00:03:58,690 --> 00:04:02,010 And everything gets squared. 67 00:04:02,010 --> 00:04:03,520 What is this term? 68 00:04:03,520 --> 00:04:06,570 By the law of iterated expectations, the expected 69 00:04:06,570 --> 00:04:11,550 value of a conditional expectation is the same as the 70 00:04:11,550 --> 00:04:13,990 unconditional expectation. 71 00:04:13,990 --> 00:04:17,319 So this last term here is of this form. 72 00:04:19,920 --> 00:04:25,290 What we will do next is to take this expression here and 73 00:04:25,290 --> 00:04:28,990 that expression here, and add them together. 74 00:04:28,990 --> 00:04:32,180 When we add them, we notice that this term and that term 75 00:04:32,180 --> 00:04:33,260 are the same. 76 00:04:33,260 --> 00:04:34,850 So they cancel out. 77 00:04:34,850 --> 00:04:38,490 And we're left with the expected value of X squared 78 00:04:38,490 --> 00:04:42,420 minus the square of the expected value. 79 00:04:42,420 --> 00:04:46,159 But we know that this is the same as the variance of X. So 80 00:04:46,159 --> 00:04:49,600 we have proved that the sum of these two terms, which are the 81 00:04:49,600 --> 00:04:54,170 two terms up here, give us the variance of X.