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) 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 πΎ(π‘, π)
Cal
end
ar t
ime
PCA on π‘ πβ1
covariance matrix (volatility grid and correlation matrix)
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
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
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
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 resultsRun tests
π‘ππ€π = {0,0.25,0.5,1,1.5,2,3,5.5}
π‘πππ = {0,0.25,0.5,1,1.5,2,3}
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
β« πΎπ(π ). πΎπ(π )ππ ππΌ
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
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
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
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
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
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 resultsRun calibration
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
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
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
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
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
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
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
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
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
23
Appendix
1. Test Covariance PCA decomposition Program output (copied from cmd to excel):
TEST - FACTOR VOL COVAR DECOMP
test corr class (factor vol test) - Correlation matrix
0 0.25 0.5 1 1.5 2 3 5.5
0.25 1 1 1 1 1 1 1
0.5 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1
1.5 1 1 1 1 1 1 1
2 1 1 1 1 1 1 1
3 1 1 1 1 1 1 1
5.5 1 1 1 1 1 1 1
test factorVol class and varIntegrals - starting vol grid = 1.0
0 0.25 0.5 1 1.5 2 3 5.5
0.25 1 1 1 1 1 1 1
0.5 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1
1.5 1 1 1 1 1 1 1
2 1 1 1 1 1 1 1
3 1 1 1 1 1 1 1
aggVolGridSqu from class
0 0.25 0.5 1 1.5 2 3 5.5
0.25 1 1 1 1 1 1 1
0.5 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1
1.5 1 1 1 1 1 1 1
24
2 1 1 1 1 1 1 1
3 1 1 1 1 1 1 1
aggVolGridSqu_PCA from class factors with: 7 factors
0 0.25 0.5 1 1.5 2 3 5.5
0.25 1 1 1 1 1 1 1
0.5 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1
1.5 1 1 1 1 1 1 1
2 1 1 1 1 1 1 1
3 1 1 1 1 1 1 1
diff between vol squared with: 7 factors
0 0.25 0.5 1 1.5 2 3 5.5
0.25 -8.88E-16 -4.44E-16 -4.44E-16 -4.44E-16 -4.44E-16 -4.44E-16 -4.44E-16
0.5 -8.88E-16 -4.44E-16 -4.44E-16 -4.44E-16 -4.44E-16 -4.44E-16 -4.44E-16
1 -8.88E-16 -4.44E-16 -4.44E-16 -4.44E-16 -4.44E-16 -4.44E-16 -4.44E-16
1.5 -8.88E-16 -4.44E-16 -4.44E-16 -4.44E-16 -4.44E-16 -4.44E-16 -4.44E-16
2 -8.88E-16 -4.44E-16 -4.44E-16 -4.44E-16 -4.44E-16 -4.44E-16 -4.44E-16
3 -8.88E-16 -4.44E-16 -4.44E-16 -4.44E-16 -4.44E-16 -4.44E-16 -4.44E-16
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
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
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
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
29
4. Test Hypothetical Market Calibration Program output (copied from cmd to excel):
START CALIBRATION - HYPOTHETICAL MARKET
Hypothetical market - vol specs
vol = (b*fwdRateTime + a)*exp(-c*fwdRateTime) + d
a | b | c | d
-0.06 | 0.17 | 0.54 | 0.17
HypoMarket_AggVolGrid for col vec to grid check
0 0.25 0.5 1 1.5 2 3 5.5
0.25 0.15471 0.189084 0.234102 0.256747 0.265087 0.259054 0.21489
0.5 0.15471 0.189084 0.234102 0.256747 0.265087 0.259054 0.21489
1 0.15471 0.189084 0.234102 0.256747 0.265087 0.259054 0.21489
1.5 0.15471 0.189084 0.234102 0.256747 0.265087 0.259054 0.21489
2 0.15471 0.189084 0.234102 0.256747 0.265087 0.259054 0.21489
3 0.15471 0.189084 0.234102 0.256747 0.265087 0.259054 0.21489
diff - recovered assumed market vol structure
0 0.25 0.5 1 1.5 2 3 5.5
0.25 0 0 0 0 0 0 0
0.5 0 0 0 0 0 0 0
1 0 0 0 0 0 0 0
1.5 0 0 0 0 0 0 0
2 0 0 0 0 0 0 0
3 0 0 0 0 0 0 0
HypoMarket_AggVolGrid check after class instance
0 0.25 0.5 1 1.5 2 3 5.5
0.25 0.15471 0.189084 0.234102 0.256747 0.265087 0.259054 0.21489
0.5 0.15471 0.189084 0.234102 0.256747 0.265087 0.259054 0.21489
1 0.15471 0.189084 0.234102 0.256747 0.265087 0.259054 0.21489
1.5 0.15471 0.189084 0.234102 0.256747 0.265087 0.259054 0.21489
2 0.15471 0.189084 0.234102 0.256747 0.265087 0.259054 0.21489
30
3 0.15471 0.189084 0.234102 0.256747 0.265087 0.259054 0.21489
HypoMarket etaFac after class instance
7
Starting vol grid
0 0.25 0.5 1 1.5 2 3 5.5
0.25 0.22 0.22 0.22 0.22 0.22 0.22 0.22
0.5 0.22 0.22 0.22 0.22 0.22 0.22 0.22
1 0.22 0.22 0.22 0.22 0.22 0.22 0.22
1.5 0.22 0.22 0.22 0.22 0.22 0.22 0.22
2 0.22 0.22 0.22 0.22 0.22 0.22 0.22
3 0.22 0.22 0.22 0.22 0.22 0.22 0.22
Calibration - first call
Flat fwd rate: 0.05
Cal params:
etaFac | QOF_swaptions | QOF_caps | scaleFwd | scaleCal
7 | 2.5 | 1 | 0.0007 | 0.075
swaption vols - market prices (%)
0 0.25 0.5 0.75 1 1.25 1.5 1.75 2 2.25 2.5 2.75
0.25 15.471 17.0736 18.8017 19.6223 20.4752 20.991 21.4168 21.6933 21.7099 21.6213 21.6303
0.5 17.2754 18.9621 20.0092 20.8764 21.4243 21.8903 22.1456 22.269 22.1051 22.0727 22.1118
0.75 19.5356 20.3739 21.3665 21.868 22.3607 22.6083 22.7502 22.6039 22.5152 22.5232 22.3476
1 20.5728 21.5825 22.1417 22.6596 22.9214 23.0981 22.9459 22.8858 22.8612 22.7067 22.1142
1.25 21.6894 22.1892 22.8429 23.11 23.3359 23.1846 23.1491 23.1605 23.0053 22.3917 21.8731
1.5 22.4029 23.0451 23.3248 23.573 23.4074 23.4041 23.4454 23.3291 22.6641 22.1436 21.7023
1.75 23.0343 23.2859 23.6547 23.4751 23.5392 23.6395 23.5624 22.8689 22.3355 21.9129 21.5498
2 23.4967 23.8312 23.6054 23.7303 23.8904 23.8462 23.0916 22.5637 22.1442 21.8041 21.5049
2.25 23.7764 23.5006 23.8187 24.0628 24.0586 23.2283 22.7077 22.3272 22.0078 21.7393 21.495
2.5 23.9978 24.2602 24.4845 24.4248 23.4426 22.9161 22.5643 22.2853 22.0325 21.81 21.6
2.75 24.1774 24.4144 24.3803 23.2609 22.8145 22.562 22.3647 22.1807 21.9918 21.8145 21.639
31
cap vols - market prices (%)
1 17.7668
2 20.6571
3 22.1346
Instantaneous corr matrix
beta | gamma | longTermCorr
0.1 | 1 | 0
0 0.25 0.5 1 1.5 2 3 5.5
0.25 1 0.97531 0.927743 0.882497 0.839457 0.759572 0.591555
0.5 0.97531 1 0.951229 0.904837 0.860708 0.778801 0.606531
1 0.927743 0.951229 1 0.951229 0.904837 0.818731 0.637628
1.5 0.882497 0.904837 0.951229 1 0.951229 0.860708 0.67032
2 0.839457 0.860708 0.904837 0.951229 1 0.904837 0.704688
3 0.759572 0.778801 0.818731 0.860708 0.904837 1 0.778801
5.5 0.591555 0.606531 0.637628 0.67032 0.704688 0.778801 1
Iteration: 0
Cost: 0.0570736
QOF_swaptions | QOF_caps | smoothFwd | smoothCal
0.0118897 | 0.0273494 | 0 | 0
swaption vols - diff (%)
0 0.25 0.5 0.75 1 1.25 1.5 1.75 2 2.25 2.5 2.75
0.25 6.529 4.79017 2.72507 1.68371 0.642589 -0.0482 -0.64186 -1.08163 -1.34509 -1.54084 -1.71493
0.5 4.72457 2.70255 1.34395 0.380056 -0.3868 -0.96902 -1.4196 -1.71834 -1.88974 -2.04369 -2.17951
0.75 2.46439 1.2261 0.119916 -0.60523 -1.23038 -1.67429 -1.99329 -2.17641 -2.31268 -2.43373 -2.4201
1 1.42721 0.248823 -0.64303 -1.28135 -1.78119 -2.12123 -2.32828 -2.48309 -2.59833 -2.59794 -2.48228
1.25 0.310598 -0.58894 -1.34093 -1.84251 -2.22554 -2.44316 -2.61905 -2.74824 -2.75093 -2.63856 -2.49069
1.5 -0.40291 -1.20237 -1.81622 -2.21733 -2.4762 -2.67473 -2.8294 -2.85255 -2.73913 -2.59958 -2.43403
1.75 -1.0343 -1.68557 -2.17819 -2.44967 -2.69333 -2.87064 -2.91661 -2.80991 -2.67405 -2.51838 -2.34384
2 -1.49671 -2.01491 -2.36929 -2.64291 -2.86667 -2.93228 -2.83436 -2.7126 -2.56496 -2.4023 -2.22584
32
2.25 -1.7764 -2.18168 -2.55457 -2.80785 -2.90768 -2.81356 -2.70968 -2.58059 -2.42855 -2.265 -2.0913
2.5 -1.9978 -2.40708 -2.73383 -2.83964 -2.75654 -2.66948 -2.56387 -2.43286 -2.28125 -2.12073 -1.95257
2.75 -2.17745 -2.54784 -2.70581 -2.62179 -2.57249 -2.49552 -2.39362 -2.26595 -2.11918 -1.96501 -1.80477
cap vols - diff (%)
1 4.72457
2 1.42721
3 -1.0343
calibrated vol grid
0 0.25 0.5 1 1.5 2 3 5.5
0.25 0.22 0.22 0.22 0.22 0.22 0.22 0.22
0.5 0.22 0.22 0.22 0.22 0.22 0.22 0.22
1 0.22 0.22 0.22 0.22 0.22 0.22 0.22
1.5 0.22 0.22 0.22 0.22 0.22 0.22 0.22
2 0.22 0.22 0.22 0.22 0.22 0.22 0.22
3 0.22 0.22 0.22 0.22 0.22 0.22 0.22
Iteration: 1075
Cost: 0.000532636
QOF_swaptions | QOF_caps | smoothFwd | smoothCal
9.45797e-06 | 9.11704e-06 | 0.675317 | 0.000339392
swaption vols - diff (%)
0 0.25 0.5 0.75 1 1.25 1.5 1.75 2 2.25 2.5 2.75
0.25 0.124435 0.014175 -0.04919 -0.0807 -0.02602 0.011014 0.006135 0.002163 -0.01429 -0.02725 -0.03874
0.5 0.063802 -0.02878 -0.0817 -0.06089 -0.01099 0.003865 -8.27E-05 -0.011 -0.02863 -0.04411 -0.05755
0.75 0.015922 -0.06158 -0.06526 -0.03565 -0.00657 0.001272 -0.00896 -0.02365 -0.04591 -0.06503 -0.04702
1 -0.04363 -0.05495 -0.04054 -0.0236 -0.00467 -0.00599 -0.02025 -0.04043 -0.06465 -0.05613 -0.02601
1.25 0.008423 -0.0039 -0.01145 -0.00653 -0.00133 -0.01062 -0.0333 -0.05832 -0.05954 -0.03854 0.002543
1.5 0.036738 0.005016 -0.007 -0.01128 -0.01397 -0.03147 -0.05788 -0.06013 -0.04571 -0.01255 0.03647
1.75 0.025374 -0.00167 -0.0186 -0.02739 -0.03964 -0.06186 -0.06569 -0.05219 -0.02541 0.016341 0.072618
33
2 0.015759 -0.01607 -0.03563 -0.05417 -0.07153 -0.07034 -0.05716 -0.03104 0.005088 0.055084 0.116173
2.25 -0.00528 -0.03736 -0.06706 -0.08942 -0.08115 -0.06271 -0.03633 -0.00067 0.044375 0.099886 0.164843
2.5 -0.03141 -0.07401 -0.10479 -0.09611 -0.06959 -0.03731 -0.00133 0.043204 0.093941 0.153628 0.220275
2.75 -0.07844 -0.11654 -0.1065 -0.07636 -0.0361 0.004785 0.048962 0.0985 0.153247 0.214614 0.281552
cap vols - diff (%)
1 0.0751686
2 0.0154018
3 -0.0033927
calibrated vol grid
0 0.25 0.5 1 1.5 2 3 5.5
0.25 0.155954 0.188114 0.232282 0.258875 0.264746 0.25725 0.228698
0.5 0.157299 0.188556 0.23186 0.258736 0.264764 0.256517 0.228737
1 0.158653 0.188929 0.231226 0.258791 0.264696 0.255242 0.228892
1.5 0.159571 0.189125 0.230916 0.25884 0.263931 0.253705 0.22918
2 0.160189 0.189283 0.230898 0.258439 0.263206 0.252774 0.229472
3 0.160569 0.189404 0.230712 0.258053 0.262815 0.252485 0.229733
34
5. AUD Market Data Calibration
Output Program output (copied from cmd to excel):
LIBOR CALIBRATION - PEDERSEN APPROACH
TEST SUITE:
START CALIBRATION - MARKET DATA
Calibration - first call
Cal params:
etaFac | QOF_swaptions | QOF_caps | scaleFwd | scaleCal
5 | 32 | 8 | 0.0002 | 0.0002
swaption vols - market prices (%)
0 1 2 3 4 5 6 7
0.25 26.83 33.41 35.96 32.44 32.25 31.87 31.5
0.5 29.69 35.25 36.6 33.5 32.65 32.1 31.55
0.75 31.14 35.93 36.24 33.57 32.6 31.94 31.27
1 32.38 36.78 36 33.65 32.55 31.77 31
2 34.73 34.47 33.24 30.9 30.08 29.41 28.74
3 33.5 31.2 30.75 28.3 28.15 27.52 26.9
cap vols - market prices (%)
1 25.15
2 32.16
3 36.9
4 35.88
5 34.51
6 32.51
7 31.09
8 30.59
9 30.19
10 29.89
35
Iteration: 5800
Cost: 0.00688651
QOF_swaptions | QOF_caps | smoothFwd | smoothCal
4.35124e-05 | 3.18733e-05 | 5.83021 | 4.64805
swaption vols - diff (%)
0 1 2 3 4 5 6 7
0.25 -0.01757 0.025231 -0.00437 0.118562 0.093149 -0.17083 0.09957
0.5 -0.01496 -0.02567 -0.07049 0.075929 0.104434 -0.10682 0.072393
0.75 0.063129 0.09845 0.087215 0.114502 0.118234 -0.02893 0.0477
1 0.23528 -0.33206 0.078092 0.117209 -0.00726 0.023992 0.069127
2 0.464365 0.10955 -0.2202 0.467032 0.10585 0.004938 0.022733
3 0.169151 0.521275 -0.56401 0.523289 -0.10184 0.010915 0.20371
cap vols - diff (%)
1 0.006631
2 0.049015
3 -0.03851
4 0.094922
5 -0.10295
6 0.391387
7 0.336871
8 0.135834
9 0.108749
10 0.062104
36
Figure 23: Hypothetical Market Calibration Data β AUD Bloomberg Data (22 Oct 2015)
37
6. MATLAB scripts to test pricing β Caplets
clear all;
close all;
clc;
LMMVolFunc = @(a,t) (a(1)*t + a(2)).*exp(-a(3)*t) + a(4);
LMMVolParams = [.3 -.02 .7 .14];
VolFunc = {@(t) LMMVolFunc(LMMVolParams,t)};
%year fraction corresponding to time until Libor rate L(T_i-1) begins
@ T_i-1
% and expires T_i
capletMaturity = [0.25;0.5;1;2;3;4;5;6;7;8;9];
capletVols = zeros(size(capletMaturity,1),2);
capletVols(:,1) = capletMaturity;
nCaplets = size(capletMaturity,1);
for iCaplet=1:nCaplets
varIntegral = integral(@(x) VolFunc{1}(capletMaturity(iCaplet)-
x).*VolFunc{1}(capletMaturity(iCaplet)-x),0,capletMaturity(iCaplet));
capletVols(iCaplet,2) = sqrt(varIntegral/capletMaturity(iCaplet));
end
capletVols
7. MATLAB scripts to test pricing β Swaptions
clear all;
close all;
clc;
Settle = datenum('11-Aug-2004');
% Zero Curve
CurveTimes = (1:10)';
CurveDates = daysadd(Settle,360*CurveTimes,1);
ZeroRates = [0.03 0.033 0.036 0.038 0.04 0.042 0.043 0.044 0.045
0.046]';
% Construct an IRCurve
irdc = IRDataCurve('Zero',Settle,CurveDates,ZeroRates);
LMMVolFunc = @(a,t) (a(1)*t + a(2)).*exp(-a(3)*t) + a(4);
LMMVolParams = [.3 -.02 .7 .14];
38
numRates = length(ZeroRates);
VolFunc(1:numRates-1) = {@(t) LMMVolFunc(LMMVolParams,t)};
Beta = 0;
CorrFunc = @(i,j,Beta) exp(-Beta*abs(i-j));
CorrMat = CorrFunc(meshgrid(1:numRates-1)',meshgrid(1:numRates-
1),Beta);
ExerciseDate = datenum('11-Aug-2009');
Maturity = daysadd(ExerciseDate,360*[3;4],1);
TExercise = yearfrac(Settle,ExerciseDate,1);
Tenor = yearfrac(ExerciseDate,Maturity,1)';
swaptionDisp = zeros(size(TExercise,2)+1,size(Tenor,2)+1);
Vol =
blackvolbyrebonato(irdc,VolFunc,CorrMat,ExerciseDate,Maturity,'Period'
,1)';
swaptionDisp(2:end,1) = TExercise;
swaptionDisp(1,2:end) = Tenor;
swaptionDisp(2:end,2:end) = Vol;
swaptionDisp