1 00:00:01,300 --> 00:00:06,490 We have already worked through some examples in which X was a 2 00:00:06,490 --> 00:00:10,220 random variable with a given PDF, and we considered the 3 00:00:10,220 --> 00:00:15,490 problem of finding the PDF of Y for the case where Y was the 4 00:00:15,490 --> 00:00:22,120 function x cubed or the function of the form a/X. What 5 00:00:22,120 --> 00:00:26,540 both of these examples have in common is that Y is a 6 00:00:26,540 --> 00:00:28,680 monotonic function of X. 7 00:00:28,680 --> 00:00:34,200 In this case, Y is increasing with X. In this case, Y was 8 00:00:34,200 --> 00:00:37,970 decreasing with X. It turns out that there is a general 9 00:00:37,970 --> 00:00:43,160 formula that gives us the PDF of Y in terms of the PDF of X 10 00:00:43,160 --> 00:00:45,330 in the special case where we're dealing 11 00:00:45,330 --> 00:00:47,530 with a monotonic function. 12 00:00:47,530 --> 00:00:52,510 So, let us assume that g is a strictly increasing function. 13 00:00:52,510 --> 00:00:56,560 And what that means is that, if x is a number or smaller 14 00:00:56,560 --> 00:01:01,890 than some other number x prime, the value of g of x is 15 00:01:01,890 --> 00:01:06,560 going to be smaller than the value of g x prime. 16 00:01:06,560 --> 00:01:08,900 So, when you increase the argument of the function, the 17 00:01:08,900 --> 00:01:11,470 function increases. 18 00:01:11,470 --> 00:01:15,110 To keep things simple, we will also assume that the function 19 00:01:15,110 --> 00:01:20,120 g is smooth, in particular that it is differentiable. 20 00:01:20,120 --> 00:01:22,600 Then we have a diagram such as this one. 21 00:01:22,600 --> 00:01:27,330 Here is x, and y is given by a function of x. 22 00:01:27,330 --> 00:01:30,590 It's a smooth function, and that function keeps 23 00:01:30,590 --> 00:01:32,710 increasing. 24 00:01:32,710 --> 00:01:35,979 Now, because of the assumptions we have made on g, 25 00:01:35,979 --> 00:01:38,570 we have an interesting situation. 26 00:01:38,570 --> 00:01:43,450 Given a value of x, a corresponding value of y will 27 00:01:43,450 --> 00:01:46,550 be determined according to the function g. 28 00:01:46,550 --> 00:01:49,450 But we can also go the other way. 29 00:01:49,450 --> 00:01:54,630 If I tell you a value of y, then you can specify for me 30 00:01:54,630 --> 00:01:59,100 one and only one value of x that gives rise to this 31 00:01:59,100 --> 00:02:00,600 particular y. 32 00:02:00,600 --> 00:02:04,550 So, the function g takes us from x's to y's, but you can 33 00:02:04,550 --> 00:02:10,020 also go back the opposite way from y's to values of x. 34 00:02:10,020 --> 00:02:14,030 And the mapping that takes us from y's to x's, this is the 35 00:02:14,030 --> 00:02:16,820 inverse of the function g. 36 00:02:16,820 --> 00:02:19,310 And we give a name to that inverse function, 37 00:02:19,310 --> 00:02:21,150 and we call it h. 38 00:02:21,150 --> 00:02:26,900 So, h of y is the value of x that produces a 39 00:02:26,900 --> 00:02:28,720 specific value y. 40 00:02:31,370 --> 00:02:36,079 Let us now move on with the program of finding the PDF of 41 00:02:36,079 --> 00:02:40,650 Y. We will follow the usual two step procedure. 42 00:02:40,650 --> 00:02:50,390 And the first step is to find the CDF of Y. 43 00:02:50,390 --> 00:02:54,380 So we fix some little y, And we want to find the 44 00:02:54,380 --> 00:02:58,810 probability that the random variable y takes a value in 45 00:02:58,810 --> 00:03:00,500 this range. 46 00:03:00,500 --> 00:03:02,960 When does this happen? 47 00:03:02,960 --> 00:03:07,530 For Y to take a value in this range, it must be the case 48 00:03:07,530 --> 00:03:13,780 that X takes a value in this range here. 49 00:03:13,780 --> 00:03:18,690 Values of X smaller than this particular number result in 50 00:03:18,690 --> 00:03:22,130 values of Y that are less than or equal to 51 00:03:22,130 --> 00:03:23,730 this particular number. 52 00:03:23,730 --> 00:03:27,230 So, we can rewrite the event of interest in terms of the 53 00:03:27,230 --> 00:03:32,270 random variable X and write it as follows. 54 00:03:32,270 --> 00:03:39,590 We need to have x less than or equal to h of little y. 55 00:03:39,590 --> 00:03:46,470 But this is just the CDF of X evaluated at h of y. 56 00:03:46,470 --> 00:03:50,710 We now carry out to the second step of our program. 57 00:03:50,710 --> 00:03:54,600 We take derivatives of both sides and we find that the PDF 58 00:03:54,600 --> 00:03:58,329 of Y is equal to the derivative of the right hand 59 00:03:58,329 --> 00:04:03,540 side, the derivative of the CDF is a PDF. 60 00:04:03,540 --> 00:04:06,760 And then the chain rule tells us that we also need to take 61 00:04:06,760 --> 00:04:11,412 the derivative of the term inside here with respect to 62 00:04:11,412 --> 00:04:12,662 its argument. 63 00:04:17,329 --> 00:04:22,440 And this is a general formula for the PDF of a strictly 64 00:04:22,440 --> 00:04:28,670 increasing function of a random variable X. How about 65 00:04:28,670 --> 00:04:32,070 the case of a decreasing function? 66 00:04:32,070 --> 00:04:37,510 So, let us assume that g now is a strictly decreasing 67 00:04:37,510 --> 00:04:42,659 function of X. 68 00:04:42,659 --> 00:04:46,020 So, we might have a plot for g that looks 69 00:04:46,020 --> 00:04:47,350 something like this. 70 00:04:51,040 --> 00:04:53,250 What happens in this case? 71 00:04:53,250 --> 00:04:56,305 We can start doing a calculation of this kind. 72 00:05:02,710 --> 00:05:07,060 But now, how can we rewrite this event? 73 00:05:07,060 --> 00:05:11,790 The random variable Y will take a value less than or 74 00:05:11,790 --> 00:05:15,310 equal to this number little y. 75 00:05:15,310 --> 00:05:18,370 When does this happen? 76 00:05:18,370 --> 00:05:22,420 When the value of g of x is less than y. 77 00:05:22,420 --> 00:05:26,100 And that happens for x's in this range. 78 00:05:26,100 --> 00:05:31,690 So, this is the set of x's for which is the value of g of x 79 00:05:31,690 --> 00:05:35,650 is less than or equal to this particular number y. 80 00:05:35,650 --> 00:05:40,260 So the event of interest in that case is the event that X 81 00:05:40,260 --> 00:05:48,200 is larger than or equal to h of y, which is 1 minus the 82 00:05:48,200 --> 00:05:55,880 probability that X is less than h of y. 83 00:05:55,880 --> 00:05:59,330 Because X is a continuous random variable, we can change 84 00:05:59,330 --> 00:06:03,460 this inequality to one that allows the 85 00:06:03,460 --> 00:06:05,540 possibility of equality. 86 00:06:05,540 --> 00:06:12,790 And so this is 1 minus the CDF of X evaluated at h of y. 87 00:06:12,790 --> 00:06:17,270 Now we take the derivatives of both sides and we find the PDF 88 00:06:17,270 --> 00:06:22,960 or Y being equal to, there's a minus sign here, then the 89 00:06:22,960 --> 00:06:26,180 derivative of the CDF, which is the PDF. 90 00:06:29,100 --> 00:06:32,250 And finally, the derivative of the function h. 91 00:06:36,400 --> 00:06:41,970 Now in this case, g is a decreasing function of x. 92 00:06:41,970 --> 00:06:45,240 So when x goes down, y goes up. 93 00:06:45,240 --> 00:06:49,510 When x goes up, y goes down. 94 00:06:49,510 --> 00:06:54,920 This means that when y goes up, x goes down. 95 00:06:54,920 --> 00:07:00,350 So it means that the inverse function h is going to be also 96 00:07:00,350 --> 00:07:01,795 monotonically decreasing. 97 00:07:05,900 --> 00:07:10,030 Since it is decreasing, it means that the slope, the 98 00:07:10,030 --> 00:07:13,220 derivative of the function h is going to 99 00:07:13,220 --> 00:07:17,200 be either 0 or negative. 100 00:07:17,200 --> 00:07:23,150 And so minus a negative value gives us the absolute value of 101 00:07:23,150 --> 00:07:24,300 that number. 102 00:07:24,300 --> 00:07:32,820 So we can rewrite this by removing this minus sign here, 103 00:07:32,820 --> 00:07:38,250 and putting an absolute value in this place. 104 00:07:38,250 --> 00:07:42,650 Of course, in the case where g is an increasing function, 105 00:07:42,650 --> 00:07:44,740 when x goes up, y goes up. 106 00:07:44,740 --> 00:07:48,500 This means that when y goes up, x goes up. 107 00:07:48,500 --> 00:07:52,550 So h in that case would have been an increasing function, 108 00:07:52,550 --> 00:07:56,060 so this number here would have been a non-negative number, 109 00:07:56,060 --> 00:07:59,800 and so it would be the same as the absolute value. 110 00:07:59,800 --> 00:08:02,485 So using these absolute values, we obtain formulas 111 00:08:02,485 --> 00:08:06,420 that are exactly the same in both cases of increasing and 112 00:08:06,420 --> 00:08:10,950 decreasing functions, and so our final conclusion is that 113 00:08:10,950 --> 00:08:16,574 in either case, the PDF of Y is given in terms of the PDF 114 00:08:16,574 --> 00:08:21,770 of X times the derivative of this inverse function. 115 00:08:21,770 --> 00:08:26,180 Let us now apply the formula that we have in our hands for 116 00:08:26,180 --> 00:08:30,990 the monotonic case to a particular example, where y is 117 00:08:30,990 --> 00:08:35,440 the square of X, and where X is uniform on the 118 00:08:35,440 --> 00:08:37,679 interval 0 to 1. 119 00:08:37,679 --> 00:08:45,350 So the function g, in our case, the function g is the 120 00:08:45,350 --> 00:08:46,600 square function. 121 00:08:51,550 --> 00:08:54,910 Now, you could argue here that this function is not 122 00:08:54,910 --> 00:08:58,000 monotonic, so how can we apply our results? 123 00:08:58,000 --> 00:09:01,540 On the other hand, the random variable X takes values on the 124 00:09:01,540 --> 00:09:07,240 interval from 0 to 1, and therefore the form of the 125 00:09:07,240 --> 00:09:12,000 function g outside that range does not concern us. 126 00:09:12,000 --> 00:09:16,060 Over the range of values of interest, the function g is a 127 00:09:16,060 --> 00:09:18,750 monotonic function. 128 00:09:18,750 --> 00:09:21,060 So, what is the correspondence? 129 00:09:21,060 --> 00:09:26,100 y is going to be equal to x squared. 130 00:09:26,100 --> 00:09:28,840 That's the g of x function. 131 00:09:28,840 --> 00:09:34,460 And when that happens, we have the relation that x is going 132 00:09:34,460 --> 00:09:38,350 to be the square root of y. 133 00:09:38,350 --> 00:09:44,250 This tells us that the inverse function, h of y, which tells 134 00:09:44,250 --> 00:09:49,200 us what is the particular x associated with a given y, the 135 00:09:49,200 --> 00:09:54,510 inverse function takes the form square root of y. 136 00:09:54,510 --> 00:09:58,190 So now we can go ahead and use the formula. 137 00:09:58,190 --> 00:10:03,080 The density at some particular little y where that little y, 138 00:10:03,080 --> 00:10:08,150 belongs to the range of values of interest, x things values 139 00:10:08,150 --> 00:10:14,380 between 0 and 1, so y also takes values between 0 and 1. 140 00:10:14,380 --> 00:10:19,540 So over that range, the density of Y is the density of 141 00:10:19,540 --> 00:10:28,300 X, which is uniform, therefore it is equal to 1, times the 142 00:10:28,300 --> 00:10:31,360 derivative of the square root function. 143 00:10:31,360 --> 00:10:36,130 And the derivative of the square root function is 1 over 144 00:10:36,130 --> 00:10:40,250 2 times the square root of y. 145 00:10:40,250 --> 00:10:44,290 As you can see, the amount of calculations involved here are 146 00:10:44,290 --> 00:10:48,580 rather simpler compared to what we would have to do if we 147 00:10:48,580 --> 00:10:51,440 were to go through our two step program 148 00:10:51,440 --> 00:10:54,130 and work with CDFs. 149 00:10:54,130 --> 00:10:57,950 All that you need to do is essentially to identify the 150 00:10:57,950 --> 00:11:03,890 inverse function that given a y produces x's, and write down 151 00:11:03,890 --> 00:11:05,140 the corresponding derivative.