1 00:00:00,060 --> 00:00:02,500 The following content is provided under a Creative 2 00:00:02,500 --> 00:00:04,019 Commons license. 3 00:00:04,019 --> 00:00:06,360 Your support will help MIT OpenCourseWare 4 00:00:06,360 --> 00:00:10,730 continue to offer high quality educational resources for free. 5 00:00:10,730 --> 00:00:13,340 To make a donation or view additional materials 6 00:00:13,340 --> 00:00:17,217 from hundreds of MIT courses, visit MIT OpenCourseWare 7 00:00:17,217 --> 00:00:17,842 at ocw.mit.edu. 8 00:00:21,860 --> 00:00:23,570 PROFESSOR: So far we had a function, 9 00:00:23,570 --> 00:00:27,840 and then we differentiated to get an equation of this type. 10 00:00:27,840 --> 00:00:29,810 But now, we're given this equation. 11 00:00:29,810 --> 00:00:31,320 And we have to go backwards, want 12 00:00:31,320 --> 00:00:35,706 to find the stochastic process that satisfies this equation. 13 00:00:35,706 --> 00:00:45,700 So goal is to find a stochastic process 14 00:00:45,700 --> 00:00:48,295 X(t) satisfying this equation. 15 00:00:55,910 --> 00:01:06,130 In other words, we want X of t to be the integral of mu dS 16 00:01:06,130 --> 00:01:07,325 plus sigma... 17 00:01:17,460 --> 00:01:18,740 The goal is clear. 18 00:01:18,740 --> 00:01:19,340 We want that. 19 00:01:22,520 --> 00:01:26,505 And so these type of equations are 20 00:01:26,505 --> 00:01:30,630 called differential equations, I hope you already know that. 21 00:01:30,630 --> 00:01:33,220 Also for PDE, partial differential equations, 22 00:01:33,220 --> 00:01:35,590 so even when it's not stochastic, 23 00:01:35,590 --> 00:01:38,310 these are not easy problems. 24 00:01:38,310 --> 00:01:40,150 At least not easy in the sense that, 25 00:01:40,150 --> 00:01:42,310 if you're given an equation, typically you 26 00:01:42,310 --> 00:01:45,290 don't expect to have a closed form solution. 27 00:01:45,290 --> 00:01:48,430 So even if you find this X, most of the time, 28 00:01:48,430 --> 00:01:50,910 it's not in a very good form. 29 00:01:50,910 --> 00:01:55,130 Still, a very important result that you should first 30 00:01:55,130 --> 00:01:58,790 note before trying to solve any of the differential equation 31 00:01:58,790 --> 00:02:03,690 is that, as long as mu and sigma are reasonable functions, 32 00:02:03,690 --> 00:02:05,740 there does exist a solution. 33 00:02:05,740 --> 00:02:07,730 And it's unique. 34 00:02:07,730 --> 00:02:10,630 So we have the same correspondence with this PDE. 35 00:02:10,630 --> 00:02:13,080 You're given a PDE, or given a differential equation, not 36 00:02:13,080 --> 00:02:14,970 a stochastic differential equation, 37 00:02:14,970 --> 00:02:18,060 you know that, if you're given a reasonable differential 38 00:02:18,060 --> 00:02:21,550 equation, then a solution exists. 39 00:02:21,550 --> 00:02:22,730 And it's unique. 40 00:02:22,730 --> 00:02:26,416 So the same principle holds in stochastic world. 41 00:02:26,416 --> 00:02:28,360 Now, let me state it formally. 42 00:02:33,070 --> 00:02:47,040 This stochastic equation star has a solution that is unique, 43 00:02:47,040 --> 00:02:51,920 of course with boundary condition-- has a solution. 44 00:02:51,920 --> 00:03:18,344 And given the initial points-- so 45 00:03:18,344 --> 00:03:20,760 if you're given the initial point of a stochastic process, 46 00:03:20,760 --> 00:03:23,520 then a solution is unique. 47 00:03:30,840 --> 00:03:43,210 Just check, yes-- as long as mu and sigma are reasonable. 48 00:03:51,310 --> 00:03:55,180 One way it can be reasonable, if it satisfies this conditions. 49 00:04:27,800 --> 00:04:29,300 These are very technical conditions. 50 00:04:29,300 --> 00:04:31,258 But at least let me parse to you what they are. 51 00:04:31,258 --> 00:04:36,730 They say, if you fix a time coordinate and you change x, 52 00:04:36,730 --> 00:04:39,630 you look at the difference between the values of mu 53 00:04:39,630 --> 00:04:44,650 when you change the second variable and the sigma. 54 00:04:44,650 --> 00:04:51,460 Then the change in your function is bounded by the distance 55 00:04:51,460 --> 00:04:56,570 between the two points by some constant K. 56 00:04:56,570 --> 00:05:00,730 So mu and sigma cannot change too much when you change 57 00:05:00,730 --> 00:05:04,660 your space variable a little bit. 58 00:05:04,660 --> 00:05:07,130 It can only change up to the distance of how much you 59 00:05:07,130 --> 00:05:08,540 change the coordinate. 60 00:05:08,540 --> 00:05:09,970 So that's the first condition. 61 00:05:09,970 --> 00:05:16,730 Second condition says, when you grow your x, 62 00:05:16,730 --> 00:05:18,382 very similar condition. 63 00:05:18,382 --> 00:05:20,340 Essentially it says it cannot blow up too fast, 64 00:05:20,340 --> 00:05:21,690 the whole thing. 65 00:05:21,690 --> 00:05:25,690 This one is something about the difference between two values. 66 00:05:25,690 --> 00:05:31,309 This one is about how it expands as your space variable grows. 67 00:05:31,309 --> 00:05:32,600 These are technical conditions. 68 00:05:32,600 --> 00:05:37,620 And many cases, they will hold. 69 00:05:37,620 --> 00:05:41,450 So don't worry too much about the technical conditions. 70 00:05:41,450 --> 00:05:45,160 Important thing here is that, given a differential equation, 71 00:05:45,160 --> 00:05:48,940 you don't expect to have a good closed form. 72 00:05:48,940 --> 00:05:52,880 But you do expect to have a solution of some form. 73 00:05:57,260 --> 00:06:01,060 OK, let's work out some examples. 74 00:06:05,260 --> 00:06:08,240 Here is one of the few stochastic differential 75 00:06:08,240 --> 00:06:09,590 equations that can be solved. 76 00:06:21,090 --> 00:06:22,360 This one can be solved. 77 00:06:22,360 --> 00:06:26,376 And you already know what X is. 78 00:06:26,376 --> 00:06:29,700 But let's pretend you don't know what X is. 79 00:06:29,700 --> 00:06:31,316 And let's try to solve it. 80 00:06:34,490 --> 00:06:36,530 I will show you an approach, which 81 00:06:36,530 --> 00:06:40,280 can solve some differential equations, some SDEs. 82 00:06:40,280 --> 00:06:43,390 But this really won't happen that much. 83 00:06:43,390 --> 00:06:48,890 Still, it's like a starting point. 84 00:06:48,890 --> 00:06:50,280 There's that. 85 00:06:50,280 --> 00:06:55,500 And assume X(0) [INAUDIBLE]. 86 00:06:55,500 --> 00:06:56,855 And mu, sigma are constants. 87 00:07:05,130 --> 00:07:07,080 Just like when solving differential equations, 88 00:07:07,080 --> 00:07:10,430 first thing you'll do is just guess, suppose, guess. 89 00:07:23,870 --> 00:07:45,252 If you want this to happen, then d of X of t is-- OK. 90 00:07:48,210 --> 00:07:51,290 x is just the second variable. 91 00:07:51,290 --> 00:07:52,872 And then these two have to match. 92 00:07:52,872 --> 00:07:54,080 That has to be equal to that. 93 00:07:54,080 --> 00:07:55,830 That has to be equal to that. 94 00:07:55,830 --> 00:08:10,320 So we know that del f over del t, mu of X of t 95 00:08:10,320 --> 00:08:11,516 is equal to mu of f. 96 00:08:20,240 --> 00:08:24,260 So we assumed that this is a solution then differentiated 97 00:08:24,260 --> 00:08:24,990 that. 98 00:08:24,990 --> 00:08:28,470 And then, if that's a solution, these all have to match. 99 00:08:28,470 --> 00:08:30,210 You get this equation. 100 00:08:30,210 --> 00:08:32,669 If you look at that, that tells you 101 00:08:32,669 --> 00:08:36,429 that f is an exponential function in the x variable. 102 00:08:36,429 --> 00:08:40,640 So it's e to the sigma times x. 103 00:08:40,640 --> 00:08:44,750 And then we have a constant term, plus some a times 104 00:08:44,750 --> 00:08:45,730 a function of t. 105 00:08:50,680 --> 00:08:54,770 The only way it can happen is if it's in this form. 106 00:08:54,770 --> 00:08:57,000 So it's exponential function in x. 107 00:08:57,000 --> 00:09:02,130 And in the time variable, it's just some constant. 108 00:09:02,130 --> 00:09:04,540 When you fix a t, it's a constant. 109 00:09:04,540 --> 00:09:06,310 And when you fix a t and change x, 110 00:09:06,310 --> 00:09:08,590 it has to look like an exponential function. 111 00:09:08,590 --> 00:09:11,064 It has to be in this form, just by the second equation. 112 00:09:13,730 --> 00:09:16,590 Now, go back to this equation. 113 00:09:16,590 --> 00:09:25,520 What you get is partial f over partial t is now a times g 114 00:09:25,520 --> 00:09:30,350 prime of t, f... 115 00:09:43,580 --> 00:09:44,580 AUDIENCE: Excuse me. 116 00:09:44,580 --> 00:09:46,200 PROFESSOR: Mm-hm. 117 00:09:46,200 --> 00:09:49,420 AUDIENCE: That one in second to last line, yeah. 118 00:09:49,420 --> 00:09:52,790 So why is it minus mu there at the end? 119 00:09:52,790 --> 00:09:55,364 PROFESSOR: It's equal. 120 00:09:55,364 --> 00:09:56,364 AUDIENCE: Oh, all right. 121 00:09:56,364 --> 00:09:57,030 PROFESSOR: Yeah. 122 00:10:03,860 --> 00:10:06,260 OK, and then let's plug it in. 123 00:10:06,260 --> 00:10:13,270 So we have a of g prime t, f, plus 1/2 of sigma 124 00:10:13,270 --> 00:10:17,094 square f equals mu of f. 125 00:10:17,094 --> 00:10:25,525 In other words, a of g prime of t is mu minus... 126 00:10:25,525 --> 00:10:26,025 square. 127 00:10:29,590 --> 00:10:36,502 g(t) is mu times some constant c_1 plus c_2. 128 00:10:44,380 --> 00:10:48,980 OK, and then what we got is original function f of t of x 129 00:10:48,980 --> 00:10:54,980 is e to the sigma*x plus mu minus 1 over 2 sigma square t 130 00:10:54,980 --> 00:10:57,590 plus some constant. 131 00:10:57,590 --> 00:11:01,520 And that constant can be chosen because we 132 00:11:01,520 --> 00:11:09,270 have the initial condition, x of 0 equals 0. 133 00:11:09,270 --> 00:11:14,203 That means if t is equal to 0, f(0, 0) is equal to e to the c. 134 00:11:14,203 --> 00:11:16,510 That has to be x_0. 135 00:11:16,510 --> 00:11:21,701 In different words, this is just x_0 times e to the sigma*x plus 136 00:11:21,701 --> 00:11:25,550 mu minus 1 over 2 sigma square of t. 137 00:11:25,550 --> 00:11:27,802 Just as we expected, we got this. 138 00:11:33,210 --> 00:11:35,940 So some stochastic differential equations 139 00:11:35,940 --> 00:11:39,920 can be solved by analyzing it. 140 00:11:39,920 --> 00:11:43,010 But I'm not necessarily saying that this is a better way 141 00:11:43,010 --> 00:11:45,020 to do it than just guessing. 142 00:11:45,020 --> 00:11:46,830 Just looking at it, and, you know, 143 00:11:46,830 --> 00:11:50,027 OK, it has to be exponential function. 144 00:11:50,027 --> 00:11:50,610 You know what? 145 00:11:50,610 --> 00:11:54,430 I'll just figure out what these are. 146 00:11:54,430 --> 00:11:56,030 And I'll come up with this formula 147 00:11:56,030 --> 00:11:59,110 without going through all those analysis. 148 00:11:59,110 --> 00:12:01,435 I'm not saying that's a worse way than actually going 149 00:12:01,435 --> 00:12:02,310 through the analysis. 150 00:12:02,310 --> 00:12:05,250 Because, in fact, what we did is we kind of already 151 00:12:05,250 --> 00:12:08,780 knew the answer and are fitting into that answer. 152 00:12:12,940 --> 00:12:14,790 Still, it can be one approach where 153 00:12:14,790 --> 00:12:17,590 you don't have a reasonable guess of what the X_t has 154 00:12:17,590 --> 00:12:21,772 to be, maybe try to break it down into pieces like this 155 00:12:21,772 --> 00:12:24,410 and backtrack to figure out the function. 156 00:12:24,410 --> 00:12:26,260 Let me give you one more example where we 157 00:12:26,260 --> 00:12:28,580 do have an explicit solution. 158 00:12:28,580 --> 00:12:30,700 And then I'll move on and show you 159 00:12:30,700 --> 00:12:33,367 how to do when there is no explicit solution 160 00:12:33,367 --> 00:12:35,700 or when you don't know how to find an explicit solution. 161 00:12:38,304 --> 00:12:39,710 Maybe let's keep that there. 162 00:12:52,240 --> 00:12:55,781 Second equation is called this. 163 00:13:16,655 --> 00:13:18,080 What's the difference? 164 00:13:18,080 --> 00:13:22,830 The only difference is that you don't have an X here. 165 00:13:22,830 --> 00:13:26,560 So previously, our main drift term 166 00:13:26,560 --> 00:13:30,330 also was proportional to the current value. 167 00:13:30,330 --> 00:13:33,980 And the error was also dependent on the current value 168 00:13:33,980 --> 00:13:36,350 or is proportional to the current value. 169 00:13:36,350 --> 00:13:38,580 But here now the drift term is something 170 00:13:38,580 --> 00:13:42,610 like an exponential-- minus exponential. 171 00:13:42,610 --> 00:13:45,460 But still, it's proportional to the current value. 172 00:13:45,460 --> 00:13:49,120 But the error term is just some noise. 173 00:13:49,120 --> 00:13:51,690 Irrelevant of what the value is, this has 174 00:13:51,690 --> 00:13:54,070 the same variance as the error. 175 00:13:54,070 --> 00:13:58,550 So it's a slightly different-- oh, what is it? 176 00:13:58,550 --> 00:14:00,770 It's a slightly different process. 177 00:14:00,770 --> 00:14:09,100 And it's known as Ornstein-Uhlenbeck process. 178 00:14:18,530 --> 00:14:23,410 And this is used to model a mean-reverting stochastic 179 00:14:23,410 --> 00:14:24,980 process. 180 00:14:24,980 --> 00:14:30,230 For alpha greater than 0, notice that if X deviates from 0, 181 00:14:30,230 --> 00:14:33,940 this gives a force that drives the stochastic process back 182 00:14:33,940 --> 00:14:36,940 to 0, that's negatively proportional 183 00:14:36,940 --> 00:14:37,902 to your current value. 184 00:14:40,740 --> 00:14:44,330 So yeah, this is used to model some mean-reverting stochastic 185 00:14:44,330 --> 00:14:45,130 processes. 186 00:14:45,130 --> 00:14:50,785 And they first used it to study the behavior of gases. 187 00:14:57,230 --> 00:14:58,330 I don't exactly see why. 188 00:14:58,330 --> 00:15:01,810 But that's what they say. 189 00:15:01,810 --> 00:15:03,710 Anyway, so this is another thing that 190 00:15:03,710 --> 00:15:05,510 can be solved by doing similar analysis. 191 00:15:10,490 --> 00:15:14,590 But if you try the same method, it will fail. 192 00:15:14,590 --> 00:15:34,550 So as a test function, your guess, initial guess, will be-- 193 00:15:34,550 --> 00:15:36,576 or a(0) is equal to 1. 194 00:15:40,878 --> 00:15:44,070 Now, honestly, I don't know how to come up with this guess. 195 00:15:49,137 --> 00:15:50,720 Probably, if you're really experienced 196 00:15:50,720 --> 00:15:52,870 with stochastic differential equations, 197 00:15:52,870 --> 00:15:56,510 you'll see some form, like you'll 198 00:15:56,510 --> 00:16:00,340 have some feeling on how this process will look like. 199 00:16:00,340 --> 00:16:03,330 And then try this, try that, and eventually something 200 00:16:03,330 --> 00:16:05,266 might succeed. 201 00:16:05,266 --> 00:16:06,890 That's the best explanation I can give. 202 00:16:06,890 --> 00:16:08,264 I can't really give you intuition 203 00:16:08,264 --> 00:16:10,590 why that's the right guess. 204 00:16:10,590 --> 00:16:13,570 Given some stochastic differential equation, 205 00:16:13,570 --> 00:16:15,356 I don't know how to say that you should 206 00:16:15,356 --> 00:16:16,730 start with this kind of function, 207 00:16:16,730 --> 00:16:18,722 this kind of function. 208 00:16:18,722 --> 00:16:20,430 And it was the same when, if you remember 209 00:16:20,430 --> 00:16:22,980 how we solved ordinary differential equations 210 00:16:22,980 --> 00:16:25,680 or partial differential equations, most of the time 211 00:16:25,680 --> 00:16:27,206 there is no good guess. 212 00:16:27,206 --> 00:16:31,690 It's only when your given formula has some specific form 213 00:16:31,690 --> 00:16:33,334 such a thing happens. 214 00:16:33,334 --> 00:16:37,250 So let's see what happens here. 215 00:16:37,250 --> 00:16:39,310 That was given. 216 00:16:39,310 --> 00:16:42,990 Now, let's do exactly the same as before. 217 00:16:42,990 --> 00:16:46,940 Differentiate it, and let me go slow. 218 00:16:46,940 --> 00:16:49,240 So we have a prime of t. 219 00:16:49,240 --> 00:16:54,440 By chain rule, a prime of t and that value, 220 00:16:54,440 --> 00:16:59,240 that part will be equal to X(t) over a(t). 221 00:16:59,240 --> 00:17:00,440 This is chain rule. 222 00:17:00,440 --> 00:17:03,390 So I differentiate that to get a prime t. 223 00:17:03,390 --> 00:17:05,580 That stays just as it was. 224 00:17:05,580 --> 00:17:09,609 But that can be rewritten as X(t) divided by a(t). 225 00:17:09,609 --> 00:17:15,329 And then plus a(t) times the differential of that one. 226 00:17:15,329 --> 00:17:17,109 And that is just b(t)*dB(t). 227 00:17:29,180 --> 00:17:31,870 You don't have to differentiate that once more, even 228 00:17:31,870 --> 00:17:34,630 though it's stochastic calculus, because that's 229 00:17:34,630 --> 00:17:35,500 a very subtle point. 230 00:17:35,500 --> 00:17:39,090 And there's also one exercise about it in your homework. 231 00:17:39,090 --> 00:17:42,300 But when you have a given stochastic process written 232 00:17:42,300 --> 00:17:46,190 already in this integral form, if we remember 233 00:17:46,190 --> 00:17:49,410 the definition of an integral, at least how I defined it, 234 00:17:49,410 --> 00:17:52,560 is that it was an inverse operation of a differential. 235 00:17:52,560 --> 00:17:55,660 So when you differentiate this, you just get that term. 236 00:17:55,660 --> 00:17:57,290 What I'm trying to say is, there is 237 00:17:57,290 --> 00:18:02,830 no term, no term where you have to differentiate this one more. 238 00:18:07,060 --> 00:18:11,780 Prime dt, something like that, we don't have this term. 239 00:18:15,180 --> 00:18:16,170 This can be confusing. 240 00:18:16,170 --> 00:18:17,360 But think about it. 241 00:18:22,580 --> 00:18:26,690 Now, we laid it out and just compare. 242 00:18:26,690 --> 00:18:32,110 So minus alpha of X of t is equal to a prime t 243 00:18:32,110 --> 00:18:36,260 over a(t) X(t). 244 00:18:36,260 --> 00:18:42,590 And your second term, sigma*dB(t) is equal to a(t) 245 00:18:42,590 --> 00:18:43,400 times b(t). 246 00:18:47,240 --> 00:18:48,660 But these two cancel. 247 00:18:51,240 --> 00:18:57,746 And we see that a(t) has to be e to the minus alpha t. 248 00:19:06,510 --> 00:19:09,785 This says that is an exponential. 249 00:19:09,785 --> 00:19:10,660 Now, plug it in here. 250 00:19:10,660 --> 00:19:11,201 You get b(t). 251 00:19:17,772 --> 00:19:18,940 And that's it. 252 00:19:18,940 --> 00:19:21,096 So plug it back in. 253 00:19:21,096 --> 00:19:32,085 X of t is e to the minus alpha*t of x of 0 plus 0 to t sigma e 254 00:19:32,085 --> 00:19:33,067 to the alpha*s. 255 00:19:56,640 --> 00:20:02,670 So this is a variance, expectation is 0, 256 00:20:02,670 --> 00:20:05,210 because that's a Brownian motion. 257 00:20:05,210 --> 00:20:08,420 This term, as we expected, as time passes, 258 00:20:08,420 --> 00:20:12,776 goes to 0, exponential decay. 259 00:20:12,776 --> 00:20:18,576 And that is kind of hinted by this fact, the mean reversion. 260 00:20:18,576 --> 00:20:21,610 So if you start from some value, at least the drift term 261 00:20:21,610 --> 00:20:25,380 will go to 0 quite quickly. 262 00:20:25,380 --> 00:20:29,120 And then the important term will be the noise term 263 00:20:29,120 --> 00:20:30,200 or the variance term. 264 00:20:35,237 --> 00:20:35,820 Any questions? 265 00:20:45,750 --> 00:20:49,991 And I'm really emphasizing a lot of times today, 266 00:20:49,991 --> 00:20:51,490 but really you can forget about what 267 00:20:51,490 --> 00:20:53,370 I did in the past two boards, this board 268 00:20:53,370 --> 00:20:54,789 and the previous board. 269 00:20:54,789 --> 00:20:56,705 Because most of the times, it will be useless. 270 00:20:59,220 --> 00:21:01,970 And so now I will describe what you'll 271 00:21:01,970 --> 00:21:05,090 do if you're given a stochastic differential equation, 272 00:21:05,090 --> 00:21:06,991 and you have a computer in front of you. 273 00:21:15,860 --> 00:21:18,038 What if such method fails? 274 00:21:30,030 --> 00:21:31,570 And it will fail most of the time. 275 00:21:36,210 --> 00:21:38,100 That's when we use these techniques called 276 00:21:38,100 --> 00:21:53,840 finite difference method, Monte Carlo simulation, or tree 277 00:21:53,840 --> 00:21:54,340 method. 278 00:22:04,130 --> 00:22:06,250 The finite difference method, you probably 279 00:22:06,250 --> 00:22:09,610 already saw it, if you took a differential equation course. 280 00:22:09,610 --> 00:22:10,740 But let me review it. 281 00:22:19,520 --> 00:22:24,230 This is for PDEs or ODEs, for ODE, PDE, not 282 00:22:24,230 --> 00:22:26,636 stochastic differential equations. 283 00:22:26,636 --> 00:22:29,010 But it can be adapted to work for stochastic differential 284 00:22:29,010 --> 00:22:30,640 equations. 285 00:22:30,640 --> 00:22:32,540 So I'll work with an example. 286 00:22:36,090 --> 00:22:46,445 Let u of t be u prime of t plus-- u prime of t 287 00:22:46,445 --> 00:22:53,220 be u(t) plus 2, u_0 is equal to 0. 288 00:22:53,220 --> 00:22:54,630 Now, this has an exact solution. 289 00:22:54,630 --> 00:22:57,095 But let's pretend that there is no exact solution. 290 00:22:57,095 --> 00:23:00,890 And if you want to do it numerically, 291 00:23:00,890 --> 00:23:04,180 you want to find the value of u equals-- u(1) numerically. 292 00:23:07,155 --> 00:23:08,660 And here's what you're going to do. 293 00:23:08,660 --> 00:23:10,660 You're going to chop up the interval from 0 to 1 294 00:23:10,660 --> 00:23:12,590 into very fine pieces. 295 00:23:12,590 --> 00:23:17,050 So from 0 to 1, chop it down into tiny pieces. 296 00:23:20,460 --> 00:23:22,100 And since I'm in front of a blackboard, 297 00:23:22,100 --> 00:23:25,190 my tiniest piece will be 1 over 2 and 1. 298 00:23:25,190 --> 00:23:27,550 I'll just take two steps. 299 00:23:27,550 --> 00:23:29,400 But you should think of it as really 300 00:23:29,400 --> 00:23:33,090 repeating this a lot of times. 301 00:23:33,090 --> 00:23:35,480 I'll call my step to be h. 302 00:23:35,480 --> 00:23:40,800 So in my case, I'm increasing my steps by 1 over 2 at each time. 303 00:23:40,800 --> 00:23:44,710 So what is u of 1 over 2? 304 00:23:44,710 --> 00:23:47,135 Approximately, by Taylor's formula, 305 00:23:47,135 --> 00:23:53,844 it's u(0) plus 1/2 times u prime of 0. 306 00:23:53,844 --> 00:23:55,010 That's Taylor approximation. 307 00:23:57,590 --> 00:23:59,910 OK, u(0) we already know. 308 00:23:59,910 --> 00:24:02,650 It's given to be equal to 0. 309 00:24:02,650 --> 00:24:05,700 u prime of 0, on the other hand, is given by this differential 310 00:24:05,700 --> 00:24:07,520 equation. 311 00:24:07,520 --> 00:24:12,830 So it's 1 over 2 times 5 times u(0) plus 2. 312 00:24:12,830 --> 00:24:13,930 u(0) is 0. 313 00:24:13,930 --> 00:24:15,040 So we get equal to 1. 314 00:24:17,940 --> 00:24:20,932 Like we have this value equal to 1, approximately. 315 00:24:20,932 --> 00:24:22,015 I don't know what happens. 316 00:24:22,015 --> 00:24:24,410 But it will be close to 1. 317 00:24:24,410 --> 00:24:28,170 And then for the next thing, u1. 318 00:24:28,170 --> 00:24:32,300 This one is, again by Taylor approximation, is u of 1 over 2 319 00:24:32,300 --> 00:24:37,720 plus 1 over 2 u prime of 1 over 2. 320 00:24:37,720 --> 00:24:40,520 And now you know the value of u of 1 over 2, approximate value, 321 00:24:40,520 --> 00:24:41,277 by this. 322 00:24:41,277 --> 00:24:41,860 So plug it in. 323 00:24:41,860 --> 00:24:48,552 You have 1 plus 1 over 2 and, again, 5 times u(1/2) plus 2. 324 00:24:48,552 --> 00:24:50,000 If you want to do the computation, 325 00:24:50,000 --> 00:24:51,510 it should give 9 over 2. 326 00:24:55,740 --> 00:24:58,240 It's really simple. 327 00:24:58,240 --> 00:25:01,790 The key idea here is just u prime 328 00:25:01,790 --> 00:25:05,720 is given by an equation, this equation. 329 00:25:05,720 --> 00:25:09,267 So you can compute it once you know the value of u 330 00:25:09,267 --> 00:25:09,850 at that point. 331 00:25:12,610 --> 00:25:16,030 And basically, the method is saying take h to be very small, 332 00:25:16,030 --> 00:25:17,590 like 1 over 100. 333 00:25:17,590 --> 00:25:19,540 Then you just repeat it 1 over 100 times. 334 00:25:19,540 --> 00:25:23,760 So the equation is the i plus 1 step value 335 00:25:23,760 --> 00:25:30,232 can be approximated from the i-th value plus h times 336 00:25:30,232 --> 00:25:33,064 u prime of h. 337 00:25:33,064 --> 00:25:34,560 Now repeat it and repeat it. 338 00:25:34,560 --> 00:25:36,570 And you reach u of 1. 339 00:25:36,570 --> 00:25:38,250 And there is a theorem saying, again, 340 00:25:38,250 --> 00:25:42,060 if the differential equation is reasonable, then 341 00:25:42,060 --> 00:25:44,355 that will approach the true value as you take h 342 00:25:44,355 --> 00:25:45,520 to be smaller and smaller. 343 00:25:48,350 --> 00:25:50,360 That's called the finite difference method 344 00:25:50,360 --> 00:25:52,921 for differential equations. 345 00:25:52,921 --> 00:25:55,170 And you can do the exact same thing for two variables, 346 00:25:55,170 --> 00:25:55,669 let's say. 347 00:26:07,240 --> 00:26:10,050 And what we showed was for one variable, finite difference 348 00:26:10,050 --> 00:26:18,412 method, we want to find the value of u, function u of t. 349 00:26:18,412 --> 00:26:23,040 We took values at 0, h, 2h, 3h. 350 00:26:23,040 --> 00:26:26,680 Using that, we did some approximation, like that, 351 00:26:26,680 --> 00:26:29,670 and found the value. 352 00:26:29,670 --> 00:26:33,340 Now, suppose we want to find, similarly, 353 00:26:33,340 --> 00:26:38,920 a two-variable function, let's say v of t and x. 354 00:26:38,920 --> 00:26:42,340 And we want to find the value of v of 1, 1. 355 00:26:42,340 --> 00:26:44,292 Now the boundary conditions are these. 356 00:26:44,292 --> 00:26:45,666 We already know these boundaries. 357 00:26:49,650 --> 00:26:51,520 I won't really show you by example. 358 00:26:51,520 --> 00:26:55,560 But what we're going to do now is compute this value 359 00:26:55,560 --> 00:26:59,150 based on these two variables. 360 00:26:59,150 --> 00:27:00,300 So it's just the same. 361 00:27:00,300 --> 00:27:01,970 Taylor expansion for two variables 362 00:27:01,970 --> 00:27:05,610 will allow you to compute this value from these two values. 363 00:27:05,610 --> 00:27:09,072 Then compute this from these two, this from these two, 364 00:27:09,072 --> 00:27:11,230 and just fill out the whole grid like that, 365 00:27:11,230 --> 00:27:14,380 just fill out layer by layer. 366 00:27:14,380 --> 00:27:16,510 At some point, you're going to reach this. 367 00:27:16,510 --> 00:27:20,320 And then you'll have an approximate value of that. 368 00:27:20,320 --> 00:27:24,080 So you chop up your domain into fine pieces 369 00:27:24,080 --> 00:27:25,970 and then take the limit. 370 00:27:25,970 --> 00:27:27,500 And most cases, it will work. 371 00:27:31,160 --> 00:27:33,495 Why does it not work for stochastic differential 372 00:27:33,495 --> 00:27:33,995 equations? 373 00:27:38,690 --> 00:27:40,490 Kind of works, but the only problem 374 00:27:40,490 --> 00:27:44,490 is we don't know which value we're looking at, 375 00:27:44,490 --> 00:27:47,670 we're interested in. 376 00:27:47,670 --> 00:27:51,050 So let me phrase it a little bit differently. 377 00:27:54,770 --> 00:27:58,140 You're given a differential equation of the form dX 378 00:27:58,140 --> 00:28:12,930 equals mu dt plus t dB of t and time variable and space 379 00:28:12,930 --> 00:28:15,540 variable. 380 00:28:15,540 --> 00:28:21,850 Now, if you want to compute your value at time 2h based on value 381 00:28:21,850 --> 00:28:29,760 h, in this picture, I told you that this point 382 00:28:29,760 --> 00:28:33,030 came from these two points. 383 00:28:33,030 --> 00:28:38,104 But when it's stochastic, it could depend on everything. 384 00:28:38,104 --> 00:28:39,520 You don't know where it came from. 385 00:28:39,520 --> 00:28:41,061 This point could have come from here. 386 00:28:41,061 --> 00:28:42,390 It could have came from here. 387 00:28:42,390 --> 00:28:44,960 It could have came from here, came from here. 388 00:28:44,960 --> 00:28:47,170 You don't really know. 389 00:28:47,170 --> 00:28:50,900 But what you know is you have a probability distribution. 390 00:28:50,900 --> 00:28:57,350 So what I'm trying to say is now, 391 00:28:57,350 --> 00:28:59,140 if you want to adapt this method, what 392 00:28:59,140 --> 00:29:04,916 you're going to do is take a sample Brownian motion path. 393 00:29:11,900 --> 00:29:15,260 That means just, according to the distribution 394 00:29:15,260 --> 00:29:21,010 of the Brownian motion, take one path and use that path. 395 00:29:21,010 --> 00:29:29,050 Once we fix a path, once a path is fixed, 396 00:29:29,050 --> 00:29:31,840 we can exactly know where each value comes from. 397 00:29:31,840 --> 00:29:35,230 We know how to backtrack. 398 00:29:42,360 --> 00:29:44,680 That means, instead of all these possibilities, 399 00:29:44,680 --> 00:29:49,170 we have one fixed possibility, like that. 400 00:29:52,470 --> 00:29:54,570 So just use that finite difference method 401 00:29:54,570 --> 00:29:57,990 with that fixed path. 402 00:29:57,990 --> 00:30:01,155 That will be the idea. 403 00:30:01,155 --> 00:30:03,975 Let me do it a little bit more formally. 404 00:30:10,170 --> 00:30:11,470 And here is how it works. 405 00:30:16,230 --> 00:30:30,020 If we have a fixed sample path for Brownian motion of B(t), 406 00:30:30,020 --> 00:30:41,570 then X at time i plus 1 of h is approximately equal to X 407 00:30:41,570 --> 00:30:54,930 at time a of h plus h times dx at that time i of h, 408 00:30:54,930 --> 00:30:59,750 just by the exact same Taylor expansion. 409 00:30:59,750 --> 00:31:08,966 And then d of X we know to be-- that is equal to mu 410 00:31:08,966 --> 00:31:18,855 of dt plus-- oh, mu of dt is h. 411 00:31:18,855 --> 00:31:22,678 So let me write it like that, sigma times d of X-- dB. 412 00:31:27,350 --> 00:31:37,350 And these mu depend on [? their paths, ?] x at i of h 413 00:31:37,350 --> 00:31:39,845 dt, sigma... 414 00:31:56,850 --> 00:31:59,520 With that, here to here is Taylor expansion. 415 00:31:59,520 --> 00:32:01,780 Here to here I'm going to use the differential 416 00:32:01,780 --> 00:32:05,213 equation d of X is equal to mu dt plus sigma dB(t). 417 00:32:05,213 --> 00:32:05,712 Yes? 418 00:32:05,712 --> 00:32:08,500 AUDIENCE: Do we need that h for [INAUDIBLE]? 419 00:32:08,500 --> 00:32:10,700 PROFESSOR: No, we don't actually. 420 00:32:10,700 --> 00:32:13,840 Oh, yeah, I was-- thank you very much. 421 00:32:13,840 --> 00:32:17,350 That was what confused me. 422 00:32:17,350 --> 00:32:20,460 Yes, thank you very much. 423 00:32:20,460 --> 00:32:22,830 And now we can compute everything. 424 00:32:22,830 --> 00:32:27,260 This one, we're assuming that we know the value. 425 00:32:27,260 --> 00:32:30,670 That one can be computed from these two coordinates. 426 00:32:30,670 --> 00:32:36,350 Because we now have a fixed path X, we know what X of i*h is. 427 00:32:36,350 --> 00:32:40,350 dt, we took it to be h, approximated as h, 428 00:32:40,350 --> 00:32:42,180 or time difference. 429 00:32:42,180 --> 00:32:44,230 Again, sigma can be computed. 430 00:32:44,230 --> 00:32:47,470 dB now can be computed from B_t. 431 00:32:47,470 --> 00:32:50,180 Because we have a fixed path, again, we 432 00:32:50,180 --> 00:32:58,162 know that it's equal to B of i plus 1 of h minus B of i of h, 433 00:32:58,162 --> 00:33:00,560 with this fixed path. 434 00:33:00,560 --> 00:33:02,950 They're basically exactly the same, 435 00:33:02,950 --> 00:33:06,810 if you have a fixed path B. The problem is 436 00:33:06,810 --> 00:33:10,270 we don't have a fixed path B. That's where Monte Carlo 437 00:33:10,270 --> 00:33:11,220 simulation comes in. 438 00:33:15,450 --> 00:33:18,990 So Monte Carlo simulation is just a way to draw, 439 00:33:18,990 --> 00:33:22,900 from some probability distribution, a lot of samples. 440 00:33:22,900 --> 00:33:27,030 So now, if you know how to draw samples from the Brownian 441 00:33:27,030 --> 00:33:30,860 motions, then what you're going to do is draw a lot of samples. 442 00:33:30,860 --> 00:33:34,550 For each sample, do this to compute the value of X(0), 443 00:33:34,550 --> 00:33:37,410 can compute X of 1. 444 00:33:40,130 --> 00:33:43,080 So, according to a different B, you will get a different value. 445 00:33:43,080 --> 00:33:46,910 And in the end, you'll obtain a probability distribution. 446 00:33:46,910 --> 00:33:57,770 So by repeating the experiment, that means just 447 00:33:57,770 --> 00:33:59,760 redraw the path again and again, you'll 448 00:33:59,760 --> 00:34:01,930 get different values of X of 1. 449 00:34:01,930 --> 00:34:04,160 That means you get a distribution of X of 1, 450 00:34:04,160 --> 00:34:10,564 obtain distribution of X of 1. 451 00:34:10,564 --> 00:34:13,350 And that's it. 452 00:34:13,350 --> 00:34:18,800 And that will approach the real distribution of X of 1. 453 00:34:18,800 --> 00:34:21,880 So that's how you numerically solve a stochastic differential 454 00:34:21,880 --> 00:34:23,949 equation. 455 00:34:23,949 --> 00:34:26,389 Again, there's this finite difference method 456 00:34:26,389 --> 00:34:29,889 that can be used to solve differential equations. 457 00:34:29,889 --> 00:34:33,000 But the reason it doesn't apply to stochastic differential 458 00:34:33,000 --> 00:34:36,810 equations is because there's underlying uncertainty coming 459 00:34:36,810 --> 00:34:38,870 from Brownian motion. 460 00:34:38,870 --> 00:34:42,320 However, once you fix a Brownian motion, 461 00:34:42,320 --> 00:34:44,389 then you can use that finite difference method 462 00:34:44,389 --> 00:34:46,502 to compute X of 1. 463 00:34:46,502 --> 00:34:48,659 So based on that idea, you just draw 464 00:34:48,659 --> 00:34:52,090 a lot of samples of the Brownian path, 465 00:34:52,090 --> 00:34:53,750 compute a lot of values of X of 1, 466 00:34:53,750 --> 00:34:56,199 and obtain a probability distribution of X of 1. 467 00:34:58,710 --> 00:35:00,165 That's the underlying principle. 468 00:35:03,610 --> 00:35:06,832 And, of course, you can't do it by hand. 469 00:35:06,832 --> 00:35:07,665 You need a computer. 470 00:35:11,320 --> 00:35:13,341 Then, what is tree method? 471 00:35:13,341 --> 00:35:16,060 That's cool. 472 00:35:16,060 --> 00:35:20,560 Tree method is based on this idea. 473 00:35:20,560 --> 00:35:34,284 Remember, Brownian motion is a limit of simple random walk. 474 00:35:44,610 --> 00:35:47,170 This gives you a kind of approximate way 475 00:35:47,170 --> 00:35:50,844 to draw a sample from Brownian motions. 476 00:35:50,844 --> 00:35:51,760 How would you do that? 477 00:35:58,480 --> 00:36:00,900 At time 0, you have 0. 478 00:36:00,900 --> 00:36:06,400 At time really tiny h, you'll have plus 1 or minus 1 479 00:36:06,400 --> 00:36:09,130 with same probability. 480 00:36:09,130 --> 00:36:16,880 And it goes up or down again, up or down again, and so on. 481 00:36:16,880 --> 00:36:19,170 And you know exactly the probability distribution. 482 00:36:22,050 --> 00:36:25,250 So the problem is that it ends up here as 1/2, 483 00:36:25,250 --> 00:36:30,160 ends up here as 1/2, 1/4, 1/2, 1/4, and so on. 484 00:36:30,160 --> 00:36:33,030 So instead of drawing from this sample path, what you're 485 00:36:33,030 --> 00:36:36,614 going to do is just compute the value of our function 486 00:36:36,614 --> 00:36:37,280 at these points. 487 00:36:41,770 --> 00:36:44,267 But then the probability distribution, 488 00:36:44,267 --> 00:36:46,100 because we know the probability distribution 489 00:36:46,100 --> 00:36:49,060 that the path will end up at these points, 490 00:36:49,060 --> 00:36:54,530 suppose that you computed all these values here. 491 00:36:57,810 --> 00:37:00,080 I draw too many, 1, 2, 3, 4, 5. 492 00:37:00,080 --> 00:37:03,015 This 1 or 32 probability here. 493 00:37:03,015 --> 00:37:10,362 5 choose 1, 5 over 32, 5 choose 2 is 10 over 32. 494 00:37:13,560 --> 00:37:17,200 Suppose that some stochastic process, after following this, 495 00:37:17,200 --> 00:37:23,162 has value 1 here, 2 here, 3 here, 4, 5, and 6 here. 496 00:37:23,162 --> 00:37:27,190 Then, approximately, if you take a Brownian motion, 497 00:37:27,190 --> 00:37:28,790 it will have 1 with probability 1 498 00:37:28,790 --> 00:37:32,346 over 32, 2 with probability 5 over 32, and so on. 499 00:37:34,640 --> 00:37:36,140 Maybe I didn't explain it that well. 500 00:37:36,140 --> 00:37:38,060 But basically, tree method just says, 501 00:37:38,060 --> 00:37:42,950 you can discretize the outcome of the Brownian motion, 502 00:37:42,950 --> 00:37:47,535 based on the fact that it's a limit of simple random walk. 503 00:37:47,535 --> 00:37:52,050 So just do the exact same method for simple random walk instead 504 00:37:52,050 --> 00:37:54,180 of Brownian motion. 505 00:37:54,180 --> 00:37:56,195 And then take it to the limit. 506 00:37:56,195 --> 00:37:57,070 That's the principle. 507 00:38:00,778 --> 00:38:01,278 Yeah. 508 00:38:04,219 --> 00:38:06,260 Yeah, I don't know what's being used in practice. 509 00:38:06,260 --> 00:38:10,150 But it seems like these two are the more important ones. 510 00:38:10,150 --> 00:38:12,540 This is more like if you want to do it by hand. 511 00:38:12,540 --> 00:38:15,400 Because you can't really do every single possibility. 512 00:38:15,400 --> 00:38:18,125 That makes you only a finite possibility. 513 00:38:22,150 --> 00:38:24,630 Any questions? 514 00:38:24,630 --> 00:38:25,130 Yeah. 515 00:38:25,130 --> 00:38:28,790 AUDIENCE: So here you said, by repeating 516 00:38:28,790 --> 00:38:30,498 the experiment we get [INAUDIBLE] 517 00:38:30,498 --> 00:38:32,938 distribution for X(1). 518 00:38:32,938 --> 00:38:36,490 I was wondering if we could also get the distribution for not 519 00:38:36,490 --> 00:38:38,210 just X(1) but also for X(i*h). 520 00:38:38,210 --> 00:38:40,060 PROFESSOR: All the intermediate values? 521 00:38:40,060 --> 00:38:40,735 AUDIENCE: Yeah. 522 00:38:40,735 --> 00:38:41,990 PROFESSOR: Yeah, but the problem is 523 00:38:41,990 --> 00:38:43,448 we're taking different values of h. 524 00:38:43,448 --> 00:38:45,720 So h will be smaller and smaller. 525 00:38:45,720 --> 00:38:47,650 But for those values that we took, 526 00:38:47,650 --> 00:38:49,770 yeah, we will get some distribution. 527 00:38:49,770 --> 00:38:52,330 AUDIENCE: Right, so we might have distributions 528 00:38:52,330 --> 00:38:56,002 for X of d for many different points, right? 529 00:38:56,002 --> 00:38:56,668 PROFESSOR: Yeah. 530 00:38:56,668 --> 00:38:58,090 AUDIENCE: Yeah. 531 00:38:58,090 --> 00:39:02,692 So maybe we could uh-- right, OK. 532 00:39:02,692 --> 00:39:04,650 PROFESSOR: But one thing you have to be careful 533 00:39:04,650 --> 00:39:08,650 is let's suppose you take h equal 1 over 100. 534 00:39:08,650 --> 00:39:11,030 Then, this will give you a pretty fairly good 535 00:39:11,030 --> 00:39:12,551 approximation for X of 1. 536 00:39:12,551 --> 00:39:14,300 But it won't give you a good approximation 537 00:39:14,300 --> 00:39:17,620 for X of 1 over 50. 538 00:39:17,620 --> 00:39:21,260 So probably you can also get distribution for X of 1 over 3, 539 00:39:21,260 --> 00:39:22,550 1 over 4. 540 00:39:22,550 --> 00:39:28,720 But at some point, the approximation will be very bad. 541 00:39:28,720 --> 00:39:31,820 So the key is to choose a right h. 542 00:39:31,820 --> 00:39:33,660 Because if you pick h to be too small, 543 00:39:33,660 --> 00:39:35,940 you will have a very good approximation 544 00:39:35,940 --> 00:39:37,190 to your distribution. 545 00:39:37,190 --> 00:39:39,987 But at the same time, it will take too much time 546 00:39:39,987 --> 00:39:40,570 to compute it. 547 00:39:45,470 --> 00:39:48,330 Any remarks from a more practical side? 548 00:39:51,650 --> 00:39:54,200 OK, so that's actually all I wanted 549 00:39:54,200 --> 00:39:56,990 to say about stochastic differential equations. 550 00:39:56,990 --> 00:39:59,860 Really the basic principle is there 551 00:39:59,860 --> 00:40:02,490 is such thing called stochastic differential equation. 552 00:40:02,490 --> 00:40:04,660 It can be solved. 553 00:40:04,660 --> 00:40:08,210 But most of the time, it won't have a closed form formula. 554 00:40:08,210 --> 00:40:09,870 And if you want to do it numerically, 555 00:40:09,870 --> 00:40:12,920 here are some possibilities. 556 00:40:12,920 --> 00:40:18,250 But I won't go any deeper inside. 557 00:40:18,250 --> 00:40:22,670 So the last math lecture I will conclude with heat equation. 558 00:40:26,269 --> 00:40:28,654 Yeah. 559 00:40:28,654 --> 00:40:33,440 AUDIENCE: The mean computations of [INAUDIBLE], 560 00:40:33,440 --> 00:40:37,720 some of the derivatives are sort of path-independent, 561 00:40:37,720 --> 00:40:39,220 or have path-independent solutions, 562 00:40:39,220 --> 00:40:40,850 so that you basically are looking 563 00:40:40,850 --> 00:40:44,980 at say the distribution at the terminal value 564 00:40:44,980 --> 00:40:48,760 and that determines the price of the derivative. 565 00:40:48,760 --> 00:40:51,820 There are other derivatives where things really 566 00:40:51,820 --> 00:40:57,510 are path-dependent, like with options where you have 567 00:40:57,510 --> 00:41:00,240 early exercise possibilities. 568 00:41:00,240 --> 00:41:02,420 When do you exercise, early or not? 569 00:41:02,420 --> 00:41:06,590 Then the tree methods are really good because at each element 570 00:41:06,590 --> 00:41:10,650 of the tree you can condition on whatever the path was. 571 00:41:10,650 --> 00:41:13,690 So keep that in mind, that when there's 572 00:41:13,690 --> 00:41:15,600 path dependence in the problem, you'll 573 00:41:15,600 --> 00:41:17,858 probably want to use one of these methods. 574 00:41:17,858 --> 00:41:18,608 PROFESSOR: Thanks. 575 00:41:18,608 --> 00:41:21,637 AUDIENCE: I know that if you're trying to break it down 576 00:41:21,637 --> 00:41:26,854 into simple random walks you can only use [INAUDIBLE]. 577 00:41:26,854 --> 00:41:30,000 But I've heard of people trying to use, instead 578 00:41:30,000 --> 00:41:31,740 of a binomial, a trinomial tree. 579 00:41:31,740 --> 00:41:35,420 PROFESSOR: Yes, so this statement actually 580 00:41:35,420 --> 00:41:37,986 is quite a universal statement. 581 00:41:37,986 --> 00:41:42,670 Brownian motion is a limit of many things, not just 582 00:41:42,670 --> 00:41:43,620 simple random walk. 583 00:41:43,620 --> 00:41:47,230 For example, if you take plus 1, 0, or minus 1 584 00:41:47,230 --> 00:41:49,190 and take it to the limit, that will also 585 00:41:49,190 --> 00:41:51,670 converge to the Brownian motion. 586 00:41:51,670 --> 00:41:54,980 That will be the trinomial and so on. 587 00:41:54,980 --> 00:41:57,090 And as Peter said, if you're going 588 00:41:57,090 --> 00:41:59,320 to use tree method to compute something, 589 00:41:59,320 --> 00:42:03,475 that will increase accuracy, if you take more possibilities 590 00:42:03,475 --> 00:42:05,890 at each step. 591 00:42:05,890 --> 00:42:07,530 Now, there is two ways to increase 592 00:42:07,530 --> 00:42:14,020 the accuracy is take more possibilities at each step 593 00:42:14,020 --> 00:42:16,210 or take smaller time scales. 594 00:42:20,090 --> 00:42:23,470 OK, so let's move on to the final topic, heat equation. 595 00:42:27,399 --> 00:42:29,570 Heat equation is not a stochastic differential 596 00:42:29,570 --> 00:42:32,630 equation, first of all. 597 00:42:32,630 --> 00:42:33,230 It's a PDE. 598 00:42:47,780 --> 00:42:50,650 That equation is known as a heat equation 599 00:42:50,650 --> 00:42:52,180 where t is like the time variable, 600 00:42:52,180 --> 00:42:54,570 x is like the space variable. 601 00:42:54,570 --> 00:42:56,940 And the reason we're interested in this heat 602 00:42:56,940 --> 00:42:59,340 equation in this course is, if you 603 00:42:59,340 --> 00:43:09,480 came to the previous lecture, maybe from Vasily last week, 604 00:43:09,480 --> 00:43:12,640 Black-Scholes equation, after change of variables, 605 00:43:12,640 --> 00:43:17,050 can be reduced to heat equation. 606 00:43:17,050 --> 00:43:19,900 That's one reason we're interested in it. 607 00:43:19,900 --> 00:43:22,310 And this is a really, really famous equation 608 00:43:22,310 --> 00:43:23,620 also in physics. 609 00:43:23,620 --> 00:43:27,150 So it was known before Black-Scholes equation. 610 00:43:27,150 --> 00:43:32,430 Particularly, this can be a model for-- equations 611 00:43:32,430 --> 00:43:33,590 that model this situation. 612 00:43:36,260 --> 00:43:42,544 So you have an infinite bar, very long and thin. 613 00:43:42,544 --> 00:43:43,585 It's perfectly insulated. 614 00:43:48,990 --> 00:43:53,850 So heat can only travel along the x-axis. 615 00:43:53,850 --> 00:43:58,080 And then at time 0, you have some heat distribution. 616 00:44:02,120 --> 00:44:07,076 At time 0, you know the heat distribution. 617 00:44:13,040 --> 00:44:17,230 Then this equation tells you the behavior of how the heat will 618 00:44:17,230 --> 00:44:20,020 be distributed at time t. 619 00:44:20,020 --> 00:44:25,570 So u of t of x, for fixed t, will be the distribution 620 00:44:25,570 --> 00:44:28,852 of the heat over the x-axis. 621 00:44:28,852 --> 00:44:30,560 That's why it's called the heat equation. 622 00:44:30,560 --> 00:44:31,935 That's where the name comes from. 623 00:44:35,050 --> 00:44:37,720 And this equation is very well understood. 624 00:44:37,720 --> 00:44:42,720 It does have a closed-form solution. 625 00:44:42,720 --> 00:44:44,960 And that's what I want to talk about. 626 00:44:48,250 --> 00:44:51,560 OK, so few observations before actually solving it. 627 00:44:58,450 --> 00:45:13,520 Remark one, if u_1 and u_2 satisfies heat equation, 628 00:45:13,520 --> 00:45:18,951 then u_1 plus u_2 also satisfies, also does. 629 00:45:21,850 --> 00:45:24,750 That's called linearity. 630 00:45:24,750 --> 00:45:25,840 Just plug it in. 631 00:45:25,840 --> 00:45:28,080 And you can figure it out. 632 00:45:28,080 --> 00:45:31,760 More generally that means, if you 633 00:45:31,760 --> 00:45:46,890 integrate a family of functions ds, where u_s all satisfy star, 634 00:45:46,890 --> 00:46:00,435 then this also satisfies star, as long 635 00:46:00,435 --> 00:46:02,300 as you use reasonable function. 636 00:46:02,300 --> 00:46:05,240 I'll just assume that we can switch the order of integration 637 00:46:05,240 --> 00:46:06,620 and differentiation. 638 00:46:06,620 --> 00:46:08,550 So it's the same thing. 639 00:46:08,550 --> 00:46:10,432 Instead of summation, I'm taking integration 640 00:46:10,432 --> 00:46:11,265 of lot of solutions. 641 00:46:14,410 --> 00:46:17,490 And why is that helpful? 642 00:46:17,490 --> 00:46:28,120 This is helpful because now it suffices 643 00:46:28,120 --> 00:46:36,160 to solve for-- what is it? 644 00:46:36,160 --> 00:46:44,345 Initial condition, u of t of x equals delta, delta function, 645 00:46:44,345 --> 00:46:44,950 of 0. 646 00:46:52,470 --> 00:46:55,970 That one is a little bit subtle. 647 00:46:55,970 --> 00:46:58,980 The Dirac delta function is just like an infinite ass 648 00:46:58,980 --> 00:47:00,100 at x equals 0. 649 00:47:00,100 --> 00:47:03,660 It's 0 everywhere else. 650 00:47:03,660 --> 00:47:05,950 And basically, in this example, what you're saying is, 651 00:47:05,950 --> 00:47:09,680 at time 0, you're putting like a massive amount of heat 652 00:47:09,680 --> 00:47:11,430 at a single point. 653 00:47:11,430 --> 00:47:14,800 And you're observing what's going to happen afterwards, 654 00:47:14,800 --> 00:47:17,380 how this heat will spread out. 655 00:47:17,380 --> 00:47:19,240 If you understand that, you can understand 656 00:47:19,240 --> 00:47:21,220 all initial conditions. 657 00:47:21,220 --> 00:47:23,160 Why is that? 658 00:47:23,160 --> 00:47:38,840 Because if u sub s t, x-- u_0-- is such solution, 659 00:47:38,840 --> 00:47:45,030 then integration of-- let me get it right-- 660 00:47:45,030 --> 00:48:10,546 u of t of s minus x ds is a solution with initial condition 661 00:48:10,546 --> 00:48:11,046 x(0, x). 662 00:48:16,006 --> 00:48:16,998 What is it? 663 00:48:37,334 --> 00:48:38,930 Sorry about that. 664 00:48:38,930 --> 00:48:41,720 So this is really the key. 665 00:48:41,720 --> 00:48:46,120 If you have a solution to the Dirac delta initial condition, 666 00:48:46,120 --> 00:48:49,340 then you can superimpose a lot of those solutions 667 00:48:49,340 --> 00:48:51,935 to obtain a solution for arbitrary initial condition. 668 00:48:55,030 --> 00:48:58,860 So this is based on that principle, because each of them 669 00:48:58,860 --> 00:48:59,950 is now a solution. 670 00:48:59,950 --> 00:49:04,890 If you superpose this, then that is a solution. 671 00:49:04,890 --> 00:49:06,640 And then if you plug it in, you figure out 672 00:49:06,640 --> 00:49:09,331 that actually it has satisfied this initial condition. 673 00:49:14,050 --> 00:49:18,260 That was my first observation. 674 00:49:18,260 --> 00:49:27,160 Second observation, second remark, 675 00:49:27,160 --> 00:49:44,930 is for the initial value u(0, x) equals a Dirac delta function, 676 00:49:44,930 --> 00:49:59,246 u of-- is a solution. 677 00:50:05,710 --> 00:50:08,320 So we know the solution for the Dirac delta part. 678 00:50:08,320 --> 00:50:10,950 First part, we figured out that if we know the solution 679 00:50:10,950 --> 00:50:12,800 for the Dirac delta function, then 680 00:50:12,800 --> 00:50:15,260 we can solve it for every single initial value. 681 00:50:15,260 --> 00:50:17,160 And for the initial value Dirac delta, 682 00:50:17,160 --> 00:50:23,300 that is the solution that solves the differential equation. 683 00:50:23,300 --> 00:50:26,490 So let me say a few words about this equation, actually 684 00:50:26,490 --> 00:50:29,002 one word. 685 00:50:29,002 --> 00:50:30,986 Have you seen this equation before? 686 00:50:35,090 --> 00:50:36,865 It's the p.d.f. of normal distribution. 687 00:50:36,865 --> 00:50:37,740 So what does it mean? 688 00:50:37,740 --> 00:50:41,820 It means, in this example, if you have a heat traveling 689 00:50:41,820 --> 00:50:45,280 along the x-axis, perfectly insulated, 690 00:50:45,280 --> 00:50:49,180 if you put a massive heat at this 0, at one point, 691 00:50:49,180 --> 00:50:53,090 at time 0, then at time t your heat 692 00:50:53,090 --> 00:50:55,640 will be distributed according to the normal distribution. 693 00:50:55,640 --> 00:50:58,014 In other words, assume that you have a bunch of particle. 694 00:50:58,014 --> 00:51:00,140 Heat is just like a bunch of particles, 695 00:51:00,140 --> 00:51:04,590 say millions of particles at a single point. 696 00:51:04,590 --> 00:51:07,410 And then you grab it. 697 00:51:07,410 --> 00:51:09,908 And then time t equals 0 you release it. 698 00:51:14,547 --> 00:51:16,880 Now the particle at time t will be distributed according 699 00:51:16,880 --> 00:51:18,190 to a normal distribution. 700 00:51:18,190 --> 00:51:24,300 In other words, each particle is like a Brownian motion. 701 00:51:24,300 --> 00:51:28,740 So for particle by particle, the location 702 00:51:28,740 --> 00:51:31,760 of its particle at time t will be kind of distributed 703 00:51:31,760 --> 00:51:33,400 like a Brownian motion. 704 00:51:33,400 --> 00:51:36,450 So if you have a massive amount of particles, 705 00:51:36,450 --> 00:51:38,590 altogether their distribution will look 706 00:51:38,590 --> 00:51:40,490 like a normal distribution. 707 00:51:40,490 --> 00:51:42,930 That's like its content. 708 00:51:42,930 --> 00:51:45,910 So that's also one way you see the appearance of a Brownian 709 00:51:45,910 --> 00:51:49,510 motion inside of this equation. 710 00:51:49,510 --> 00:51:52,570 It's like a bunch of Brownian motions happening together 711 00:51:52,570 --> 00:51:53,820 at the exact same time. 712 00:52:01,320 --> 00:52:06,841 And now we can just write down the solution. 713 00:52:06,841 --> 00:52:08,450 Let me be a little bit more precise. 714 00:52:18,600 --> 00:52:32,200 OK, for the heat equation delta u over delta t, 715 00:52:32,200 --> 00:52:44,590 with initial value u of 0, x equals some initial value, 716 00:52:44,590 --> 00:52:50,700 let's say v of x, and t greater than equal to 0. 717 00:53:00,510 --> 00:53:09,728 The solution is given by integration. 718 00:53:14,160 --> 00:53:46,524 u at t of x is equal to e to the minus-- let me get it right. 719 00:54:08,890 --> 00:54:12,680 Basically, I'm just combining this solution to there. 720 00:54:12,680 --> 00:54:18,090 Plugging in that here, you get that. 721 00:54:18,090 --> 00:54:20,280 So you have a explicit solution, no matter 722 00:54:20,280 --> 00:54:24,050 what the initial conditions are, initial conditions 723 00:54:24,050 --> 00:54:27,280 are given as, you can find an explicit solution 724 00:54:27,280 --> 00:54:32,090 at time t for all x. 725 00:54:32,090 --> 00:54:36,590 That means, once you change the Black-Scholes equation 726 00:54:36,590 --> 00:54:41,300 into the heat equation, you now have a closed-form solution 727 00:54:41,300 --> 00:54:41,976 for it. 728 00:54:45,550 --> 00:54:51,325 In that case, it's like a backward heat equation. 729 00:54:51,325 --> 00:54:53,200 And what will happen is the initial condition 730 00:54:53,200 --> 00:54:56,890 you should think of as a final payout function. 731 00:54:56,890 --> 00:54:58,700 The final payout function you integrate 732 00:54:58,700 --> 00:55:00,860 according to this distribution. 733 00:55:00,860 --> 00:55:03,486 And then you get the value at time t equals 0. 734 00:55:07,220 --> 00:55:09,910 The detail, one of the final project 735 00:55:09,910 --> 00:55:11,760 is to actually carry out all the details. 736 00:55:11,760 --> 00:55:13,990 So I will stop here. 737 00:55:13,990 --> 00:55:17,180 Anyway, we didn't see how the Black-Scholes equation actually 738 00:55:17,180 --> 00:55:18,410 changed into heat equation. 739 00:55:22,470 --> 00:55:24,890 If you want to do that project, it 740 00:55:24,890 --> 00:55:26,930 will be good to have this in mind. 741 00:55:26,930 --> 00:55:29,030 It will help. 742 00:55:29,030 --> 00:55:30,030 Any questions? 743 00:55:34,530 --> 00:55:38,938 OK, so I think that's all I have. 744 00:55:38,938 --> 00:55:41,800 I think I'll end a little bit early today. 745 00:55:41,800 --> 00:55:45,155 So that will be the last math lecture for the semester. 746 00:55:45,155 --> 00:55:48,390 From now on you'll only have application lectures. 747 00:55:48,390 --> 00:55:55,910 There are great lectures coming up, I hope, and I know. 748 00:55:55,910 --> 00:55:59,390 So you should come and really enjoy now. 749 00:55:59,390 --> 00:56:02,300 You went through all this hard work. 750 00:56:02,300 --> 00:56:04,465 Now it's time to enjoy.