Welcome to lecture seven, our last lecture on interest rate instruments is a continuation to short rate models that we were discussing in lecture six. In lecture six as we ended, we mentioned that there is a shortcoming with Vasicek and is actually known factor and the major drawback with it is that is that actually, the instantaneous short rate could become negative, implying negative interest rates. Now, there are ways to fix it actually during the implementation, we may actually put a threshold for it and making sure that it wouldn't go to zero but that's something that we cannot do when we doing close form or we're doing calibration is simulation actually we can enforce this. But considering that we want to adjust focus on calibration to LIBOR and swap rates and add up this we're going to get the zero-coupon bond prices. For that reason, we are actually moving from Vasicek to another model which is called CIR. In the CIR process unlike Vasicek, what we are having is actually we are having now the model. If you go back to Vasicek which look like this, the mean reversion part is exactly the same. But on this side now what you are having is we now added this term a square root of r_t, and this actually guarantees that short rate would never become negative. Having said this, there is always a trade off that we add this term, the addition of these sum actually making sure that it would never go below zero the shorter it would stay positive. Having said this, one large downside to it is this is addition would cause the model unlike Vasicek not to be Gaussian anymore. Actually, the model becomes non-Gaussian. For us at this point we should not make any difference because you're not really going through any extra derivation. Having said this when it comes to pricing other instruments, it would be different from the case that we had in Vasicek. Now again, one more time, the calibration would be very very similar to what we did for Vasicek is a three parameter model, is kappa, theta, and sigma, and of course we need to have the initial starting point which would put it as part of the calibration. We already mentioned that for this case, we eliminate a negative interest rate problem but we are still constraint that we just have four parameters. That means assuming that we would do a very good job in actually capturing the entire surface going to 30 years is a bit kind of being too optimistic. Having said this, we do this one for just illustrative purposes and seeing that how well we can do even with a simple model like a CIR. Now the rates are exactly the same as before. Again there is a typo here, this supposed to be December 14th, 2017. As I said earlier considering that I am giving you four and half years of rates on both LIBOR and swap rates, what I would do is for the exam or for quizzes, considering that you have the code, I may pick another day randomly and ask you to replicate exactly what I'm doing here which should be straightforward. The rates on December 14th are given in this table, the rate on October 11th is giving this way. As you see, there had been an increase because the Federal Reserve been increasing rates and you can easily see it from December 2017 to October 11th, 2017. That's exact same instrument that we use for Vasicek as well. Lets go to swap rates. Again, for the swaps, I'm going from swap from two years to 30 years December 14th and the same thing for October 11th, 2018, and again it's clear that the rates being going up almost by a percentage. Now, the objective function is exactly as before is the relative error, a score of relative errors on each separately, and I'm simply adding it up. There are ways that if you can make it in a way is the relative error then in real sense is really apple to apple comparison. Having said this, there are various different ways that you can set up your objective function. This is just one way of doing it. Now, I'm doing the calibration, I'm going to go through the code. I'm explaining this one in detail when we go through the codes. This is the zero-coupon curve coming out of the calibration. After you finding the parameters of the model through calibration namely kappa, theta, sigma and or not, you just plugging into this expression that was given to you. I thought that I give you the expression. Yes. I'm sorry I think I didn't go through this one. The P(t, T) zero-coupon bond prices on their CIR is given according to this equation. As before is Tom homogeneous as you see because it's always the difference between T and t. Once you have the parameters, you can plug in and you can easily get the prices after the calibration. This is what I've done actually. This is what I've done, let me go to the slide. This is what exactly done here. I just substitute and I got the P(t, T) and that's my zero-coupon curve. Showing that how well I have done just for comparison, you will see that these points are the market prices and the curve is the model prices. Then as you at some point and for LIBOR I've done a better job for a longer one, I'm underestimating it. When it comes to the swap rates, you'll see in some part I'm overestimating, some part I'm underestimating. But as I said there is always a trade off there. This is exact same one for October 11th, 2018 exact calibration process. This term actually I did a very nice job on the LIBOR side on the swap. Again the first two, and the last one very nice job. But in the middle, I misstep. Then two, three, nice job 30 a great job, 10 very nice job miss on 15, miss on five and seven. But one more time, knowing that there are just four parameters and we're going to go at 30 years, this is something to be expected. It's impossible to find unless you start adding more parameters but that's not the goal. The goal for us is with the least number of parameters see if we can do a good job capturing the surface. The surface as I said is going up to 30 years, we're using LIBOR rate and we're using swap rates and we've seen that relatively speaking we're doing a good job. Let's look at the curves. One more time is exactly like what you seen Vasicek, the blue one is for the December 2017, a lower rate environment let's call it, and then the red one is for October 11th, 2018, let's call it the higher rate environment. As we've seen in lecture one that's exactly what you're expecting. That in a lower rate environment, the curve is higher than the zero coupon curve, than the higher rate environment. Assuming zero as I mentioned in previous lecture, it of course would be a straight line because there is no discounting and assuming rate is super high, you will see something of this form, assuming the rate is super high something of that nature. Now, the other thing that I'm doing is I'm actually plotting both against each other, what I got from Vasicek in the last lecture, CIR in this lecture, I'm doing against each other. It's almost impossible to distinguish if you'd look at the legend, I kid you not I can even distinguish between the two. Now, if I go to look at it for LIBOR rates, I'm seeing that exact same thing happened is almost impossible to distinguish. Here, you'll see there is a slight difference. That means both Vasicek and CIR doing almost the same job when it comes to those two days. There are days that that would not be the case, I'm going to set this one up for an exam or homework for you to make sure that you convince yourself. I'm also doing the exact same thing for October 11th, 2018, is almost impossible to distinguish between these two. I'm having the zero-coupon care for Vasicek and CIR, are they completely matching, closely matching, and I'm seeing exact same thing when it comes to model prices for both. In the legend is very difficult to actually see it and the same thing actually when it comes to swap rate. What I'm going to do is, I'm going to go through to the code for both lecture six and lecture seven and combine it because one was focusing on Vasicek the other one was focusing on CIR. But I just want to make sure that you have both of them to make sure that we can do the comparisons, would be the comparisons would be easier. Thank you so much.