Black Lognormal model for Swaption with R code
[This article was first published on K & L Fintech Modeling, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
Sang-Heon Lee
This article derives the swaption pricing formula using Black model, which is a lognormal model. We present the detailed calculation example using R code. This work is a prerequisite for the calibratiion of Hull-White or LGM (Linear Gaussian Markov) model.
The calibration of parameters of no-aritrage term structure model such as Ho-Lee, Hull-White, and LGM (Linear Gaussian Markov) requires the minimizing distances between market swaption prices and model prices. Since market quote convention uses Black swaption volatility, we need to convert this volatilities to prices for calibration purpose. At the same time, reflecting low or negative market interest rates, market practices are also changing in two ways. One is black’s lognormal swaption volatility and the other is Bachelier’s normal volatility.
Black Lognormal Model
For k=1,2,3,⋯,N, we assume that floating rate for the period of Tk−1 and Tk is determined at time Tk−1. Suppose that according to a typical swaption contract, one party receives floating rate and pays fixed rate (K) at time Tk. This constract has a nominal amount of L(=1) and maturity of T0. For example, the following figure shows in the case of N=6.
We can understand the structure of swaption from the above figure. At first, time axis consists of option maturity and swap maturity. After expiring option maturity, swap constract begins. The swap rate or fixed rate (black dashed line) is determined by making the present value of fixed legs of the swap equal to the present value of the floating legs, at at time t=0. Therefore, the fixed rate at the inception of the swap contract is the par swap rate. As time goes by, floating rate payments are determined by the future term structure of interest rates. In this case we use forward rates. Swap rate at time T0 is depicted by green dashed line. Swaption is exercised If s(T0)>K but not if s(T0)≤K.
Therefore, payoff at k-th payment date is as follows. Lδkmax(s(T0)−K,0),δk=Tk–Tk−1
Given A(t)=∑Ni=1(Ti–Ti−1)P(t,Ti), define ft and gt as follows. ft=LA(t)max(s(t)−K,0),gt=A(t)
Under the measure in which A(t) is the numeraire, ftgt=Lmax(s(t)−K,0) is martingale so that the present value of the swaption (f0) is determined by the following way. f0=g0EA[fT0gT0]=LA(0)EA[max(s(T0)−K,0)]
Therefore, assuming that s(T0) follows a log-normal distribution and its volatility is σ, we can find f0 using the Black-Scholes results. f0=LA(0)[EA[s(T0)]Φ(d1)−KΦ(d2)]
where d1=lnEA[s(T0)]K+12σ2T0σ√T0d2=lnEA[s(T0)]K−12σ2T0σ√T0
and EA[s(T0)]=s(0)=P(0,T0)−P(0,TN)A(0).
Finally, we can get the swaption price using Black’s lognormal model. Pswaption=LA(0)[s(0)Φ(d1)−KΦ(d2)]
(example) Consider a 5-maturity swaption on 3-maturity swap that pays fixed rate of 6.2% and receives floating rate semi-annually. Given a LIBOR zero curve of 6% and a forward swap rate volatility of 20%, find this swaption price.
(solution) Af first, we calculate an annuity factor A(0)=6∑k=1(Tk−Tk−1)P(0,Tk)=6∑k=10.5×e−0.06×(5+0.5k)≈2.0035
and calculate a par swap rate s(0)=P(0,T0)−P(0,T6)A(0)≈e−0.06×5−e−0.06×82.0035=0.060911
and calculate d1,d2 d1=lns(0)K+12σ2T0σ√T0≈ln0.0609110.062+120.22×50.2√5≈0.1836,d2=lns(0)K−12σ2T0σ√T0≈ln0.0609110.062−120.22×50.2√5≈−0.2636
Therefore, we can get this swaption price. Pswaption=LA(0)[s(0)Φ(d1)−KΦ(d2)]≈100×2.0035×[0.060911×Φ(0.1836)−0.062×Φ(−0.2636)]≈2.07
We can make the following R code to describe the above sequential calculation process.
#=========================================================================# # Financial Econometrics & Engineering, ML/DL using R, Python, Tensorflow # by Sang-Heon Lee # # https://kiandlee.blogspot.com #————————————————————————-# # Black swaption formula # # P = LA(0)[S(0)Φ(d1) – KΦ(d2)] #=========================================================================# L <– 100 # nominal amount dt <– 1/2 # payment frequency (6m) o.mat <– 5 # option maturity s.mat <– 3 # swap maturity sigma <– 0.2 # volatility of forward swap rate K <– 0.062 # fixed rate rt <– 0.06 # zero curve (=constant assumption) # annuity factor A(0) # # A0 = sum_{i=1}^{N} ( T(i) – T(i-1) )*P(t,Ti) # A0 <– sum(rep(dt,6)*exp(–rt*(o.mat+seq(dt,6*dt,dt)))) A0 # par swap rate # # S0 = P(0,T0) – P(0,TN) # —————— # A(0) # s0 <– (exp(–rt*o.mat) – exp(–rt*(o.mat+s.mat)))/A0 s0 # d1, d2 # d1 <– (log(s0/K) + 0.5*sigma^2*o.mat )/(sigma*sqrt(o.mat)) d2 <– (log(s0/K) – 0.5*sigma^2*o.mat )/(sigma*sqrt(o.mat)) d1; d2; # swaption price # P <– L*A0*(s0*pnorm(d1) – K*pnorm(d2)) print(paste0(“Black Swaption Price = “, P)) | cs |
In this R cde, pnorm() is the cumulative standard normal distribution function. The following figure is the output of this R code.
◼
To leave a comment for the author, please follow the link and comment on their blog: K & L Fintech Modeling.
R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.