1. 1
Calibrating Libor Market Models
Morten Bjerregaard Pedersen
1998
Re-implementation by Joel Cappelli (12137384) November 2015
UTS MQF 25853 Assignment
Motivation β Interest Rate Derivative Pricing
ο· Methods of interest rate derivative valuation have evolved over time
ο· Essentially we are trying to model the movement of the yield curve over time, parallel shifts
and relative twists.
Figure 1: Pricing process
Calibration of the Libor Forward Market Model will be the focus of this report. Specifically following
the approach of Pedersen [5] on Australian Dollar market data. The following section describes the
Market Model and the calibration task then an overview of Pedersenβs approach and the problem.
Section 4) discusses the implementation of the paper and how it was tested with Section 5)
presenting the results of fitting to AUD market data.
1) The Libor Forward Market Model (LFM)
Libor Forward Market Model (LFM) models the simply compounded period forward rate ππ(π‘) =
π(π, ππ, ππ+1) observed at π‘ with time to maturity ππ and period ππ = ππ+1 β ππ. We model a discrete
sequence of forward rates with time to maturity 0 = π0 < π1 < β¦ < ππ ππ€π
with ππ = ππ+1 β ππ
and calendar time running from time 0 = π‘0 < π‘1 < β¦ < π‘ π πππ
. The LFM is characterised by [2], [3]:
πππ(π‘) = πππππ‘ + ππ(π‘)πΎπ(π‘). πππ(π‘)
Where ππ(π‘) is the ith component of an π ππ€π dimensional Brownian with instantaneous correlation
matrix π = (ππ,π)π,π=1,β¦,π ππ€π
. πΎπ(π‘) is a vector valued volatility function of calendar time π‘ and
forward time ππ and the drift is chosen such that ππ(π‘) are martingales under the terminal forward
measure. For an π πππ factor model, each πππ can be decomposed into π πππ independent Brownians.
ππ(π‘) =
1
π π
(
ππ(π‘)
ππ+1(π‘)
β 1) are the forward rates at time π‘ for the maturity period ππ+1 β ππ.
ππ(π‘) are the zero coupon bond prices at time π‘ with maturity ππ.
2. 2
2) LFM Calibration task
The benefit of the LFM is that each period forward rate is market observable as derived from zero
coupon bond prices shown above. Furthermore, the formulation leads to closed form pricing for
caps/floors, zero coupon bonds and approximate closed form pricing for swaptions [5]. Calibration is
the process of fitting the covariance structure of the LFM to market prices.
For a choice of tenor length ππ, model horizon ππ ππ€π
, calendar end time π‘ π πππ
and number of
stochastic factors π πππ one parametrises the volatility structure πΎπ(π‘) for each forward rate ππ(π‘) =
π(π, ππ, ππ+1) . Ensuring that the correlation ππ,π between forward rates of different maturity ππ(π‘)
and ππ(π‘) leads to model-generated prices consistent with liquid prices for at-the-money caps and
swaptions.
3) Pedersenβs Approach
Relative volatility grid
Pedersen employs a non-parametric approach to deterministic volatility calibration of the LFM to an
entire swaption matrix.
By discretising calendar time π‘ (π πππindices j) and forward time π β π‘ (π ππ€π indices k) to create a
volatility component for each stochastic model factor (π πππ indices n) which characterises a
piecewise constant volatility grid for all forward rates.
Each volatility πΎπ(π‘ πβ1
, ππβ1)is derived from the volatility grid and the correlation matrix via
principal components analysis (PCA).
Figure 2: Piecewise volatility grid decomposed into factor grids via PCA
To reduce dimensionality of the problem, Pedersen assumes the correlation structure (π ππ€π x π ππ€π)
is constant through time and equal to correlation as seen today (or historical values).
Calibrate to market
This leads us to a high dimensional optimisation problem (π ππ€π x π πππ) to determine volatility
components πΎ πππ such that the model reproduces given market prices. To do this we try to minimise
the sum of relative error squared across the present value of all input instruments with respect to
those of the model. It is more desirable to fit to swaptions as a priority and caps where possible.
To obtain sensible and smooth volatility surfaces, Pedersen applies a smoothness measure in both
dimensions of calendar time π‘ and forward time π β π‘.
Forward time
π‘ πβ1
π‘ π
π‘ 0
π₯ πβ1 π₯ π
πΎ πππ
π₯0
π‘ πΌ πππ
π₯ π ππ€π
π πππ component grids of
volatility grid πΎ(π‘, π)
Calendartime
PCA on π‘ πβ1
covariance matrix
(volatility grid and
correlation matrix)
3. 3
The cost function of the optimisation problem is defined by adding quality of fit (quality of fit
denoted by QOF) and the smoothness measure:
πΆππ π‘ ππ’πππ‘πππ = π ππππ πππΉ ππ€
β πππΉππ€πππ‘ππππ + π ππππ πππΉ πΆππ
β πππΉπΆπππ + π ππππππ€π β π ππππ‘β ππ€π
+ π ππππ πππ β π ππππ‘β πππ
πΆππ π‘ ππ’πππ‘πππ =
1
π
β(
ππ πππππ,π
ππ ππππππ‘,π
β 1)2
π
π=1
+ π ππππππ€π β β (
π£πππ,π
π£πππ,πβ1
β 1)2
π ππ€π
π=2
π πππ
π=1
+ π ππππ πππ β β (
π£πππ,π
π£πππβ1,π
β 1)2
π ππ€π
π=1
π πππ
π=2
[1]
Caplet calibration is directly observable from the market. Cap quotes being implied RMS volatility
using the Blackβ76 formula [12] directly translate to the log-normal ππ(π‘) assumption under β [3].
πΆππ πππππ π π½
= β πΆπππππ‘ πππππ π΅ππππ(0, ππβ1, ππ, πΎ)
π½
π=πΌ+1
= β πππ π(0, ππ)(π(ππβ1, ππβ1, ππ) β πΎ)+
π½
π=πΌ+1
[2]
The discounted payoff at time 0 of a cap with first maturity date ππΌ and payment dates ππΌ+1, β¦ , ππ½ is
shown above. Cap price is the sum of constituent caplets, which are forward rate agreements on the
same strike rate πΎ, the forward swap rate over the period of the cap. Cap/caplet prices are
independent of forward rate correlation.
Using the Blackβ76 formula [3],
πΆπππππ‘ πππππ πΏπΉπ(0, ππβ1, ππ, πΎ) = πΆπππππ‘ πππππ π΅ππππ(0, ππβ1, ππ, πΎ) = π π(0, ππ)ππ π΅πΏ(πΎ, ππ(0), π£π)
π΅πΏ(πΎ, ππ(0), π£π) = πΈ π
[(ππ(ππβ1) β πΎ )
+
] = ππ(0)Ξ¦(π1(πΎ, ππ(0), π£π)) β πΎΞ¦(π2(πΎ, ππ(0), π£π))
π1(πΎ, ππ(0), π£π) =
ππ(
π π(0)
πΎ
)+
π£ π
2
2
π£ π
π2(πΎ, ππ(0), π£π) = π1 β π£ ππβ1βπΆπππππ‘β ππβ1
π£π
2
= ππβ1 π£ ππβ1βπΆπππππ‘
2
π£ ππβ1βπΆπππππ‘ = β
1
ππβ1
β« |πΎπ(π )|2
ππβ1
0
ππ [3]
Thus, the equation above shows that the caplet Blackβ76 volatility is the root-mean square of the
integrated variance of the period forward rate.
πΆππ πππππ π π½
= β πππ π(0, ππ)π΅πΏ (πΎ, ππ(0), π£ π π½ πππ)
π½
π=πΌ+1
= β πππ π(0, ππ)π΅πΏ(πΎ, ππ(0), π£ ππβ1 ππππΌππ‘)
π½
π=πΌ+1
[4]
Caplet volatilities can be stripped from cap market quotes to serve as market inputs however this
process may lead to negative volatilities [3].
4. 4
Caplet volatilities are not quoted in the market for all required maturities. The market quotes a
single, constant annualised implied volatility for a cap (Equation [5]) π£ π π½ πππ that when assigned to all
caplets, the price of the cap is the same as the sum of caplets each with individual volatilities
π£ ππβ1 ππππΌππ‘.
Swaptions are more complex than caps and are path dependent. Correlations of forward rates are
important due to the payoff specification. Swaption volatilities are also quoted by implied RMS
volatility using Blackβ76 formula however pricing approximations are made to simplify for log-normal
swap rate dynamics in the LFM.
ππ€πππ‘πππ πππππ = π π(0, ππΌ) ( β ππ π(ππΌ, ππ)(π(ππΌ, ππβ1, ππ) β πΎ)
π½
π=πΌ+1
)
+
[5]
The forward swap rate π πΌ,π½(π‘) at time π‘ for an interest rate swap first resetting at ππΌ and payment
dates ππΌ+1, β¦ , ππ½ can be written as the weighted sum of period forward rates below:
π πΌ,π½(π‘) = β π€π(π‘)ππ(π‘)
π½
π,π= πΌ+1
[6]
π€π(π‘) =
ππ β
1
1 + ππ ππ(π‘)
π
π=πΌ+1
β π π β
1
1 + ππ ππ(π‘)
π
π=πΌ+1
π½
π=πΌ+1
=
ππ+1(π‘)
β ππ+1(π‘)π½
π=πΌ+1
[7]
In the LFM, we need to express the swaption volatilities in terms of forward rate volatilities (and
correlations). This is crucial so that the central model can be calibrated to swaptions and caps then
also be used to price exotic products. The following is a derivation of π£ πΌ,π½
πΏπΉπ
, the Black swaption
volatility in the LFM. This approximation follows Rebonatos approach [3], which is based upon
βfreezing the drift coefficientsβ in the drift of the LFM dynamics at time 0. Such that;
π πΌ,π½(π‘) β β π€π(0)ππ(0)
π½
π,π= πΌ+1
[8]
(π£ πΌ,π½
πΏπΉπ
)2
=
1
ππΌ
β
π€π(0)π€π(0)ππ(0)ππ(0)ππ,π
π πΌ,π½(0)2
β« πΎπ(π )πΎπ(π )ππ
π πΌ
0
π½
π,π= πΌ+1
[9]
The π£ πΌ,π½
πΏπΉπ
quantity can be used as a proxy for the Black volatility of the swap rate. Putting this value
into the Blackβ76 Formula, allows one to compute the approximated swaption price in closed form
under the LFM. There have been many studies into accuracy of such an approximation and have
been tested against Monte Carlo simulations [2]. Note the dependency on the correlation between
forward rates as well as the integrated covariance of period forward rates of different maturity.
5. 5
4) Implementation
The flow chart below describes the process of implementation followed during this project.
Creating a hypothetical market
Choosing a volatility, correlation structure and initial interest rate term structure one can create a
fully defined hypothetical market. Then price a set of swaptions and caplets on this market and use
these prices and exogenous market structures to recover the input volatility form.
For calibration under the hypothetical market we assume a typical instantaneous forward rate
volatility structure following the linear exponential parametric form first introduced by Rebonato
which is time-homogeneous and dependent upon time to maturity. The shape of the volatility curve
features a maximum turning point approximately at the 2 year time-to-maturity point (see Figure 3).
This is a parametric form of the non-parametric volatility grid that Pedersenβs calibration attempts to
recover.
πΎπ(π‘, π) = [π(ππβ1 β π‘) + π]πβπ(ππβ1βπ‘)
+ π
Figure 3: Instantaneous volatility surface of the forward rate and time-homogenous form
Pedersenβs approach also uses requires that the instantaneous correlation structure between
forward rates be specified. This is an exogenous input and assumed constant through time and equal
to that seen at π‘ = 0. In this hypothetical market, a typical correlation structure of exponential
form and full-rank will be used [10]. The correlation decays with the difference between forward
rate maturities.
ππ,π = πβ + (1 β πβ)πβπ½(|ππβπ π|) πΎ
[10]
1. Create hypothetical market and test calibration
β’Test PCA decomposition of volatility grid
β’Test swaption and caplet pricing
β’Calibrate to hypothetical market and recover input
volatility structure
2. Gather AUD market data for 10Y time horizon
β’Bootstrap discount curve
β’Build list of swaption and cap market prices
β’Build yield curve correlation matrix from historical
data set
3. Calibrate to AUD market data
β’Fit to entire swaption matrix and caps
β’Ensure evolution of caplet volatility structure is
smooth
πΎπ(π‘, π)
π‘
6. 6
The correlation matrix will be discretised in the same fashion as the forward rate times for the
volatility grid (see Figure 4). Correlations between forward rates between these times are assumed
constant. The parameters of πβ, π½and πΎ will be specified in each test case.
Figure 4: Volatility grid discretisation used for the hypothetical market testing and calibration example (π ππ€π = 7, π πππ = 6)
The following sections validate that the implementation is working correctly prior to testing
hypothetical market calibration. Test suite plan below.
Figure 5: Project test suite plan before Market Calibration
Test suite workflow
β’In 'pedersenLFMMain.cpp' one can change the source
to configure which tests to run.Configure tests
β’Re-compile 'PedersenLFMCalibration.vcxproj' VS project
file and run program
β’Program will output test results
Run tests
π‘ππ€π = {0,0.25,0.5,1,1.5,2,3,5.5}
π‘ πππ = {0,0.25,0.5,1,1.5,2,3}
7. 7
Testing PCA decomposition of the volatility grid
To price swaptions and caps/caplets, we need to ensure that the volatility surface can be
decomposed into its factor volatility grids, as described by Pedersen. This approach uses PCA to
decompose the aggregate volatility grid into stochastic factor volatility grids.
The Pedersen approach separates volatility levels and correlation, where the volatility levels πΎπ,π are
the objects to be calibrated and the correlation structure is given exogenously to the calibration.
Volatility levels are given by the volatility grid
πΎπ,π, 1 β€ π β€ π πππ, 1 β€ π β€ π ππ€π
where πΎπ,π is the volatility level as seen at time π‘πβ1 (assumed constant until π‘π) of the period forward
rate with maturity π‘πβ1for the forward period beginning at time π‘πβ1 + π₯ π . Correlation and
covariance are introduced via a principal components representation. Let π£ππ be the vector of basic
period forward rate volatilities as seen on time π‘πβ1. Let πΆπππ be the corresponding correlation
matrix. The covariance matrix is then computed as
πΆππ£ = π£ππ π‘
πΆπππ π£ππ
Let Ξ be the diagonal matrix containing the eigenvalues of πΆππ£ and π be the corresponding matrix of
eigenvectors, i.e. we have the eigenvalue/eigenvector decomposition of πΆππ£
πΆππ£ = π π‘
Ξπ
As πΆππ£ is positive semidefinite, all entries ππ on the diagonal of Ξ will be non-negative and we have
πΆππ£ = π π‘
π
where π π,π = β ππ π£ π,π are referred to as the factor loadings.
One can then extract the stepwise constant volatility function for forward rates as
πΎ π,π,π = π π,π
π will provide values for as many factors as the rank of the covariance matrix. For a given π πππ, we
only use the rows of π corresponding to the π πππlargest eigenvalues. As described in [5].
To test, we assume a perfect correlation structure so that there is no time-dependency in the
covariance decomposition and set the aggregate volatility grid elements each to 1.0. Then using the
maximum number of factors allowed for the volatility grid (π πππ= number of forward discretisationβs
= π ππ€π = 7) we test to see whether the element wise square volatility grid is recovered from its
element wise square decomposed factor grids (see [11]). The Appendix has program output showing
the test results (see Appendix Section 1). The errors in each element from the recovered volatility
grid are ~10β16
. Once the decomposition has been tested, we can use the factor grids to test
covariance/variance integration which will be heavily relied upon in caplet and swaption pricing.
πΎπ,π
2(π‘, π) = β πΎ π,π,π
2(π‘, π)
π πππ
π=1
[11]
Testing variance/covariance integral
As seen in the pricing formulae for caps/caplets (Equation [3]) and swaptions (Equation [9]), the
covariance and variance integrals below have to be computed:
8. 8
β« πΎπ(π ). πΎπ(π )ππ
π πΌ
0 β« |πΎπ(π )|2ππβ1
0
ππ [12]
Using the volatility grid specified above with all elements equal to 1.0. One can easily check the
variance and covariance integral specification. Given that the volatility grid is piecewise constant, the
integral is computed by adding up the grid values along the path followed on the relative time grid in
a diagonal direction (see Figure 4). The relative time path shown in the figure is for forward rates
with time to maturity of 2 and 3 years respectively. Volatility is zero beyond the maturity time of the
forward rate because the forward rate is no longer βaliveβ.
The process of integrating along the path in a relative time volatility grid involves adding up the grid
components that the diagonal coincides and the amount of calendar time spent in that grid. As
described in [5].
πΎ π,π,π represents the nth stochastic volatility component of the volatility grid where π‘πβ1 < π‘ β€ π‘π
and π₯ πβ1 < π β π‘ β€ π₯ π. Below is the representation of the variance integral in the relative time
grid form:
β« |πΎπ(π )|2
ππβ1
0
ππ = β π π,π
(π,π)βπ΄
β πΎ2
π,π,π
π πππ
π=1
π π,π = min(π‘π; ππβ1 β π₯ πβ1) β max(π‘πβ1; ππβ1 β π₯ π)
π΄ = {(π, π)|π‘πβ1 + π₯ πβ1 < ππβ1 < π‘π + π₯ π}
[13]
A similar but more complex formula is involved for covariance integral:
β« πΎπ(π ). πΎ π(π )ππ
π
0
= β π π,π π,π π
(π,π π,π π)βπ΅
β πΎ π,π,π π
πΎ π,π,π π
π πππ
π=1
π = min(π; ππβ1; ππβ1)
π π,π π,π π
= min(π‘π; ππβ1 β π₯ π πβ1; ππβ1 β π₯ π πβ1; π) β max(π‘πβ1; ππβ1 β π₯ π π
; ππβ1 β π₯ π π
)
π΄ = {(π, π π, π π)|π π,π π,π π
> 0}
[14]
The Appendix has program output showing the test results (see Appendix Section 2). The calculated
integrals equal the minimum of the time to maturity inputs in each case due to the use of a flat
volatility grid with aggregate value of 1.0.
Testing Swaption/Caplet pricing
Now that the variance/covariance integral implementation has been tested, the pricing formulae
implementation for caplets (Equation [3]) and swaptions (Equation [9]) can be validated.
The Appendix has program output showing the test results (see Appendix Section 3).
MATLAB has a purpose built function blackvolbyrebonato.m [9] that computes the Black Volatility
for input specifications of a swaption to be priced. The program implementation was fed the same
input specifications and the output was compared for a linear exponential volatility (see Appendix
Section 6 & 7). It would have been also possible to use Monte Carlo Simulation to perform this
validation but in the interest of time validation was MATLAB was performed.
The pricing test suite use inputs similar to those in the MATLAB pricing scripts (see Appendix Section
6 & 7). A flat perfect correlation matrix was used so that there was no time-dependency in the
covariance decomposition.
9. 9
MATLAB uses a continuous volatility function while my implementation uses the Pedersen piecewise
constant volatility grid. The grid was discretised in the finest possible 0.25 year fraction intervals
(assumed tenor year fraction) to reduce quantisation error up to 10 years in calendar and forward
time.
This explains the discrepancy in the caplet pricing for early maturity where the volatility grid is
changing quickly. The program output caplet prices approach that of the MATLAB output at larger
maturity times because the volatility function is flattens. Similar to the caplet pricing case, due to the
discretised volatility grid, the generated swaption vols. are very similar to those output by MATLAB.
Choosing a trivial flat volatility specification of 14% reproduces MATLAB prices exactly.
Figure 6: Caplet and swaption pricing tests - compared with MATLAB output for a linear exponential volatility spec.
Testing Hypothetical Market Calibration
The Appendix has program output showing the test results for hypothetical market calibration (see
Appendix Section 4).
The approach was to generate cap and swaption prices from an input volatility function and recover
this input function using Pedersen calibration.
Pedersenβs paper summaries the list of inputs required for LFM calibration via his approach:
ο· List of vanilla caps/swaptions ATM market premia
ο· Initial discount curve and forward rate curve
ο· Initial forward rate volatilities (this will serve as the cold fit initial estimate for
calibration).
10. 10
ο· Historical forward rate data for exogenous correlation matrix of forward rates
ο· The model calibration discretisation in forward and calendar time (will be dependent
upon how many 'time buckets' forward rate correlations can be sampled and calibration
instruments).
Calendar time discretisation (Figure 4) π‘ πππ = {0,0.25,0.5,1,1.5,2,3}; π πππ = 6
Forward time discretisation (Figure 4) π‘ππ€π = {0,0.25,0.5,1,1.5,2,3,5.5}; π ππ€π = 7
LFM stochastic factors π πππ = π ππ€π = 7
Flat initial forward rate up to 10 years 5%
Exogenous correlation matrix πβ = 0 | π½ = 0.1| πΎ = 1
Initial forward rate vols. 22% (starting calibration grid)
QOF_swaptions | QOF_caplets | scaleFwd |scaleCal 2.5 | 1 | 7πβ4
| 75πβ3
Input volatility (Figure 7) π | π | π | π = β0.06 | 0.17 | 0.54 | 0.17
Table 1: Hypothetical Market Specifications
Swaption instruments
(Total: 121)
ππΌ = {0.25,0.5,0.75,1.0,1.25,1.5,1.75,2.0,2.25,2.5,2.75}
ππ½ = {0.25,0.5,0.75,1.0,1.25,1.5,1.75,2.0,2.25,2.5,2.75}
ππΌ = πππ‘πππ πππ‘π’πππ‘π¦; ππ½ = π π€ππ π‘ππππ
Cap instruments
(Total: 3)
ππ½ = {1.0, 2.0 3.0}
ππ½ = πππ πππ‘π’πππ‘π¦
Table 2: Hypothetical Market β Calibration Instruments
Figure 7: The input volatility structure of forward rates in the hypothetical market as a function of forward time
πΎπ(π‘, π) = [π(ππβ1 β π‘) + π]πβπ(ππβ1βπ‘)
+ π
π | π | π | π = β0.06 | 0.17 | 0.54 | 0.17
11. 11
Figure 8: Exogenous correlation matrix between period forward rates in the hypothetical market
After the forward rate correlation and volatility grids have been defined, I chose a set of swaptions
and caps to price. These will act as the hypothetical market instruments for calibration. The
optimisation space is π πππ = 6 π₯ π ππ€π = 7 therefore it is important to choose a large number of
instruments to better specify the problem.
Optimisation
The process of calibration is an optimisation problem, fitting model prices to market prices.
Pedersen suggests the use of Powellβs gradient-less multi-dimensional optimisation routine to the
high dimensionality of his approach. Powellβs method is a way to generate d mutually conjugate
directions without knowledge of the objective function Hessian [10] and is well suited to solving
complex optimisation problems with 100βs of parameters.
The implementation of Powells algorithm (BOBYQA) used for this project is in the dlib c++ open
source library. Dlib is a modern C++ toolkit containing machine learning algorithms and tools for
creating complex software in C++ to solve real world problems. It is open source software and
licensed under the Boost Software License [11]. BOBYQA is a method for optimizing a function in the
absence of derivative information. Powell described it as a method that seeks the least value of a
function of many variables, by applying a trust region method that forms quadratic models by
interpolation. There is usually some freedom in the interpolation conditions, which is taken up by
minimizing the Frobenius norm of the change to the second derivative of the model.
Hypothetical Market Calibration β Results
Results of the hypothetical market calibration are shown in Figure 9, Figure 10 and Figure 11 starting
from a flat input volatility grid of 22%. The optimisation routine evaluated the objective function
over 1075 iterations (see Table 3 below for summary).
Iteration: 1075
Cost: 0.000532636
QOF_swaptions | QOF_caps | smoothFwd | smoothCal
9.45797e-06 | 9.11704e-06 | 0.675317 | 0.000339392
Table 3: Hypothetical Market Calibration β Final result summary
ππ,π = πβ + (1 β πβ)πβπ½(|ππβπ π|) πΎ
πβ = 0 | π½ = 0.1| πΎ = 1
12. 12
Figure 9: Hypothetical Market Calibration β Recovered input forward rate volatility
Figure 10: Hypothetical Market Calibration β Swaption Black Market vols Vs Calibrated model vols (model β market error)
The volatility grid πΎ(π‘, π) is recovered to within [-1.2,0.6]%, swaption Black volatilities are priced to
within +/- 0.25% absolute error and cap Black volatilities are priced to within +/- 0.1% absolute error
compared with input hypothetical market instrument prices. Due to the fact the pre-specified
volatility structure was extrapolated in the calendar time direction QOF cost loading on the smooth
measure over calendar time had to be greatly increased (Pedersen suggests π ππππ πππ, π ππππππ€π β
10β4
however π ππππ πππ = 75π₯10β3
yield better results). As a result, the grid is flat in the calendar
time direction. There is error at large forward times on the calibrated volatility grid because the
curvature of the grid is still high while there is 2.5 year spacing at that point (from 3 β 5.5). Swaption
model price errors increase for higher maturity and swap tenor instruments (2-3 year region). The
errors are still within market bid-ask spreads (+/- 0.5% Black Volatility). This is mainly due to the
13. 13
difficulty in joint calibration to swaptions and caps using a piecewise grid. As generally seen in
market prices, the derivative of the cap/caplet volatilities are greatest in this region and therefore
there is greater quantisation error. The fit to cap Black Volatilities is almost exact.
Figure 11: Hypothetical Market Calibration β Cap Black Market vols Vs Calibrated model vols (model β market error)
Now that the test suite has passed and calibration on a hypothetical market has shown promising
results, we can move to AUD market data calibration.
5) AUD Market Data Calibration
Calibration workflow
AUD Market data was taken using the UTS Bloomberg Terminal on 22 Oct 2015. Thanks to Igor
Geninson for his assistance.
β’Grab market data from access terminal and store in
an excel spreadsheet 'AUD Market Data'
β’'AUD Swap Curve', 'AUD ATM Swaptions', 'AUD Caps
Floors', 'AUD Zero Curve' tabs
Access Market
Data
β’Run MATLAB function 'LiborCalibrationPreProcess.m'
β’Copy output from MATLAB command window into
the source file 'pedersenLFMMain.cpp' and set
MARKETDATA_CALIBRATION = true in main
Process data and
move calibration
inputs
β’Re-compile 'PedersenLFMCalibration.vcxproj' VS
project file and run program
β’Program will output running calibration results
Run calibration
14. 14
Data that was required (see Figure 23 for Bloomberg screenshots)
ο· Current money market swaps curve which has deposit rates and par swap rates to bootstrap
discount curve
ο· ATM Swaption matrix (mid Black Volatilities) (see Figure 13)
ο· ATM Cap prices (mid Black Volatilities) (see Figure 14)
ο· Historical zero rates up to 6 years of daily data
Instruments of interest
This calibration run focussed on swaptions with maximum maturity of 3 years and swap tenor of 7
years and caps with a maximum period of 10 years. Following the AFMA Interest Rate Option
Conventions [13], markets are quoted on A/365. Caps and floors are quoted on a quarterly basis.
Swaptions are quoted on a quarterly basis for maturities out to 3 years. Therefore, the volatility grid
should extend to a least 10 years in calendar and forward time. The volatility grid is discretised in
quarter year fraction intervals up to 3 years then increasing thereafter (see Figure 12).
Figure 12: AUD Market Calibration β Forward Volatility grid discretisation and model horizon
Calendar/Forward time discretisation (Figure 12) π πππ = π ππ€π = 17
LFM stochastic factors π πππ = 5
QOF_swaptions | QOF_caplets | scaleFwd |scaleCal 32 | 8 |2πβ4
| 2πβ4
Table 4: AUD Market Data Calibration Specifications
Swaption instruments
(Total: 42)
ππΌ = {0.25,0.5,0.75,1,2,3}
ππ½ = {1,2,3,4,5,6,7}
Cap instruments
(Total: 10)
ππ½ = {1, 2, 3,4,5,6,7,8,9,10}
Table 5: AUD Market Data β Calibration Instruments
π‘ππ€π = π‘ πππ =
{0,3/12,6/12,9/12,1,1.25,1.5,1.75,2
,2.25,2.5,2.75,3,3.5,4.25,5,7,10.5}
15. 15
Figure 13: AUD Market Calibration β AUD ATM Swaption Black Volatilities (22 Oct 2015)
Figure 14: AUD Market Calibration β AUD ATM Cap Black Implied Volatilities (22 Oct 2015)
Bootstrapping the discount curve
Once all the market data has been stored in the excel spreadsheet. MATLAB is used to read in all the
data, pre-process the data and set the appropriate date conventions. A toolbox function called
IRDataCurve.bootstrap.m is used to bootstrap an initial discount curve from the input swaps curve
using deposit rates, forward rate agreements and par swap yields. A cubic spline interpolation was
used to fit the discount curve and minimise the error between present value cash flows in the model
and the market. Below are the results in Figure 15. Continuity and smoothness of the forward curve
is a critical factor in derivative pricing.
The bootstrapped initial discount curve was then used to compute the initial period forward rates
(see Section 1)) and accrual periods between forward rate fixing times. These are necessary inputs
into the calibration routine.
Building the historical correlation matrix
We saw that forward rate correlations are inputs to the LMM framework (Section 1). The value of a
swaption (Equation [9]) at maturity seems to be influenced by the joint distribution of forward rates
and thus by the correlation amongst them. Despite the literature suggesting that fitting a historical
correlation matrix adds little value to the calibration procedure for swaptions [1], I thought it would
be a good exercise to examine the results.
16. 16
Figure 15: AUD Market Calibration β AUD Money Market Bootstrapped Curves (22 Oct 2015)
Historical rates were accessed via Bloomberg and historical period forward curves were stripped on
daily data from 22 Oct 2009 to 22 Oct 2015 (π π‘ = 2190). The period forward rates are bucketed in
the same discretisation as forward time in the volatility grid. The basic steps for computing historical
correlations are:
1. Fix the tenor π and let π₯π where 1 β€ π β€ π ππ€π
2. For each historical time π‘π, where 1 β€ π β€ π π‘, construct the yield curve and compute the
period forward rate ππ(π‘π) for each tenor period.
3. Create vectors
ln(π π(π‘ π+1))βln(π π(π‘π))
β π‘ π+1βπ‘π
assuming log-normal distribution of forward rates and
annualising the variance. The natural logarithm of the forward rates is jointly normally
distributed. This assumes the distribution is constant in time.
4. Compute the pair-wise correlation between vectors for 1 β€ π β€ π ππ€π
The use of daily data is a sufficient proxy for instantaneous correlations. This method also assumes
that the correlations are time-homogeneous.
It is common to smooth the empirical correlation matrix by fitting it to a parametric form, usually
with the number of effective parameters ranging from 2 to 5. Parameterizing a correlation matrix Ο
must ensure that the general properties of correlation matrices are preserved. Following [8], these
are:
1) π is real and symmetric
2) πππ = 1 π = 1, . . . , π ππ€π πππ β 1 β€ πππ β€ 1 β π, π
3) π is positive definite
17. 17
The following parametrisation was used, from [8] and fit via non-linear least squares:
ππ,π = πβ + (1 β πβ) (ππ₯π (βπ½(π πΌ
+ π π½
)) +
ππ,π
β ππ,π ππ,π
β(1 β ππ₯π{β2π½π πΌ}(1 β ππ₯π{β2π½π πΌ}))
With:
ππ,π = {
1
πππ(π, π)
((ππ ππ) πππ(π,π)
β 1)/(1 β 1/(ππ ππ))
πππ(π, π) = 0
πππ(π, π) > 0, ππ ππ = 1
πππ(π, π) > 0, ππ ππ β 1
}
ππ = ππ₯π(β
1
π
(
π β 1
π β 2
πΎ +
π β 1 β π
π β 2
πΏ))
πΌ, π½ > 0, πΎ, πΏ β β, πβ β [0,1)
Fitted Parameters of Smoothed Correlation Matrix
πβ πΌ π½ πΎ πΏ RMSE (with input)
0.3104 12.5430 0.0002 -0.4186 3.5684 0.1332
Figure 16: AUD Market Calibration β Instantaneous 3Mo forward rate historical correlation matrix (22 Oct 2009 - 22 Oct
2015) in tenor buckets the same as discretisation of volatility grid in forward time
18. 18
Starting volatility grid for calibration
Pedersen suggests using the initial period forward rate volatilities estimated from historical data to
be used as the starting point volatility grid for calibration. Using the same data set used to build the
correlation matrix, the initial forward rate volatilities were computed (see Figure 18). This was
extrapolated in the calendar time direction and fed into the BOBYQA optimisation function.
Figure 17: AUD Market Calibration β Historical AUD 3Mo Period Forward Rates (22 Oct 2009 - 22 Oct 2015)
Figure 18: AUD Market Calibration β Initial period forward rate volatilities over 6 year period (22 Oct 2015)
19. 19
AUD Market Data Calibration results
The Appendix has program output showing the test results for market data calibration (see Appendix
Section 5.
Results of the AUD ATM market data calibration are shown in Figure 20, Figure 22 and Figure 21, and
starting from a the initial input volatility grid in Figure 18. The optimisation routine evaluated the
objective function over 5800 iterations (see Table 1 below for summary).
Iteration: 5800
Cost: 0.00688651
QOF_swaptions | QOF_caps | smoothFwd | smoothCal
4.35124e-05 | 3.18733e-05 | 5.83021 | 4.64805
Table 6: AUD ATM Market Calibration β Final result summary
The choice of calibration instruments is important because the optimisation routine relies upon
them as feedback to dictate how the volatility grid will specified after each iteration. The model
time horizon was chosen to be 10 years to include as many input instruments without over
specifying the problem.
Swaption Black volatilities are priced to within +/- 0.5% absolute error and Cap Black volatilities are
priced to within +/- [0.4%,-0.1%] absolute error compared with input market instrument prices. The
errors are within market bid-ask spreads. Swaption volatilities are most sensitive in 2-3 year tenor
and 2-3.5 year maturity region. This is mainly due to the difficulty in joint calibration to swaptions
and caps using a piecewise grid. Examining stripped caplet volatilities from market cap volatilities
(see Figure 19) shows that the volatility varies dramatically for forward time from 1 β 4 years. This
gives a good indication as to what the forward rate volatility structure will need to represent.
Originally, this implementation used stripped caplet volatilities as the input market instruments in
place of caps. This was found to force assumptions on the term structure which led to erroneous
model prices and erratic volatility grids therefore cap market volatilities were used.
Figure 19: AUD Market Calibration β AUD ATM Caplet Black Implied Volatilities stripped from Cap Vols.
These market characteristics also explain why swaptions of maturity up to only 3 years were
included as calibration inputs. These instruments have forward rate volatilities βaliveβ for the
20. 20
greatest period of time in the region which deems to be the most difficult to enforce the
smoothness constraint. Therefore, in this region the volatility grid must be specified as finely as
possible given its piece-wise constant specification. Obviously there is a trade-off with speed of
calibration and accuracy. As the volatility grid is discretised more finely (as Pedersen examines), the
time of calibration increases rapidly. Hence, the decision to slice forward and calendar time equally
in quarter year fractions up to 3 years and increase thereafter. This resulted in reasonable model
pricing performance and speed of calibration (typically 7 hours from cold fit).
It is evident from the volatility grid πΎ(π‘, π) in Figure 21, that the smoothness constraint was not
forceful enough to ensure smoothness of caplet volatility evolution. The volatility grid spikes up to
~71% at 2.5 year calendar time and 0.25, 0.5 year forward time grids.
In future, it will be more favourable to increase the smoothing constraints and more finely discretise
forward time up to 5 years.
Figure 20: AUD Market Calibration β AUD ATM Swaption Black Volatilities calibration results (model β market error)
Figure 21: AUD Market Calibration β Calibrated LFM volatility grid (22 Oct 2015)
21. 21
Figure 22: AUD Market Calibration β AUD ATM Cap Black Implied Volatilities calibration results (model β market error)
6) Conclusion and future improvements
In summary, this implementation successfully applied the Pedersen LFM calibration to AUD Market
Data, fitting jointly to ATM swaptions and caps for a model time horizon of 10 years. The correctness
of the implementation was demonstrated in a number of independent unit test cases and also was
able to recover an input hypothetical market.
In future, the ideal implementation would be to use the XLW Open Source Project to directly call the
Pedersen routine from a Microsoft Excel interface. This would greatly streamline the calibration
process and reduce the likelihood of translation error. In order for this to occur the implementation
would require discount curve bootstrapping functionality in C++ as well as adding the XLW interface
to read the market data.
22. 22
7) References
1. Choy, B., Dun, T. and SchlΓΆgl, E. (2004), Correlating Market Models, RISK pp. 124β129
2. Brigo, D. and Mercurio, F. (Jan 2002) Calibrating Libor, Risk Magazine
3. Brigo, D. and Mercurio, F. (2001), Interest Rate Models: Theory and Practice, Springer-
Verlag.
4. Molgedey, L. (2002), Calibration of the deterministic and stochastic volatility libor market
model, Presentation at the Frankfurt MathFinance Workshop 2002.
5. Pedersen, M. (1998), Calibrating LIBOR Market Models, Financial Research Department,
Simcorp, working paper .
6. Pilz, K. and SchlΓΆgl, E. (2010) Calibration of Multicurrency LIBOR Market Models, QFRC
RP286
7. Brace A., Dun T. and Barton G. (1998) Towards a central interest rate model Financial Math
Modelling & Analysis notes working paper, published in Handbooks in Mathematical
Finance: Topics in Option Pricing, Interest Rates and Risk Management (2001), Cambridge
University Press
8. Lutz, M. (2011). Libor Market Models with Stochastic Volatility and CMS Spread Option
Pricing, PhD Thesis. Ulm University
9. Financial Instruments Toolbox help β Function
http://au.mathworks.com/help/fininst/blackvolbyrebonato.html
10. Press, W. H., Teukolsky, S. A., Vetterling, W. T. and Flannery, B. P. (2007), Numerical Recipes:
The Art of Scientific Computing, 3rd edn, Cambridge University Press.
11. http://dlib.net/optimization.html#find_min_bobyqa
12. Black, F. (1976), The Pricing of Commodity Contracts, Journal of Financial Economics 3, 167β
179.
13. The Australian Financial Markets Association β Interest Rate Options Conventions:
http://www.afma.com.au/standards/market-
conventions/Interest%20Rate%20Options%20Conventions.pdf
25. 25
2. Test Variance/Covariance Integral
Program output (copied from cmd to excel):
TEST β VARIANCE/COVARIANCE INTEGRAL
varIntegralSum - maturity time (mid grid) = 2.2
calculated: 2.2
varIntegralSum - maturity time (on grid) = 2
calculated: 2
covarIntegralSum - maturity time (mid grid) = 2.2
covarIntegralSum - Ta (mid grid) = 2.2
covarIntegralSum - Tb (mid grid) = 2.2
calculated: 2.2
covarIntegralSum - maturity time (on grid) = 2
covarIntegralSum - Ta (on grid) = 2
covarIntegralSum - Tb (on grid) = 2
calculated: 2
covarIntegralSum - maturity time (on grid) = 1.3
covarIntegralSum - Ta (on grid) = 2
covarIntegralSum - Tb (on grid) = 2.9
calculated: 1.3
covarIntegralSum - maturity time (on grid) = 2.8
covarIntegralSum - Ta (on grid) = 1.1
26. 26
covarIntegralSum - Tb (on grid) = 2.2
calculated: 1.1
covarIntegralSum - maturity time (on grid) = 2.7
covarIntegralSum - Ta (on grid) = 2
covarIntegralSum - Tb (on grid) = 2
calculated: 2
covarIntegralSum - maturity time (on grid) = 1.5
covarIntegralSum - Ta (on grid) = 2.2
covarIntegralSum - Tb (on grid) = 2.2
calculated: 1.5
covarIntegralSum - maturity time (on grid) = 2.4
covarIntegralSum - Ta (on grid) = 1.7
covarIntegralSum - Tb (on grid) = 2
calculated: 1.7
27. 27
3. Test Swaption/Caplet Pricing
Program output (copied from cmd to excel):
TEST - SWAPTION AND CAPLET PRICING
Test swaption pricing - corr matrix
beta | gamma | longTermCorr
0 | 1 | 0
Test pricing - vol specs
vol = (b*fwdRateTime + a)*exp(-c*fwdRateTime) + d
a | b | c | d
-0.02 | 0.3 | 0.7 | 0.14
test swaption pricing - tenor times and
betas
3 3
4 4
test swaption pricing - mat times and alphas
5 5
test swaption pricing with MATLAB - swaption vols
0 3 4
5 0.227398 0.216527
test caplet pricing with MATLAB - caplet vols
0.25 0.18617
0.5 0.210122
1 0.242089
2 0.265751
3 0.264544
4 0.255218
5 0.244238
6 0.233862
7 0.224728
8 0.216891
9 0.210214
28. 28
Test swaption pricing - corr matrix
beta | gamma | longTermCorr
0 | 1 | 0
Test pricing - vol specs
vol = (b*fwdRateTime + a)*exp(-c*fwdRateTime) + d
a | b | c | d
0 | 0 | 0 | 0.14
test swaption pricing - tenor times and
betas
3 3
4 4
test swaption pricing - mat times and alphas
5 5
test swaption pricing with MATLAB - swaption vols
0 3 4
5 0.14 0.14
test caplet pricing with MATLAB - caplet vols
0.25 0.14
0.5 0.14
1 0.14
2 0.14
3 0.14
4 0.14
5 0.14
6 0.14
7 0.14
8 0.14
9 0.14