Chris Dzera 5/3/2011 MAT-5900 Drs. Frey and Volpert Swaptions are very popular but complex financial instruments that are frequently traded over the counter on markets today. Certain kinds of swaptions can be priced analytically, but others types of swaptions must be priced through the use of Monte Carlo simulations. These more complex swaptions and other interest rate derivatives are priced by modeling the interest rate, the underlying in these calculations, using one of many popular interest rate models. The choice of the model typically depends on what interest rate derivative is being priced. Since this paper focuses on swaptions, we will begin with an explanation of what swaptions are and how they work to give the reader an understanding of what exactly we are attempting to price using these models. Additionally, we will explain why interest rate derivatives and swaptions in particular are so popular. Because the interest rate derivatives market is among the most popular derivatives market in the world, it is important to understand how to price these derivatives and how some of the more commonly used models work. In this paper, we will discuss various methods of pricing interest rate derivatives. One of the first interest rate models, Vasicek’s model, will be explained and some R-code using this model to simulate interest rate paths and the prices of interest rate swaps and swaptions will be shown. Additionally, we will explore two of the more popular interest rate models that can be used to price various interest rate derivatives including swaptions, the Heath-Jarrow-Morton model and the Brace-Gatarek-Musiela model. Included in the discussion of the BGM or LIBOR market model will be some examples of recent research about swaption pricing that features use of the BGM model. Finally, we will explain some of the real world factors that influence interest rates and cause them to move in a certain 1 manner. Because swaptions are so common and interest rate models are widely used in the pricing of financial derivatives it is important to have an understanding of how they both work. A swaption is an option on an underlying interest rate swap, and therefore any explanation of what swaptions are and how they work must begin with a discussion of interest rate swaps. An interest rate swap is an agreement between two parties to exchange cash flows in the future, where one party pays a predetermined fixed rate multiplied by a notional amount and the other party pays an agreed to floating interest rate multiplied by the same amount.1 There are some other types of interest rate swaps that involved fixed for fixed rates, floating for floating rates, different currencies, and different principals, but they are far less common.2 The payments in an interest rate swap are exchanged at fixed intervals, and the payments are based on the interest rates one interval prior. Because of this, there is no uncertainty about what the first exchange of payments will be. Although technically there is an exchange of payments both ways, the payments only go one way. Additionally, the interest rates are compounded based on how many exchanges of payments happen in a given year. Interest rate swaps also have no value when they are created, such that the payments are expected to even out over time. Because it is unlikely that two parties will have exactly opposing needs in an interest rate swap in terms of what rates they want to exchange and on what principal they want to exchange it, a financial institution typically takes the opposite position from the one that another party wants to take in the swap in exchange for a slight edge in percentage so they make money.3 Interest rate swaps are common over the counter financial derivatives that allow organizations to change the payments that they are making or receiving on an asset or a liability. 1 Options, Futures, and other Derivatives by John C. Hull, page 147. http://en.wikipedia.org/wiki/Interest_rate_swap 3 Options, Futures, and other Derivatives by John C. Hull, pages 151 and 152. 2 2 As an example, let us assume that 3M is interested in exchanging fixed rate payments on a ten year $100 million loan at 3.6% where payments are required four times per year for floating rate payments. They contact a financial institution who agrees to a ten year interest rate swap with them on May 2, 2013. In this case, 3M is the floating rate payer, paying LIBOR + .2%, and the financial institution pays a fixed rate of 3.6%. Both parties pay their percentage on a $100 million notional principal, payments are exchanged every three months, and so the interest rates are compounded four times per year. Now let us assume that the date this interest rate swap is agreed to the LIBOR rate was 3.8%. Then on August 2, 2013, 3M will pay 3.8%, the rate three months prior, plus .2% as agreed to. This 4% will be divided by four since it is compounded four times annually, to give 1% on the notional amount of $100 million or a payment of $1 million. On the same date, the financial institution would pay 3.6% divided by four or .9% on the $100 million, or $900 thousand dollars. The net payment and only exchange of payments would be 3M paying the financial institution $100 thousand. Three months later, 3M would pay the financial institution LIBOR on August 2, 2013 plus .2% divided by four again on the $100 million, and the financial institution would again pay $900 thousand, and the payments would continue in this manner four times a year for a total of ten years.4 Interest rate swaps and swaptions can be used for hedging purposes to help organizations reduce their interest rate risk. Organizations who take out a considerable amount of loans or give them out in the form of bonds can gain or lose a lot of money depending on how interest rates move. If an organization has to make interest rate payments and has agreed to a variable rate and rates rise, that could cost the organization a considerable amount of money, and even more if they have multiple variable rate loans. The same goes for if a company has multiple fixed rate 4 The basis for the example given can be found in Options, Futures, and other Derivatives, pages 148-150. 3 loans and interest rates drop. On the other hand, a party that is a bond holder or a creditor for some institution is receiving interest rates, and could stand to lose money if they are receiving a variable rate and rates drop or are receiving a fixed rate and rates rise. Both interest rate swaps and swaptions allow parties to transform a fixed rate asset or liability into a floating rate asset or liability and vice versa, by receiving inputs that essentially cancel out their payments or by paying out what they receive and receiving a different payment instead. Ultimately, these financial instruments allow organizations who do not have balance between fixed and floating rate loans or bonds to become balanced and mitigate interest rate risk.5 The components of a swaption have to include the components of an interest rate swap: the notional principal, the length of the underlying swap, the frequency of exchange of payments, the floating rate of interest, and the fixed or strike rate. Also agreed to in a swaption contract are the length of the option period, the date or dates when the option can be exercised, and the premium paid for the option.6 Essentially the way a swaption works is that the option holder has a single date or multiple dates when they can elect to enter into an interest rate swap, depending on the type of swaption. If on any of these dates the option holder exercises their option, an interest rate swap of the agreed to length, frequency of payments, and principal with the agreed to rates begins. In the case that the final exercise date passes without exercise, there is no exchange of payments beyond the premium being paid from the option holder to the seller. Swaptions are relatively unique options, because since there are multiple payments to be exchanged in the future the option holder is not certain whether or not they will make money when they exercise, and the option holder in fact could lose. In the case where there are multiple exercise dates, the holder has to weigh how much money they expect to make at that given date 5 6 The information from this paragraph was found in Options, Futures, and other Derivatives, pages 150 and 151. http://en.wikipedia.org/wiki/Swaption 4 versus how much money they would expect to make if they waited till a later exercise date. Swaptions are extremely difficult to price, and one reason for that is their many components. The many types of swaptions include payer swaptions, receiver swaptions, European swaptions, Bermudan swaptions, American swaptions with fixed tenor, and American swaptions with fixed end date. Payer and receiver swaptions refer to the fixed and floating interest rates in a swaption. In a payer swaption the option holder pays the fixed rate and receives the floating rate, and in a receiver swaption the option holder pays the floating rate and receives the fixed rate.7 It may be easier to think of a payer swaption like a simple call option, where the strike price is the fixed or strike rate and the underlying is the floating rate. In this case, the option holder hopes that over the course of the swap the floating rate rises above the fixed rate to the extent that it will make them money. A receiver swaption then can be thought of like a simple put option the same way, with the strike price being like the fixed rate and the floating rate being like the underlying, and the option holder hoping that the floating rate dips below the fixed rate. The European, Bermudan, and American swaptions refer to the exercise dates. For a European swaption there is just one date where the option holder can elect to exercise and enter into an interest rate swap.8 In a Bermudan swaption, there are multiple predetermined dates where the option holder can elect to exercise.9 American swaptions allow the option holder to exercise at any date within the option period. An American option with fixed tenor designates an American swaption where, regardless of when the option holder exercises, an interest rate swap of a fixed length begins on that date. On the other hand, an American option with fixed end date has a predetermined end date, and if the option is exercised after a certain date the length of the 7 http://www.riskglossary.com/link/swaption.htm http://en.wikipedia.org/wiki/Swaption 9 http://www.sdgm.com/en/Support/Glossary.aspx?term=Bermudan%20swaption 8 5 underlying interest rate swap is less than what it could have been.10 All Bermudan swaptions have fixed end date. Because there are so many different types of swaptions and variations on those types it is important to have an understanding of all of them. Swaption pricing varies greatly depending on the type of swaption, and for some types of swaptions there is really no standard way to price them right now. European swaptions are typically priced using Black’s model for futures options, which is a beneficial model because the options contract and futures contract do not have to expire at the same time as a part of Black’s model. The model is tweaked slightly, changing the values of the underlying, the volatility, and the discount factor. Hull and White have also shown a quick analytic way to price swaptions that produces results similar to Monte Carlo simulations for the same parameters.11 Bermudan swaption pricing is generally done using Monte Carlo simulations, and some examples of research into Bermudan swaption pricing will be discussed later. Whether or not early exercise is beneficial is typically determined by running a simulation to calibrate an absolute exercise boundary function or a relative exercise boundary function.12 Often the Brace-Gatarek-Musiela or LIBOR market model, which will be discussed later, is used as the interest rate model for these simulations. The accuracy of one factor interest rate models in the pricing of Bermudan swaptions has been questioned.13 American swaptions are difficult to price because early exercise exists on every date. Two proposed models include a two factor stochastic model where the factors are the short-term interest rate and the premium of the futures rate over the short-term 10 http://www.sdgm.com/en/Support/Glossary.aspx?term=American%20swaption Much of the information in this section of the paragraph came from Options, Futures, and other Derivatives, pages 658-661. 12 Pricing Bermudan swap options using the BGM model with arbitrage-free discretisation and boundary based option exercise by Henrik Alpsten, pages 13 and 14 13 Options, Futures, and other Derivatives, pages 725-726. 11 6 interest rate, and another model that uses trinomial trees.14 Because there is not yet an industrial standard like Black’s model for pricing European swaptions or the LIBOR market model for pricing Bermudan swaptions, there is presently a lot of research being done into how American swaptions should be priced. There are many different ways to price swaptions depending on which type, including the use of Monte Carlo methods for Bermudan and American swaptions. Vasicek’s model is one of the first interest rate models, introduced in 1977 by Oldrich Vasicek. The model is a one factor short rate model, based on macroeconomic principles.15 Vasicek’s model is considered to be the first interest rate model to account for the element of mean reversion in interest rates.16 Mean reversion is an important characteristic in interest rate modeling, because unlike stocks interest rates typically hover around a certain value instead of consistently rising or falling in the long run. This mean reversion element works by making a part of the model positive if the present rate is below the long-run mean and negative if it is below the mean, and the magnitude of the mean reversion factor is dependent on the speed of mean reversion. The model uses geometric Brownian motion based on the volatility of the interest rate similar to the modeling of stocks. Inputted into the model are the speed of mean reversion and volatility as previously mentioned, along with the long run mean interest rate, current interest rate, and a random variable as implied by the use of geometric Brownian motion. The output of this model is an instantaneous rate, which can be added to the previous rate to give the next rate given a time interval dt. Ultimately while the mean reversion element of Vasicek’s model is a major benefit and was an important step in interest rate modeling, because the model 14 More can be read on the first technique in The Valuation of American-style Swaptions in a Two-factor SpotFutures Model, written by Sandra Peterson, Richard C. Stapleton, and Marti G. Subrahmanyam. 15 An Equilibrium Characterization of the Term Structure by Oldrich Vasicek 16 http://en.wikipedia.org/wiki/Vasicek_model 7 allows interest rates to become negative it is not a very commonly used one in present day interest rate modeling. We were able to implement Vasicek’s model in R to achieve many different things. The first significant output we received from implementing the Vasicek model was a graph of multiple interest rate random walks. Afterwards, we were able to take an average walk where over time depending on the speed of mean reversion interest rates converged to the mean. At a large number of runs this average walk smoothed out to give a curve that showed where interest rates would be expected to be at a given amount of time. This average walk allowed us to price an interest rate swap at a given point in time given those parameters based on what interest rates were expected to be in the future. Significant manipulations of the code allowed pricing of a European swaption based on Vasicek’s model. This pricing was based on a prior calibration using an initial simulation in R to determine what the exercise rate should be, and a second simulation to avoid any bias. The code remained very flexible and outside of the calibration to determine where we should exercise could have any inputs changed very easily and go through a new set of walks and create a good price, and the calibration process is relatively simple. While trying various inputs in the model, we were able to see some of the downsides to the Vasicek model, particularly the possibility for negative interest rates. At low numbers of runs, high volatilities, and low speeds of mean reversion we were able to see negative interest rates. This happened most of all with low speeds of mean reversion and higher volatilities. The result is not surprising, as a low speed of mean reversion means that the mean reverting factor is somewhat muted and the higher volatility can make more of an impact on where the interest rate moves than the mean reversion factor in the model. Even at large numbers of runs, if speed of mean reversion was particularly low or volatility was very high, rates seemed to be extremely 8 unpredictable. Assuming that interest rates with similar speeds of mean reversion and volatilities exist, this would signify that the behavior of those rates would be extremely difficult to predict. Although being able to implement one of the models we will discuss later in the paper and pricing a Bermudan swaption as opposed to a European swaption would have been preferable, the coding was a very interesting process that was more difficult than anticipated and pricing a European swaption using Vasicek’s model certainly felt like an accomplishment when completed.17 A more common model in present day interest rate modeling is the Heath-Jarrow-Morton (HJM) model. The HJM model is a framework for interest-rate modeling that allows any specific no arbitrage model to be fitted to it as a special case. Implementing the HJM model via Monte Carlo simulation is relatively simple.18 Because this model naturally reproduces the market prices of basic instruments, unlike equilibrium models, it creates a simpler and more effective pricing method. Arbitrage pricing models like the HJM model are strongly based on the efficient market hypothesis, a result of which is that market prices of financial instruments do not create opportunities for arbitrage. Additionally, the HJM model implies the dynamics of the short rate.19 It is worth noting that the yield curve is an input in the HJM framework as opposed to an output.20 Because there are many special cases of the HJM model, we will explore two of them. One special case of the HJM model is the Hull-White or extended Vasicek model, developed in 1989. Two features of the Hull-White model imply that the mean and variance of the short rate are bounded, a realistic feature for the modeling of the short rate. The Hull-White 17 The code for the interest rate paths, the pricing of the interest rate swap, and the pricing of the European swaption are included at the end of this paper, along with a graph of interest rate paths and a graph of the average interest rate path for the inputs included in the code 18 Interest Rate Modeling: Theory and Practice by Lixin Wu, page 82 19 Interest Rate Modeling: Theory and Practice by Lixin Wu, page 88 20 Interest Rate Modeling: Theory and Practice by Lixin Wu, page 81 9 model is called the extend Vasicek because the formula for the short rate in the Hull-White model is the same as the formula for the short rate in Vasicek’s model.21 This is beneficial for the Hull-White model, because the model is able to limit some of the downsides to the Vasicek model by working as an arbitrage model instead of an equilibrium model, but it still takes mean reversion into account unlike some other arbitrage models. The Hull-White model does have the same downside as the Vasicek in that interest rates can ultimately become negative, although with mean reversion the likelihood of obtaining a negative rate is frequently low. A benefit to the Hull-White model is it can easily be implemented using binomial trees, meaning it can be used to price path dependent options rather easily.22 Ultimately it is believed that the benefits of the Hull-White model outweigh its downsides, and it is a relatively good one to use under the HJM framework. Another special case of the HJM model is the Ho-Lee model, developed in 1986 with the intention of being used with binomial trees. Two basic features of the model suggest that the short rate will vary around a quadratic function of time, and that variance increases. Because both of these features are counter-intuitive, some have tweaked the model so that the short rate behaves in a more realistic manner.23 The Ho-Lee model is also related the Hull-White model, because the Hull-White model actually reduces to the Ho-Lee model when speed of mean reversion is eliminated.24 The Ho-Lee model is probably not as appealing as the Hull-White model, but can be used to price options on zero-coupon bonds among other applications.25 A very common model for the pricing of Bermudan swaptions is the Brace-GatarekMusiela or LIBOR market model, developed in 1997. In this model, forward rates are treated as 21 Interest Rate Modeling: Theory and Practice by Lixin Wu, page 92 Interest Rate Modeling: Theory and Practice by Lixin Wu, page 93 23 Interest Rate Modeling: Theory and Practice by Lixin Wu, page 90 24 Interest Rate Modeling: Theory and Practice by Lixin Wu, page 93 25 Interest Rate Modeling: Theory and Practice by Lixin Wu, page 91 22 10 lognormal martingales under their respective forward measures.26 In the case of European swaptions, our instruments of interest, the swap rate is approximately a lognormal martingale under its own swap measure. A martingale is a stochastic process that has the property that when we have all observations up to time s, the conditional expected value of an observation at a later time t is equal to the observation at the earlier time s.27 This property is associated with fair games in investments or speculations.28 Making this approximation is what allows Black’s formula to be applied to swaption pricing. The major breakthrough for Brace, Gatarek, and Musiela was that there was a unique and strictly positive solution to expression for the dynamics of the forward rate with maturity at time T. This solution has interesting properties as well: it is mean reverting, bounded from above and below by lognormal processes, and if aspects of the expression for the rate are smooth than the solution has the same degree of smoothness.29 This model is extremely broadly used and can be used to ratchet caps and floors, Bermudan swaptions, target redemption notes, autocaps, zero coupon swaptions, constant maturity swaps, and spread options among many other interest rate derivatives.30 A major appeal is its versatility as it calibrates well to Black’s model for example which is used to price European swaptions, but the BGM model can be implemented in Monte Carlo simulations as well.31 The BGM model is extremely popular and is an industrial standard to price many kinds of financial derivatives, including swaptions. We will cover some examples of recent research papers featuring use of the BGM model to price Bermudan swaptions and other financial instruments. 26 Interest Rate Modeling: Theory and Practice by Lixin Wu, page 182 http://en.wikipedia.org/wiki/Martingale_%28probability_theory%29 28 Interest Rate Modeling: Theory and Practice by Lixin Wu, page 22 29 Interest Rate Modeling: Theory and Practice by Lixin Wu, page 185 30 http://en.wikipedia.org/wiki/LIBOR_market_model 31 Interest Rate Modeling: Theory and Practice by Lixin Wu, page 200 27 11 A paper by Riccardo Rebonato of the Royal Bank of Scotland Quantitative Research Centre focuses on the evaluation of Bermudan swaptions, which he considers to be one of the most pressing problems in interest rate derivative pricing. Rebonato proposes a calibration methodology of the BGM model to Monte Carlo simulations that he believes adds to one of the two more popular recently proposed techniques. This technique is essentially to attempt to use a calibration technique that recovers the price of European swaptions ending at the same time from the dynamics of forward rates.32 While this is less conceptually appealing than the other technique, it is numerically easier and Rebonato believes that he has come up with a way to do this that recovers extremely similar prices and also calibrates well to a user-specified forwardrate covariance matrix. Rebonato believes it is significant to accomplish both of these since almost all exotic options depend on multiple sets of variables.33 His paper is another step in attempting to perfect the pricing of Bermudan swaptions. Additionally, a paper by Mikkel Svenstrup of the Aarhus School of Business examines the significance of using suboptimal exercise strategies for the pricing of Bermudan swaptions. As a basis for his paper, Svenstrup examines opposite claims made by Longstaff et al. (2001) and Andersen & Andreasen (2001) about this issue. The paper by Longstaff et al. (2001) argues that losses from the use of suboptimal exercise strategies are economically significant for swaption holders even if they are within bid/ask spreads, because these losses could have been prevented if better strategies were used. In fact, they make the claim that using strategies from one-factor models that are constantly re-calibrated to market data costs Bermudan swaption holders as a whole billions of dollars. This conclusion is based on an extensive simulation designed to 32 Accurate and Optimal Calibration to co-terminal European swaptions in a FRA-based BGM framework by Riccardo Rebonato, page 1 33 Accurate and Optimal Calibration to co-terminal European swaptions in a FRA-based BGM framework by Riccardo Rebonato, page 2 12 replicate present practice. 34 On the other hand, the study by Andersen & Andreasen (2001) states that losses from using the best fit one-factor model are insignificant and the model provides a good mark-to-market of Bermudan swaption prices. They also found that if properly calibrated to the prices of caps and European swaptions from two-factor models, one factor models can give Bermudan swaption prices that are slightly higher than two-factor models. Both papers use simulation techniques, although they estimate the optimal exercise strategy differently.35 Ultimately, based on his own set of various simulations, Svenstrup ends up agreeing with Andersen & Andreasen (2001). He also found that the strategy to estimate optimal early exercise that Longstaff et al. (2001) used was superior to the one that Andersen & Andreasen (2001), and that even the exercise strategy worst one factor model outperformed the one Andersen & Andreasen (2001) used. This is an interesting result given that he ended up agreeing with Andersen & Andreasen (2001) on the other result and one would think their strategy would have more effective given they found that the losses from their suboptimal strategy were not significant.36 Svenstrup’s paper had an interesting result that gave a positive outlook about the way that Bermudan swaptions are currently priced. Given this paper is about the simulation of interest rates and financial instruments that are priced using interest rate models, it is worth discussing what real world factors can influence interest rates. This is particularly interesting right now as the United States economy is in need of a boost in some areas, and interest rates have been kept relatively low as an attempt to get out of or continue to move away from the recession. Monetary and fiscal policy, implemented in the case of the United States by the Federal Reserve and the United States federal government respectively, both can influence interest rates. Typically the Federal Reserve attempts to 34 On the suboptimality of single-factor exercise strategies for Bermudan swaptions by Mikkel Svenstrup, page 2 On the suboptimality of single-factor exercise strategies for Bermudan swaptions by Mikkel Svenstrup, page 3 36 On the suboptimality of single-factor exercise strategies for Bermudan swaptions by Mikkel Svenstrup, page 27 35 13 manipulate interest rates through open market operations, or the sale or purchase of bonds. Although it is difficult to control what happens with certain rates and how banks and individuals react to a change in rates, the Federal Reserve can essentially put the federal funds rate exactly where it wants to. The federal funds rate is the rate at which banks pay and receive when they borrow money from one another. Typically a change in the money supply through an open market sale or purchase of bonds will also change overall rates, with rates increasing if the money supply decreases and doing the reverse in the opposite case. When the Federal Reserve wants rates to decrease, they conduct an open market purchase of bonds. This increases bank reserves which decreases the federal funds rate, and also increases the overall money supply which decreases overall rates. The opposite strategy applies when the Federal Reserve wants rates to increase.37 We have seen this be very effective recently, as the Federal Reserve has kept interest rates very low through monetary policies including quantitative easing, and plans to continue to do so in the near future. Fiscal policy can influence interest rates as well, although this is probably more of an indirect result than the Federal Reserve’s intentional efforts to keep interest rates in a certain area. Expansionary fiscal policy, increases in government spending or tax cuts, typically cause interest rates to rise, while the reverse policies tend to keep interest rates lower.38 This is because typically expansionary policy leads to increased output and prices and more demand for money, while restrictive policy leads to decreased output and prices and less demand for money. Changes in the demand for money will influence interest rates in a logical fashion, more demand for money causes them to rise and less demand for money causes them to fall. The fact that purchasing and selling of bonds by the Federal Reserve can impact interest rates indicates that it is plausible that yield curves, which are impacted by these purchases and 37 38 Macroeconomics: Principles & Policy by William J. Baumol & Alan S. Blinder, Eleventh Edition, page 266-268 Macroeconomics: Principles & Policy by William J. Baumol & Alan S. Blinder, Eleventh Edition, pages 281-282 14 sales, would be helpful for the prediction of how interest rates will move when used as inputs such as in the HJM model. However, there must be some difficulty in predicting where interest rates move given they often depend on the behavior of unemployment and inflation, which the Federal Reserve will manipulate interest rates to attempt to change. Presently, interest rates are being held low but individuals must assume that they will be increased by the Federal Reserve if inflationary pressures from rising commodity prices and quantitative easing are felt. It is interesting to consider how this possibility affects interest rate modeling today. There are many other factors that will influence interest rates, but from a basic macroeconomic perspective fiscal and especially monetary policy are very important determinants of interest rates. Swaptions are very complex financial instruments that are very popular because they allow for hedging against interest rate risk. Given that swaptions are options on interest rate swaps, it is critical to have some understanding of what the underlying interest rate swap is so we understand what the option is on. Additionally, it is important to understand the many different types of swaptions. A swaption can either be a payer or a receiver swaption, which refers to the fixed and floating interest rates in the underlying interest rate swap. Additionally, a swaption can be a European swaption, a Bermudan swaption, or an American swaption. These differences refer to the amount of exercise dates the option holder has during the option period. Additionally, an American swaption can have fixed tenor or fixed end date which refers to how the length of the underlying interest rate swap can be changed depending on how long the option holder waits to exercise their option and enter into the interest rate swap, assuming they do. The pricing of swaptions requires that some form of interest rate model is used, as the underlying in a swaption contract is an interest rate. Bermudan swaptions are priced using Monte Carlo simulations, typically using the LIBOR market or BGM model as the interest rate model in these simulations. 15 Our attempt to price swaptions in R started with trying to determine which interest rate model should be used, and led to some extensive research on the subject of interest rate modeling. Although some of the literature was difficult to work through, much was learned about interest rate modeling in general, especially the ones that were discussed in this paper. The end goal of this project was to price a Bermudan swaption accurately using an appropriate model. However, struggles with determining how to implement the BGM or HJM model in R and determining how to calibrate an early exercise strategy led to the inability to accomplish the goal. Despite this failure, a considerable amount was learned about interest rate modeling and swaptions over the course of this project. While the level of success that was hoped for was unfortunately not achieved, what was ultimately able to be accomplished felt significant. 16 R-code ##Vasicek interest rate paths r<-.12 #The initial riskless interest rate mean<-.1 #Long run mean interest rate smr<-.3 #Speed of reversion of the interest rate to the mean sigma<-.03 #Volatility of the interest rate n<-200 #Number of intervals in the simulation runs<-50000 #Number of simulations of interest rate paths t<-10 #Length of the interest rate simulation dt<-t/n #Time step walks<-matrix(double(runs*(n+1)),n+1,runs) #Creating the matrix of random walks walks[1,]<-r #Setting the first step of each walk in the matrix equal to the current rate ##Simulating the random walks implementing Vasicek’s model using a matrix of random variables for (j in 2:(n+1)){ walks[j,]<-walks[j-1,]+smr*(mean-walks[j-1,])*dt+sigma*rnorm(runs,0,sqrt(dt))} ##plotting the walks x<-seq(0,t,dt) matplot(x,walks[,1:10], type="l", lty=1) ##Finding the average at each iteration average<-double(n+1) #Creating the vector of average walks for(i in 0:n+1){ average[i]<-mean(walks[i,])} #Designating spot i in the average vector as the mean of the ith iteration ##Plotting the average walk matplot(x,average,type="l",lty=1) ##Pricing an interest rate swap rk<-.005 #Riskless interest rate freq<-1/2 #Frequency of exchange of payments in years, so ½ would be twice a year principal<-1000000 #The notional principal in the interest rate swap k<-.105 #The fixed rate in the interest rate swap T<-seq(freq,t/freq,by=freq) #A vector of times by frequency payment<-double(t/freq) #A vector of the length of the total number of payments 17 ##Designating each location in the payment vector to be the average at the previous location times the ##principal minus the principal times the strike rate, all discounted to present day for (h in 1:(t/freq)){ payment[h]<-(average[((h-1)*t)+1]*principal-principal*k)*exp(-rk*T[h])} sum(payment) #The present value of the interest rate swap from the perspective of the fixed rate payer ##Swaption Interest rate paths r<-.11 #The initial riskless interest rate mean<-.1 #Long run mean interest rate smr<-.3 #Speed of reversion of the interest rate to the mean sigma<-.03 #Volatility of the interest rate n<-200 #Number of intervals in the simulation runs<-50400 #Number of simulations of interest rate paths exercise<-.5 #Time to exercise length<-4.5 #Length of the underlying interest rate swap t<-exercise+length #Length of the interest rate simulation dt<-t/n #Time step walks<-matrix(double(runs*(n+1)),n+1,runs) #Creating the matrix of random walks walks[1,]<-r #Setting the first step of each walk in the matrix equal to the current rate ##Simulating the random walks implementing Vasicek’s model using a matrix of random variables for (j in 2:(n+1)){ walks[j,]<-walks[j-1,]+smr*(mean-walks[j-1,])*dt+sigma*rnorm(runs,0,sqrt(dt))} ##Finding the average at each iteration average<-double(n+1) #Creating the vector of average walks for(i in 0:n+1){ average[i]<-mean(walks[i,])} #Designating spot i in the average vector as the mean of the ith iteration ##pricing a swaption rk<-.005#Riskless interest rate freq<-1/2 #Frequency of exchange of payments in years, so ½ would be twice a year principal<-10000 #Notional principal of the interest rate swap k<-.1075 #Strike rate exrate<-average[(exercise*n)/t] #The exercise rate calibrated from a prior simulation for maximal payoff T<-seq(freq+exercise,t/freq,by=freq) #A vector of times by frequencies payment<-double(length/freq) #A vector of the length of the total number of payments 18 ##Swaption payoff that creates a total payment for every given random walk, and exercises based on a ##previously calibrated exercise rate, then places each payoff in a vector of length runs SwaptionPayoff<-double(runs) for (g in 1:runs){ for (h in 1:(length/freq)){ payment[h]<-(walks[(n/t*freq)*(h-1)+1*(n/(t/exercise))+1,g]*principal-principal*k)*exp(rk*T[h])} if(walks[((exercise*n)/t),g]>exrate){SwaptionPayoff[g]<-sum(payment)} else if (walks[((exercise*n)/t),g]<exrate){SwaptionPayoff[g]<-0}} mean(SwaptionPayoff) #The swaption price sd(SwaptionPayoff)/sqrt(runs) #Standard error of the swaption price ##Creating an optimal payoff function where the payoff at any given point is the value of the interest rate ##swap if it is positive, and zero if it is negative – this is what would happen if we could perfectly predict ##where interest rates would move which we cannot – thus values in the SwaptionPayoff vector will be ##negative but none in this vector will OptimalPayoff<-double(runs) for (q in 1:runs){ for (w in 1:(length/freq)){ payment[w]<-(walks[(n/t*freq)*(w-1)+1*(n/(t/exercise))+1,q]*principal-principal*k)*exp(rk*T[w])} OptimalPayoff[q]<-pmax(sum(payment),0)} mean(OptimalPayoff) #Price of a swaption if we could use an optimal payoff strategy sd(OptimalPayoff)/sqrt(runs) #Standard error of the optimal payoff price average 0.110 0.105 0.10 0.05 walks[, 1:10] 0.15 0.115 0.120 0.20 ##Below on the left is a plot of random interest rate walks with the same inputs as in the code above, to ##the right is a plot of the average random walk with the same parameters and 200,000 runs 0 2 4 6 8 10 0 2 4 6 x x 19 8 10