SlideShare a Scribd company logo
1 of 38
Download to read offline
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 𝛾(𝑑, 𝑇)
Calendartime
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 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
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 results
Run 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

More Related Content

Similar to LFM Pedersen Calibration - Cappelli

Crude Oil Levy
Crude Oil LevyCrude Oil Levy
Crude Oil LevyMurat Gencer
Β 
Stochastic Vol Forecasting
Stochastic Vol ForecastingStochastic Vol Forecasting
Stochastic Vol ForecastingSwati Mital
Β 
Fuzzy portfolio optimization_Yuxiang Ou
Fuzzy portfolio optimization_Yuxiang OuFuzzy portfolio optimization_Yuxiang Ou
Fuzzy portfolio optimization_Yuxiang OuYuxiang Ou
Β 
solver (1)
solver (1)solver (1)
solver (1)Raj Mitra
Β 
Playing with the Rubik cube: Principal Component Analysis Solving the Close E...
Playing with the Rubik cube: Principal Component Analysis Solving the Close E...Playing with the Rubik cube: Principal Component Analysis Solving the Close E...
Playing with the Rubik cube: Principal Component Analysis Solving the Close E...Ismael Torres-Pizarro, PhD, PE, Esq.
Β 
Affine cascade models for term structure dynamics of sovereign yield curves
Affine cascade models for term structure dynamics of sovereign yield curvesAffine cascade models for term structure dynamics of sovereign yield curves
Affine cascade models for term structure dynamics of sovereign yield curvesLAURAMICHAELA
Β 
Principal component analysis in modelling
Principal component analysis in modellingPrincipal component analysis in modelling
Principal component analysis in modellingharvcap
Β 
CFM Challenge - Course Project
CFM Challenge - Course ProjectCFM Challenge - Course Project
CFM Challenge - Course ProjectKhalilBergaoui
Β 
2. Module II (1) FRM.pdf
2. Module II (1) FRM.pdf2. Module II (1) FRM.pdf
2. Module II (1) FRM.pdfItzGA
Β 
Time series modelling arima-arch
Time series modelling  arima-archTime series modelling  arima-arch
Time series modelling arima-archjeevan solaskar
Β 
Trading and managing volatility surface risks_Axpo Risk Management Workshop_2...
Trading and managing volatility surface risks_Axpo Risk Management Workshop_2...Trading and managing volatility surface risks_Axpo Risk Management Workshop_2...
Trading and managing volatility surface risks_Axpo Risk Management Workshop_2...Stian J. FrΓΈiland
Β 
PATTEM JAGADESH_21mt0269_research proposal presentation.pptx
PATTEM JAGADESH_21mt0269_research proposal presentation.pptxPATTEM JAGADESH_21mt0269_research proposal presentation.pptx
PATTEM JAGADESH_21mt0269_research proposal presentation.pptxPATTEMJAGADESH
Β 
7_Analysing and Interpreting the Yield Curve.ppt
7_Analysing and Interpreting the Yield Curve.ppt7_Analysing and Interpreting the Yield Curve.ppt
7_Analysing and Interpreting the Yield Curve.pptMurat Γ–ztΓΌrkmen
Β 
Asian basket options
Asian basket optionsAsian basket options
Asian basket optionsVictor Bontemps
Β 
Express measurement of market volatility using ergodicity concept
Express measurement of market volatility using ergodicity conceptExpress measurement of market volatility using ergodicity concept
Express measurement of market volatility using ergodicity conceptJack Sarkissian
Β 
Dr. Syed Muhammad Ali Tirmizi - Special topics in finance lec 4
Dr. Syed Muhammad Ali Tirmizi - Special topics in finance   lec 4Dr. Syed Muhammad Ali Tirmizi - Special topics in finance   lec 4
Dr. Syed Muhammad Ali Tirmizi - Special topics in finance lec 4Dr. Muhammad Ali Tirmizi., Ph.D.
Β 
Industrial engineering sk-mondal
Industrial engineering sk-mondalIndustrial engineering sk-mondal
Industrial engineering sk-mondaljagdeep_jd
Β 

Similar to LFM Pedersen Calibration - Cappelli (20)

The Short-term Swap Rate Models in China
The Short-term Swap Rate Models in ChinaThe Short-term Swap Rate Models in China
The Short-term Swap Rate Models in China
Β 
Crude Oil Levy
Crude Oil LevyCrude Oil Levy
Crude Oil Levy
Β 
Stochastic Vol Forecasting
Stochastic Vol ForecastingStochastic Vol Forecasting
Stochastic Vol Forecasting
Β 
trading
tradingtrading
trading
Β 
Fuzzy portfolio optimization_Yuxiang Ou
Fuzzy portfolio optimization_Yuxiang OuFuzzy portfolio optimization_Yuxiang Ou
Fuzzy portfolio optimization_Yuxiang Ou
Β 
solver (1)
solver (1)solver (1)
solver (1)
Β 
Playing with the Rubik cube: Principal Component Analysis Solving the Close E...
Playing with the Rubik cube: Principal Component Analysis Solving the Close E...Playing with the Rubik cube: Principal Component Analysis Solving the Close E...
Playing with the Rubik cube: Principal Component Analysis Solving the Close E...
Β 
Affine cascade models for term structure dynamics of sovereign yield curves
Affine cascade models for term structure dynamics of sovereign yield curvesAffine cascade models for term structure dynamics of sovereign yield curves
Affine cascade models for term structure dynamics of sovereign yield curves
Β 
Principal component analysis in modelling
Principal component analysis in modellingPrincipal component analysis in modelling
Principal component analysis in modelling
Β 
CFM Challenge - Course Project
CFM Challenge - Course ProjectCFM Challenge - Course Project
CFM Challenge - Course Project
Β 
2. Module II (1) FRM.pdf
2. Module II (1) FRM.pdf2. Module II (1) FRM.pdf
2. Module II (1) FRM.pdf
Β 
20120140503019
2012014050301920120140503019
20120140503019
Β 
Time series modelling arima-arch
Time series modelling  arima-archTime series modelling  arima-arch
Time series modelling arima-arch
Β 
Trading and managing volatility surface risks_Axpo Risk Management Workshop_2...
Trading and managing volatility surface risks_Axpo Risk Management Workshop_2...Trading and managing volatility surface risks_Axpo Risk Management Workshop_2...
Trading and managing volatility surface risks_Axpo Risk Management Workshop_2...
Β 
PATTEM JAGADESH_21mt0269_research proposal presentation.pptx
PATTEM JAGADESH_21mt0269_research proposal presentation.pptxPATTEM JAGADESH_21mt0269_research proposal presentation.pptx
PATTEM JAGADESH_21mt0269_research proposal presentation.pptx
Β 
7_Analysing and Interpreting the Yield Curve.ppt
7_Analysing and Interpreting the Yield Curve.ppt7_Analysing and Interpreting the Yield Curve.ppt
7_Analysing and Interpreting the Yield Curve.ppt
Β 
Asian basket options
Asian basket optionsAsian basket options
Asian basket options
Β 
Express measurement of market volatility using ergodicity concept
Express measurement of market volatility using ergodicity conceptExpress measurement of market volatility using ergodicity concept
Express measurement of market volatility using ergodicity concept
Β 
Dr. Syed Muhammad Ali Tirmizi - Special topics in finance lec 4
Dr. Syed Muhammad Ali Tirmizi - Special topics in finance   lec 4Dr. Syed Muhammad Ali Tirmizi - Special topics in finance   lec 4
Dr. Syed Muhammad Ali Tirmizi - Special topics in finance lec 4
Β 
Industrial engineering sk-mondal
Industrial engineering sk-mondalIndustrial engineering sk-mondal
Industrial engineering sk-mondal
Β 

LFM Pedersen Calibration - Cappelli

  • 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
  • 23. 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. 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. 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
  • 29. 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. 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. 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. 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. 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. 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. 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. 36 Figure 23: Hypothetical Market Calibration Data – AUD Bloomberg Data (22 Oct 2015)
  • 37. 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. 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