Welcome to Option Pricing via transform techniques lecture six. In the previous lecture, we explained how to preserve the link of the option pricing to characteristic function via transform technique. We went through it, and if we are interested in just pricing an option, say as some maturity with just one is strike you're done. We don't need to go any further, we have a way of doing it, we did the Congress and all of it. Definitely, what I will do is, I already have a sample code, Python sample code on implementation of what we discussed in lecture 5. But before I go through that, in lecture six for they're going to actually go over is what happens if you are interested in finding options prices at one maturity as a single maturity, but the various different strikes. You might say what we would do is, as I mentioned, you just use exact same techniques say, m times, which the computational cost if you recall would be Om multiplied by N, which N was a computational cost for one strike, and then if you want to get m strikes would become OmN. But how about if I say that there is a way that we can actually make that cost much much lower. Then, this lecture is continuation of the previous lecture emphasizing how bad calls or puts. Remember when I'm saying calls, I mean puts as well. But I'm living puts up to you. What I'm saying is, for your quiz or for your exam, I'm going to explain to you why just one simple change you can go from calls to puts using exact same techniques that I'm describing here. Then, how about calls with various strikes? Then, one more time. Let me just recap. If you're interested in just one specific strike, no extra step is needed. Then, no extra step is needed. That simply means we could have stopped at lecture five, we won't need lecture six or lecture seven. But how about calculating option premium, at that maturity, which is a fixed maturity for various different strikes, assuming for example m strikes as I said, they repeat the procedure m times and computational cost, as I said that earlier would be OmN. However, there are way, there is a method that we can use, that would reduce that cost tremendously. What we are trying to do here is, we are trying to use actually what is called FFT, Fast Fourier Transform to get premium at N different strikes with the cost of ONlogN as opposed to O[N] square. You may say, "Why not m, why N which is the same", and because that's the way FFT works as you will see. When I'm seeing FFT in all programming languages, we have actually FFT built in MATLAB, Python, C++, Java, all. We will looking that as a black box, but I am going to actually go through its description. I'm having a sample code for you explaining how it works. But then we will take it for granted, we just calling the FFT routine in Python to do the job. Now, call with various strikes, let me go through the formulation we had end of lecture five. Then, what I'm doing is, as you noticing, I'm just changing the k that we had to km knowing that now we have m different strikes, then the formulation exactly same except for the km. That means if you go back to last slide of the previous lecture, lecture five, you see in this formula is exactly what we had there except now instead of just fix k, I am writing it as km, for m going from one to n, which I'm going to explain to how I'm going to set this one up. Now, what I would do is this. When I'm having this one over here, what I can do is now, I can actually write this km as something like this; beta plus m minus one delta k. Then, what I am doing is, so I've fixed k, I'm running it to an array of k, and that's the way I'm introducing m. You may say, why do I need beta? Beta would be the starting point for the very very first strike, and that is why- beta is up to you, you're going to pick beta. Then, what you're doing is n minus k, the delta k which would be the stepping size for log space of those strikes. Then typically, what we are doing is, we are replacing this delta k as you will see with just lambda, I mean for simplicity. Now, then if I go ahead and substitute this one over here, it would carry it into the next line, and do not forget, for nu j I had j minus one eta. That's what I had for nu j already. Now, for km, I'm having beta plus m minus one delta, which lambda was delta k. I'm just substituting N, and this is what I would get this time. This is of course been sitting already here, no change to these two, which is simply carrying from over here and a substitution, and taking the beta add these, whatever would get. But you're noticing something, and that is this quantity does not depend on m at all, that is why I put it in a box and you see in the next slide. This is what I would call x[j]. Again, I'm doing all of this just for simplicity. Now, by substituting that one n, and then simply putting these two over in front, which as I said the delta k is lambda, then I would get minus i lambda eta, j minus one, m minus one multiplied by this quantity, which I will call just xj. Let's go to the next slide. That's exactly how this would look like. Now, as you will see for m from one to n, see the call prices for k, and for each of those would be simply what I'm having here, as you see in this case, it's still sitting here, but then I carry it through, and that disappears because now I am just simply substitute this for it. That's exactly what I'll be having. You may say, so what, you did all of this, where we're heading with this. The way we are heading is this that the definition of Fast Fourier is this, the Fast Fourier transform. FFT, Fast Fourier Transform provides, as I said, these are already built in into Python, and most programming languages. FFT provides an efficient algorithm for calculating this sum. For this sum you may assume that because I'm having N here, it would be ON, then I am having N here it would be O[N] square because I'm doing enough those. But Fast Fourier Transform does this as opposed to O[N] square would do it as ONlogN as I said that earlier. I'm not going to go through the proof. That's a known fact that people should generate, but we don't have to bother with, as if you have an engine? We know how the engine works? We just use the engine like a black box. Now, you wonder how do I go from what I had in the previous slide, which was this to this one and link m. The link is actually pretty easy. You will see, I can link it simply by setting up lambda eta to be 2pi over N. Let's go through. I'm asking two quick questions here. One is, what is efficiency even though I said already I'm going to repeat myself, the computational cost becomes ONlogN as opposed to O[N] squared. This is very important. I keep emphasizing this, because what happens is, as you know for enlarged logN is pretty small. That means this becomes very efficient to work with. For N strikes, I would do it with just ONlogN. By log, I mean actually natural log. Now, how can we use FFT? That simply means from the definition of FFT to what we had, how do we link them, the link is simply done by what you're seeing as lambda eta by sending it to be 2pi over N, to make sure that we exactly get there to look like the FFT algorithm.