38
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 .

LFM Pedersen Calibration - Cappelli

Embed Size (px)

Citation preview

Page 1: LFM Pedersen Calibration - Cappelli

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 𝑇𝑖.

Page 2: LFM Pedersen Calibration - Cappelli

2

2) LFM Calibration task

The benefit of the LFM is that each period forward rate is market observable as derived from zero

coupon bond prices shown above. Furthermore, the formulation leads to closed form pricing for

caps/floors, zero coupon bonds and approximate closed form pricing for swaptions [5]. Calibration is

the process of fitting the covariance structure of the LFM to market prices.

For a choice of tenor length 𝜏𝑖, model horizon 𝑇𝜂𝑓𝑤𝑑, calendar end time 𝑡𝜂𝑐𝑎𝑙

and number of

stochastic factors 𝜂𝑓𝑎𝑐 one parametrises the volatility structure 𝛾𝑖(𝑡) for each forward rate 𝑓𝑖(𝑡) =

𝑓(𝑖, 𝑇𝑖, 𝑇𝑖+1) . Ensuring that the correlation 𝜌𝑖,𝑗 between forward rates of different maturity 𝑓𝑖(𝑡)

and 𝑓𝑗(𝑡) leads to model-generated prices consistent with liquid prices for at-the-money caps and

swaptions.

3) Pedersen’s Approach

Relative volatility grid

Pedersen employs a non-parametric approach to deterministic volatility calibration of the LFM to an

entire swaption matrix.

By discretising calendar time 𝑡 (𝜂𝑐𝑎𝑙indices j) and forward time 𝑇 − 𝑡 (𝜂𝑓𝑤𝑑 indices k) to create a

volatility component for each stochastic model factor (𝜂𝑓𝑎𝑐 indices n) which characterises a

piecewise constant volatility grid for all forward rates.

Each volatility 𝛾𝑛(𝑡 𝑗−1

, 𝑇𝑘−1)is derived from the volatility grid and the correlation matrix via

principal components analysis (PCA).

Figure 2: Piecewise volatility grid decomposed into factor grids via PCA

To reduce dimensionality of the problem, Pedersen assumes the correlation structure (𝜂𝑓𝑤𝑑 x 𝜂𝑓𝑤𝑑)

is constant through time and equal to correlation as seen today (or historical values).

Calibrate to market

This leads us to a high dimensional optimisation problem (𝜂𝑓𝑤𝑑 x 𝜂𝑐𝑎𝑙) to determine volatility

components 𝛾𝑛𝑗𝑘 such that the model reproduces given market prices. To do this we try to minimise

the sum of relative error squared across the present value of all input instruments with respect to

those of the model. It is more desirable to fit to swaptions as a priority and caps where possible.

To obtain sensible and smooth volatility surfaces, Pedersen applies a smoothness measure in both

dimensions of calendar time 𝑡 and forward time 𝑇 − 𝑡.

Forward time

𝑡 𝑗−1

𝑡 𝑗

𝑡 0

𝑥𝑘−1 𝑥𝑘

𝛾𝑛𝑗𝑘

𝑥0

𝑡 𝜼𝒄𝒂𝒍

𝑥𝜂𝑓𝑤𝑑

𝜂𝑓𝑎𝑐 component grids of

volatility grid 𝛾(𝑡, 𝑇)

Cal

end

ar t

ime

PCA on 𝑡 𝑗−1

covariance matrix (volatility grid and correlation matrix)

Page 3: LFM Pedersen Calibration - Cappelli

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].

Page 4: LFM Pedersen Calibration - Cappelli

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.

Page 5: LFM Pedersen Calibration - Cappelli

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

𝛾𝑖(𝑡, 𝑇)

𝑡

Page 6: LFM Pedersen Calibration - Cappelli

6

The correlation matrix will be discretised in the same fashion as the forward rate times for the

volatility grid (see Figure 4). Correlations between forward rates between these times are assumed

constant. The parameters of 𝜌∞, 𝛽and 𝛾 will be specified in each test case.

Figure 4: Volatility grid discretisation used for the hypothetical market testing and calibration example (𝜂𝑓𝑤𝑑 = 7, 𝜂𝑐𝑎𝑙 = 6)

The following sections validate that the implementation is working correctly prior to testing

hypothetical market calibration. Test suite plan below.

Figure 5: Project test suite plan before Market Calibration

Test suite workflow

•In 'pedersenLFMMain.cpp' one can change the source to configure which tests to run.Configure tests

•Re-compile 'PedersenLFMCalibration.vcxproj' VS project file and run program

•Program will output test resultsRun tests

𝑡𝑓𝑤𝑑 = {0,0.25,0.5,1,1.5,2,3,5.5}

𝑡𝑐𝑎𝑙 = {0,0.25,0.5,1,1.5,2,3}

Page 7: LFM Pedersen Calibration - Cappelli

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:

Page 8: LFM Pedersen Calibration - Cappelli

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.

Page 9: LFM Pedersen Calibration - Cappelli

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).

Page 10: LFM Pedersen Calibration - Cappelli

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

Page 11: LFM Pedersen Calibration - Cappelli

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

Page 12: LFM Pedersen Calibration - Cappelli

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

Page 13: LFM Pedersen Calibration - Cappelli

13

difficulty in joint calibration to swaptions and caps using a piecewise grid. As generally seen in

market prices, the derivative of the cap/caplet volatilities are greatest in this region and therefore

there is greater quantisation error. The fit to cap Black Volatilities is almost exact.

Figure 11: Hypothetical Market Calibration – Cap Black Market vols Vs Calibrated model vols (model – market error)

Now that the test suite has passed and calibration on a hypothetical market has shown promising

results, we can move to AUD market data calibration.

5) AUD Market Data Calibration

Calibration workflow

AUD Market data was taken using the UTS Bloomberg Terminal on 22 Oct 2015. Thanks to Igor

Geninson for his assistance.

•Grab market data from access terminal and store in an excel spreadsheet 'AUD Market Data'

•'AUD Swap Curve', 'AUD ATM Swaptions', 'AUD Caps Floors', 'AUD Zero Curve' tabs

Access Market Data

•Run MATLAB function 'LiborCalibrationPreProcess.m'

•Copy output from MATLAB command window into the source file 'pedersenLFMMain.cpp' and set MARKETDATA_CALIBRATION = true in main

Process data and move calibration

inputs

•Re-compile 'PedersenLFMCalibration.vcxproj' VS project file and run program

•Program will output running calibration resultsRun calibration

Page 14: LFM Pedersen Calibration - Cappelli

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}

Page 15: LFM Pedersen Calibration - Cappelli

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.

Page 16: LFM Pedersen Calibration - Cappelli

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

Page 17: LFM Pedersen Calibration - Cappelli

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

Page 18: LFM Pedersen Calibration - Cappelli

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)

Page 19: LFM Pedersen Calibration - Cappelli

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

Page 20: LFM Pedersen Calibration - Cappelli

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)

Page 21: LFM Pedersen Calibration - Cappelli

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.

Page 22: LFM Pedersen Calibration - Cappelli

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

Page 23: LFM Pedersen Calibration - Cappelli

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

Page 24: LFM Pedersen Calibration - Cappelli

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

Page 25: LFM Pedersen Calibration - Cappelli

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

Page 26: LFM Pedersen Calibration - Cappelli

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

Page 27: LFM Pedersen Calibration - Cappelli

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

Page 28: LFM Pedersen Calibration - Cappelli

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

Page 29: LFM Pedersen Calibration - Cappelli

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

Page 30: LFM Pedersen Calibration - Cappelli

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

Page 31: LFM Pedersen Calibration - Cappelli

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

Page 32: LFM Pedersen Calibration - Cappelli

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

Page 33: LFM Pedersen Calibration - Cappelli

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

Page 34: LFM Pedersen Calibration - Cappelli

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

Page 35: LFM Pedersen Calibration - Cappelli

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

Page 36: LFM Pedersen Calibration - Cappelli

36

Figure 23: Hypothetical Market Calibration Data – AUD Bloomberg Data (22 Oct 2015)

Page 37: LFM Pedersen Calibration - Cappelli

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];

Page 38: LFM Pedersen Calibration - Cappelli

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