Suli Balazs Marton
Suli Balazs Marton
Suli Balazs Marton
Faculty of Science
Supervisors:
Budapest, 2014
.
Contents
1 Introduction 5
1.1 Fixed Income Securities . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.2 Yield Curve . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.3 No-arbitrage Condition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.4 Dierent Types of Curves . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
4 Additional Features 35
4.1 Corporate Bond Valuation using Credit Spread . . . . . . . . . . . . . . . 35
4.2 Pricing with CDS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
4.3 Corporate Bond Spreads . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
4.4 Liquidity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
5 Applications 42
5.1 Data Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
5.2 Modeling in Python . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
5.3 The results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
CONTENTS CONTENTS
6 Summary 51
7 Appendix 52
7.1 Appendix 1: An example of B-splines . . . . . . . . . . . . . . . . . . . . . 52
4
1 INTRODUCTION
1 Introduction
The main topic of this thesis is yield curve modeling. I have tried to collect the most
relevant information on that but still not to exceed the limits of an MSc thesis. The idea
of a thesis about yield curve modeling has come from the swiss Solvency Analytics group.
Reliable yield curve models can be very useful when calculating sensitivites and capital
charges of corporate bonds within the Solvency II framework. For the thesis to be useful
for Solvency Analytics, I have focused mostly on corporate bonds and I have chosen to
write it in English.
The rst few pages of the thesis is concentrated on concepts such as xed income
securities, risks aecting them, corporate bonds, YTM, zero-coupon yield curve, discount
curve, forward curve and no-arbitrage. After those the concepts of discount function and
instantenous forward rates are introduced. The next section of the thesis is about one
factor short rate models. After a general description of these types of interest rate models
two popular models are introduced: the Vasicek and Cox-Ingersoll-Ross models. In this
section, I have relied on the knowledge I have learned at the university lectures of Dr.
Gyrgy Michaletzky [1] and I used similar notations. The Statistical Yield Curve Mod-
els section presents some methods to model the yield curve based on observable market
prices and bond properties. It starts with a method called Coupon Stripping and after
that other types of yield curve models follow such as polynomial or spline-based models
and Nelson-Siegel type curves. I have relied on two books mostly: Handbook of Fixed
Income Securities [2] and Interest Rate Modelling [3]. The Additional Features section
presents some alternative but still popular ways to model the yield curve. They can be
very useful when the construction of statistical yield curve models are not possible. The
last section, Applied Methods summarizes the numerical implementations I have written
to be able to t some models to real data. I have focused on the polynomial and spline
estimation models here and presented some outputs of the apllications.
5
1.1 Fixed Income Securities 1 INTRODUCTION
6
1.2 Yield Curve 1 INTRODUCTION
extra risk beared by the investor is compensated with an increased return on the invest-
ment usually. Another distinction between governmental bonds and corporate bonds is
that corporate bonds usually contain additional features like convertibility or embedded
options, and are often less liquid than governmentals. These make the modelling of cor-
porate bonds harder mathematically, and less accurate models can be expected, than in
the case of governmentals. But as more and more complex nancial products arise, math-
ematical models become more and more sophisticated, trying to nd a solution for actual
nancial problems.
According to this equation, the YTM can be calculated every time the cash ow
pattern and the current market value of a security is known. Yield-to-maturity is an
easily computable, but not too sophisticated measure of a bond's yield. It assumes that
every cash ow is discounted with the same rate, which is not a realistic approach. In
practice cash ows further in time carry more risks, and usually should be discounted
with a larger discount rate than the closer ones. This is why the zero-coupon yield curve
is so important in the eld of modelling xed income securities.
7
1.3 No-arbitrage Condition 1 INTRODUCTION
For a zero-coupon bond the computation of the yield is more simple. Let PZ be the
current market price of the zero-coupon bond, and the only one cash ow it contains is
$100, t years from now. Then the eective yield (rE ) of this product comes from:
100
PZ =
(1 + rE )t
PZ = 100erC t
The zero coupon yield curve refers to the illustration of zero-coupon yields of dierent
maturities in a given nancial market. This is one of the most important tools when
modelling xed income securities.
8
1.4 Dierent Types of Curves 1 INTRODUCTION
reality accurately. Now, suppose that in a mathematical model of a nancial market, the
zero coupon yield curve is known. Let r(t) be the compounded yield of a zero coupon
bond maturing in t years for every t > 0. In this model, a coupon bond with known cash
ow properties can only have one specic price. With the use of the yield curve this price
can easily be determined. Assume that bond B has Ci cash ows at times ti . Then PB ,
the theoretical price of bond B is dened as:
X
PB = Ci er(ti )ti
i
This equation exhibits a strong relationship between the theoretical yield curve of a model,
and the prices of securities in the nancial market. If the market price of B diers from PB
an arbitrage opportunity arises in the model and that is inconsistent with the no-arbitrage
condition. It is important to mention that in practice, there is an error associated with
market prices and so there will always be a small dierence between the theoretical price
and the market price. The model is estimated usually by somehow minimizing these errors.
As shown, the knowledge of the yield curve is crucially important when pricing secu-
rities but it is an abstract concept. To have a model that describes reality well the yield
curve should be approximated with the use of market prices of securities in a market.
The starting set of securities of this approximation is very important. If one wants to
use the information provided by the yield curve, for example to anticipate the price of a
bond waiting to be issued, it is crucial that the curve is typical of that type of bond. The
estimation should start from similar type of products. Since the yield curve represents
a relationship between maturity and return, the types of risks (other than interest-rate
risk) should be considered when collecting the starting set of bonds.
9
1.4 Dierent Types of Curves 1 INTRODUCTION
(if a year is the time unit one wants to use). The yield of a zero-coupon bond maturing in
t years is written as r(t). The term structure of these are called the spot or zero-coupon
yield curve or shortly yield curve. The forward rates express the market's expectations of
interest rates in the future. On an investment beginning at time t and ending at time T
(where t < T ) the market expects a yield equal to f (t, T ).
The following relationships stand among these three rates. If the spot rates are known,
the discount rates can be calculated as:
d(t) = er(t)t
and conversely:
log d(t)
r(t) = . (1)
t
The forward rate can be obtained from the spot rates with the use of:
T r(T ) tr(t)
f (t, T ) = (2)
T t
The conversion between the discount rates and the forward rates can be easily obtained
using the spot curve and the mentioned equations.
There is one more curve of importance when describing the term structure of interest
rates and that is the instantenous forward rate curve. The forward rates mentioned before
needed two parameters: the beginning of an investment t and the end T . If the spot yield
curve is dierentiable it is possible to dene the instantenous forward rate: f (t). The
instantenous forward rates represent the expected yield of an investment beginning at t
and ending in t + t when t 0. It describes the present market expectations of the
10
1.4 Dierent Types of Curves 1 INTRODUCTION
evolution of future short rates. Using equation (2), f (t) can be expressed as:
In some yield curve models it is better to estimate the instantenous forward rate curve
and the spot and discount curves can be calculated from it.
11
2 INTEREST RATE MODELLING
In this equation a(t) and b(t) are time-dependent coecients of the stochastic process,
and W (t) is a Wiener-process under the risk-neutral measure.
There is an other interest-rate process in this model and that is the forward rate. The
forward rate is the expected (annualized and compounded) instantenous interest rate of
time T , at time t. Of course T must be higher or equal than t. In the model the forward
rate is a stochastic process with two time parameters:
Here the (t, T ) and (t, T ) coecients are the functions of two time parameters.
The short rate model also incorporates two value processes of nancial products. One
of them is the value process of a zero coupon bond. For convenience the face value of
12
2.2 Connections 2 INTEREST RATE MODELLING
this zero coupon bond is set to be $1. Let's consider a $1 zero coupon bond maturing at
time T . The value of this bond at time t is denoted by P (t, T ). Since the values of bonds
depend on the level of interest rates and expectations of these, the evolution of P (t, T ) is
also described with a stochastic process in the model:
Here the m(t, T ) and v(t, T ) coecients are functions of two time dependent parameters.
It is important to mention that this mathematical model presumes that there is a bond
maturing at every time t.
Another participant in this model is the value of a bank deposit B(t). In opposite of
the bond where present value is derived from a future cash ow, the bank deposit's value
origins from the past. Bank deposits pay the timely short interest rate at every time t
and are doing it compoundedly. That's why the evolution of the value of a bank deposit
depends on the evolution of the short rate. The connection between the two is:
dB(t) = r(t)B(t)dt
2.2 Connections
There are certain connections between these processes. From Equation (4) it is appar-
ent that with the knowledge of B(0) the short rate process determines the value process
of the bank deposit. There is a connection between the value of the bond and the forward
rate process. The present value of a bond should be the discounted value of the future
cash ow. At time t the expectations of future interest rate levels are the f (t, s) values
13
2.2 Connections 2 INTEREST RATE MODELLING
where s is larger or equal than t. A fair valuation of the bond in this model should be:
RT
P (t, T ) = e t f (t,s)ds
(5)
This is the appropriate value here as the expected future value of a bank deposit of size
P (t, T ) at time t is exactly one dollar at time T :
RT RT
Bexp (T ) = B(t)e t f (t,s)ds
= P (t, T )e t f (t,s)ds
= e0 = 1
f (t, T ) = ln P (t, T )
T
Using these strong connections between these two processes the knowledge of one of them
results that the other one can be expressed too. Assuming that the forward rate is known
in the form presented in Equation (3), so the coecient functions (t, T ) and (t, T )
are known. It can be shown that the coecients of the bond value's process m(t, T ) and
v(t, T ) can be expressed using (t, T ) and (t, T ) functions as follows:
1 2
m(t, T ) = f (t, t)
(t, T ) + (t, T )
2
and
v(t, T ) =
(t, T )
The (t, T ) and (t, T ) functions are integrals of (t, T ) and (t, T ):
Z T
(s, T ) = (s, u)du
s
and Z T
(s, T ) = (s, u)du
s
14
2.2 Connections 2 INTEREST RATE MODELLING
This denes the coecients of the bond's value process perfectly. The other way of ex-
pressing one from the other is also available. Assume that the stochastic process of the
bond value is known, so the coecient functions m(t, T ) and v(t, T ) are known. Using
this information and the connection between the two processes, the coecients (t, T )
and (t, T ) of the forward rate can be expressed:
and
(t, T ) = vT (t, T ),
where:
mT (t, T ) = m(t, T )
T
and
vT (t, T ) = v(t, T ).
T
These equations dene a two-way connection between the bond value process and the
forward rate process.
Now let's consider the short rate process and its possibilities. It can be shown that
assuming the knowledge of the forward rate's evolution the short rate process can be ex-
pressed. The short rate process's a(t) and b(t) coecient functions take the following form:
Z t Z t
a(t) = (t, t) + T (s, t)ds + fT (0, t) + T (s, t)dW (s)
0 0
and
b(t) = (t, t)
In these expressions the T in the lower corner means the function's derivative by its sec-
ond variable similarly to mT (t, T ) and vt (t, T ) mentioned above.
15
2.3 Two Popular Short Rate Models 2 INTEREST RATE MODELLING
But what if one knows the short rate process and wants to express the forward rate from
that? It is provable that it's impossible to derive the forward rate or bond value processes
merely from the knowledge of the short rate process only, because an equivalent martingale
measure can't be obtained. The forward process contains an additional information and
that is the market's expectations of the future. It is needed to observe the market prices
of bonds and nd the appropriate market price of risk process, to be able to derive the
forward rate process and the bond value from the short rate.
CIR: The Cox-Ingersoll-Ross model constructs the short rate process from the sum
of squared, independent Ornstein-Uhlenbeck processes [13] . This way the result is a
non-negative stochastic process. Let us begin from the Ornstein-Uhlenbeck processes:
X1 , X2 , . . . , Xd for a positive integer d. Each of them can be described as:
dXj (t) = Xj (t)dt + dWj (t),
2 2
16
2.4 Yield Curve Calibrating 2 INTEREST RATE MODELLING
where the following stand: > 0, > 0 and Wj (t)-s are independent Wiener-processes.
Now the short rate process is:
d
X
r(t) = Xj2 (t)
j=1
where
2
=d
4
and
d
X X (t)
dW (t) = pj dWj (t).
j=1 r(t)
17
2.4 Yield Curve Calibrating 2 INTEREST RATE MODELLING
It is easy to see that with the knowledge of the parameters of the model (k, and
) and r(0) the discount function can be constructed. Also the zero-coupon yield curve,
which is denoted by z(t) can be computed from the discount function easily. It takes the
following parametric form:
k t 2 1 t 2
z(t) = r(0)et e 1 e 1
2 2
This is a combination of et and e2t functions of time. With the three parameters of
r(t) it isn't always possible to match the shape of current yield curves. This is a short-
coming of the Vasicek-model and other parametric one-factor short rate models. If one
wants an interest rate model that can match the actual observable yield curves some im-
provements has to be made.
where k(t) is an arbitrary deterministic function of time, and and are positive con-
stants. Deriving the actual zero coupon yield curve from this model results in:
t
2 1 t
Z
t
2
z2 (t) = r(0)e + k(u)e(tu) du + e 1
0 2 2
It is possible to nd a k(t) function that is appropriate in a sense, that the z2 (t) function
18
2.4 Yield Curve Calibrating 2 INTEREST RATE MODELLING
of the interest rate model will match the market zero coupon yield curve, derived from
observable prices of bonds.
A general method of calibrating interest rate models to market yield curves can be
shown through the CIR-model. Let z(t) be a process that is used for modelling short rate
dynamics in a CIR model:
p
dz(t) = z(t) dt + z(t)dW (t)
The short rate process now is a sum of z(t) and a deterministic function y(t):
This approach is suitable to other kinds of short rate models as well. The types of yield
curve models that can be derived from interest rate models, like the ones mentioned above
called consistent. The need for model consistency depends on the goal of the modelling. In
some cases it is very important to be consistent with an interest rate model, while there
are other cases as well where other features are more desirable. The following section
introduces models where consistency isn't among the main requirements.
19
3 STATISTICAL YIELD CURVE MODELS
Let's consider an example just to illustrate the method. Assume that we look at 10
bonds in the market with market prices Pi and annual coupon payments of size Ci and
the i-th bond matures i years from now:
i 1 2 3 4 5 6 7 8 9 10
Ci 4 7 3.5 4.25 2 7 6.5 3 4.5 3.25
Pi 101.74 107.01 98.5 99.68 87.93 108.89 101.6 76.71 83.36 72.18
20
3.1 Coupon Stripping 3 STATISTICAL YIELD CURVE MODELS
The goal is to estimate the discount function's value at bond maturity dates. The rst
step uses the rst period only. The discount function's value is:
P1 101.74
d(1) = = = 0.98
100 + C1 104
The next step uses the value resulted from the step before and the next bond's properties.
P2 C2 d(1) 100.15
d(2) = = = 0.94
100 + C2 107
Following this method every new discount factor can be calculated with the properties of
the bond maturing at that date and the past discount factor values:
Pn1
Pn i=1 Cn d(i)
d(n) =
100 + Cn
d(1) d(2) d(3) d(4) d(5) d(6) d(7) d(8) d(9) d(10)
0.98 0.94 0.87 0.84 0.79 0.73 0.64 0.58 0.52 0.48
It is useful to set d(0) as 1 because the present value of money available now is its
face value.
With a linear algebraic approach the coupon stripping method can be presented as fol-
lows. Let P be the vector of coupon bond prices maturing on dierent incremental dates:
ti i {1, . . . , n} and C be the cash-ow matrix such as C(i, j) denotes the i-th bond's
cashow on date tj . From now on C(i, j) is denoted by Ci (tj ) for convenience. C is a
square matrix due to the restrictions on the dataset. The discount factors on each ti date
are denoted by d(ti ) and D = (d(t1 ), . . . , d(tn )) is a vector comprised of them.
21
3.2 Interpolation 3 STATISTICAL YIELD CURVE MODELS
In an arbitrage-free solution the bonds' prices should be equal to the discounted present
values of their cash ows, so
should stand for every i {1, . . . , n}. Now by solving the CD = P linear system D is
obtained and so the discount values on the dened ti dates.
As it was mentioned before this approach is mostly theoretical and rarely used in
practice. One of the main problems is that a starting set of information as it is required
for the Coupon Stripping method is very unrealistic in practice. There is rarely available
a representative set of similar type of bonds maturing exactly one years (or any other
given period) from each other in the market.
3.2 Interpolation
To have a discount value for every t in a time interval, one can consider the discount
curve linear between the dates where it's values are known. With this a continuous but
not smooth (in most cases the rst derivative is not continuous) yield curve is estimated.
Another way to t a continuous curve onto the points known can be using polynomial
approximation techniques. In spite of the fact that a perfect t on the vertices can be
obtained by a polynomial function with the use of Lagrange approximation, it is not
suitable in practical use. Although the estimated curve is innitely dierentiable and
connects the points this approach doesn't result in realistic yield curves. This is because
between the initial points and usually on the short and long ends of the time interval very
unrealistic shapes can occur.
Figure 1 shows the discount factor values obtained by the coupon stripping method
example before. The dark blue marks represent the estimated discrete discount factor
values. The dark blue line is a linear interpolation while the light blue is a Lagrange
polynomial interpolation. It can be seen that the Lagrange interpolation results in some
extra curvatures at both ends of the sample.
22
3.2 Interpolation 3 STATISTICAL YIELD CURVE MODELS
While the dierence between the two interpolation method is not that big in the case
of the discount function, when computing the spot yield curve it becomes much more
signicant. The spot yield cuve is computed from the values of the discount curve using
the connection mentioned in Equation (1). Figure 2 shows the resulting curves. The dark
blue marks represent the yields computed from the original results of the coupon strip-
ping. The dark blue is the yield curve estimated from the linearry interpolated discount
function while the light blue is the one derived from the Lagrange interpolated discount
function.
23
3.2 Interpolation 3 STATISTICAL YIELD CURVE MODELS
The instantenous forward curve approximation derived from the spot yield curve is pre-
sented in Figure 3. This curve is computed by dividing the time interval between every
year into ten equal small intervals. Then using Equation (2) to calculate f (ti ) as:
for every i {0, 1, . . . , 99} where this represents the new time lattice.
Because of the absence of a continuous rst derivative in the case of linear interpola-
tion, this approximation of the instantenous forward curve becomes very ragged as shown
in Figure 3 . It is a good example of why a smooth curve is required. While the forward
curve computed from the Lagrange-interpolation is smooth, it has apparently too much
curvature which makes the results unrealistic.
24
3.3 Including Errors 3 STATISTICAL YIELD CURVE MODELS
where ei refers to the error term, the dierence between the theoretical and quoted market
price of the i-th bond. This approach results in more realistic models of the yield curve
but requires more sophisticated estimation methods.
25
3.3 Including Errors 3 STATISTICAL YIELD CURVE MODELS
Suppose a set of coupon bond prices and properties are known, now without the re-
strictions stated before. Let P be the vector comprised of the market prices of the bonds,
C(i, j) the cashow matrix and D the vector of the discount values. In the Coupon Strip-
ping case the cashow matrix is a squared matrix due to the strict initial conditions.
Without those restrictions C has usually much more columns than rows and has a lot
of zero values. Let be the vector of the ei error terms as mentioned above. Now the
following holds:
P = CD +
One way to estimate D is by minimizing the error terms. Without any other restrictions
on D this can be done by Ordinary Least Squares (OLS) estimation. The task is to nd
D where
D = min T | = P CD
D
D = (C T C)1 C T P
It is important to mention that C T C is not always an invertible matrix, but with the
use of a pseudo-inverse this problem is solvable. Although this is an elegant approach in
theory, it is not a good choice in practice. Even with carefully chosen starting data very
unrealistic shapes can occur as a result if one wants to somehow produce a continuous
function out of the estimated values. This method doesn't place any restrictions on the
d(t) function and it is a source of some problems. One of them is that estimated values on
similar maturities often don't have similar values which results in a ragged curve. That is
not realistic at all.
26
3.4 Parameterised Curves 3 STATISTICAL YIELD CURVE MODELS
D =
P = CD +
27
3.5 Polynomial Estimation 3 STATISTICAL YIELD CURVE MODELS
D
b = C, (8)
P = D
b + (9)
The solution can be easily obtained with the use of OLS regression by minimalizing T .
It is:
= (D b 1 D
b T D) bT P (10)
Once the vector of the i coecients are estimated, the discount function, d(t) can be
obtained with the use of Equation (7) .
28
3.6 Spline Yield Curve Models 3 STATISTICAL YIELD CURVE MODELS
they are not the best choice most of the times. A more appropriate model is spline
approximation.
In this denition the lower index i refers to the i-th basis spline available for denition
on the set of knot points in an incremental order. Starting from the basis spilnes of order
zero, it is possible to dene B-splines of higher order recursively:
t Pi Pi+m+1 t
Bm,i (t) = Bm1,i (t) + Bm1,i+1 (t),
Pi+m Pi Pi+m+1 Pi+1
where the lower index m refers to the order (also called degree) of the spline.
Bm,i (t) is a spline function of order m that is zero outside the [Pi , Pi+m ] interval. Be-
cause of these on a set of n knot points n m 1 basis splines of order m are available.
29
3.6 Spline Yield Curve Models 3 STATISTICAL YIELD CURVE MODELS
As mentioned every m-th degree spline with n knot points on a closed interval needs
n + m 1 parameters to be determined. So for example a cubic spline with knot points
{P1 , . . . , Pn } needs n + 2 parameters and so n + 2 basis functions to determine the spline.
There are n 4 B-splines that belong to the knot points so there are 6 more basis func-
tions required. To get those 6 more `out of interval' knot points should be dened such
as: P2 < P1 < P0 < P1 < < Pn < Pn+1 < Pn+2 < Pn+3 . This new set of knot
points determines n + 2 B-splines. Now the basis can be this n + 2 basis splines restricted
to the interval [P0 , Pn ]. The d(t) discount function can be expressed now as the linear
combination of the basis functions:
n1
X
d(t) = i B3,i (t)
i=2
D = B
Now denoting D
b = CB and minimizing the term T using OLS techniques, the solution is:
= (D b 1 D
b T D) bT P
30
3.7 Smoothing Conditions 3 STATISTICAL YIELD CURVE MODELS
and set w = 1, the constraint becomes the following additional requirement in the prob-
lem:
W = w
= min T = P D,
b W = w
= (D b 1 W T (W (D
b T D) b 1 W T )1 (W w).
b T D)
The results of spline methods like these rely heavily on the selection of the knot points.
One suggestion made in the literature is to try to position the knot points so there are
similar number of observations between them. This produces better ts or more realistic
curves usually but sometimes there are exceptions when it is better to try an other starting
set of knot points.
c1 = (P CB T )2
31
3.7 Smoothing Conditions 3 STATISTICAL YIELD CURVE MODELS
This c1 term refers to the goodness-of-t of the curve only in consideration of the distance
between the tted curve and the observed prices. A smaller c1 value means the observed
values are closer to the tted curve. On one hand this a desirable property but on the
other hand it can carry some adverse eects on other important properties of the yield
curve such as smoothness. It is showed by Daz and Skinner that signicant liquidity and
tax induced errors occur when modelling corporate yield curves compared to Treasury
yield curve models [9]. The universe of corporate bonds are less heterogenous by nature
than governmentals. Sometimes it is better to have a yield curve with less curvature than
to try to overt the values. It can be reasonable to use some further criterion that controls
the smoothness of the estimated curve. These are called Smoothing Criterions and there
are several dierent ones. The total curvature of an estimated d(t) curve between P0 and
Pn can be measured as:
Z Pn m1 d(t) 2
c2 = dt
P0 tm1
m1 d(t) m1 d(t)
= =0
tm1 P0 tm1 Pn
This criterion minimizes the curvature of a t while keeping c1 's value under S . A big-
ger S value places more importance on smoothness and less on the close t of the values
while a smaller S emphasizes the t more. The solution of the natural smoothing criterion
problem is a (2m 3)-th order natural spline with knots at the data points. That is why
it is called the natural smoothing criterion.
Fisher, Nychka and Zervos's studies show that better ts can occur if the forward rate
curve's curvature is restricted and not the discount function's [4]. The following is the
32
3.8 Non-linear Models 3 STATISTICAL YIELD CURVE MODELS
where h is an invertible function of the yield curve, is the set of knot points: =
(P3 , P2 , . . . , Pn+3 ) and is called the smoothing parameter. Now it is possible to use
the curvature for example of the yield curve, the forward rate curve or the discount curve
as a basis for the approximation. carries the relative importance between the curvature
and the t in this approach. A large lays more weight on the rst part of the criterion.
An extension is to let vary by time. This method was proposed by Waggoner [11]. It
can be reasonable since yield curves usually have much more curvature in the short end
than in the long. Using the time-varying parameter, the criterion becomes:
Z T 2
2 h(t|, )
c3 = (t) 2.
dt + (P Cd(t|, ))
0 t2
f (t) = 0 + (1 + 2 t)ekt
From this expression of the forward rate curve the spot curve can be written as:
33
3.8 Non-linear Models 3 STATISTICAL YIELD CURVE MODELS
2 1 ekt 2 kt
r(t) = 0 + 1 + e .
k kt k
The short rate r(0) equals 0 + 1 and the long rate is limtinf r(t) = 0 . The other two
parameters 2 and k can adjust the height and location of a hump in the curve.
An extension of the original Nelson-Siegel model is the Svensson model. It is sometimes
called Nelson-Siegel-Svensson model since it is the original model with two more param-
eters:
Wiseman [12] introduced a 2(n + 1) parameter model to estimate the forward curve. It
consists of n + 1 exponential decay terms with i coecients:
n
X
f (t) = i eki t
i=0
34
4 ADDITIONAL FEATURES
4 Additional Features
4.1 Corporate Bond Valuation using Credit Spread
There was a very important criterion of the statistical yield curve models of the pre-
vious section and that is the availability of data. All of the models are based on the
information a carefully gathered dataset of similar bonds contain. If for example one
wants to obtain a yield curve to use for pricing a bond, the starting set of information
should consist of other bonds with similar credit risk, liquidity, currency and country of
the bond that ought to be priced. That way the resulting yield curve provides a useful
tool for pricing the bond. If the information basis of the model is not chosen well it will
not provide an appropriate tool for valuation. But what if there aren't enough observable
information or simply there aren't enough time and resources to use a statistical yield
curve model? Situations can occur where only a quick valuation is needed and there isn't
enough time to carefully select the best datasets and precisely adjust statistical models.
And it can also happen that there is too little information available on a nancial product
or issuer company. There are ways to estimate a yield curve and to evaluate a security
without the need to construct statistical yield curve models.
The second most important type of risk aecting xed income securities is credit
risk (after interest-rate risk). Credit risk, more importantly the perceived credit risk of
investors, is an important factor that shapes the yield curve and aects the price of
a security aected by credit risk. When a company's perceived credit risk grows, that
means investors think that default is more probable than before. Investors can analyze
individually the credit risk of a company but the vast majority relies on the opinion
of big credit rating agencies. The biggest three are Standard and Poor's, Moody's and
Fitch Group. If a company becomes downgraded by one of these companies, it means its
creditworthiness has worsened and this implies that a larger yield margin is expected by
investors to buy the bonds' of that company. Skinner and Daz (2001) showed that it is
reasonable to pool bonds by broad rating agency categories when constructing statistical
yield curve models. Doing this doesn't aect the results signicantly in a bad way. They
also found that corporate yield curve models contain signicant liquidity and tax-induced
errors and thus they are less reliable than Treasury yield curve estimates. [9]
There are some rates in the markets considered (credit) risk-free. The U.S. Treasuries's
35
4.2 Pricing with CDS 4 ADDITIONAL FEATURES
yields as well as the LIBOR swap rates are usually the most popular when referring to risk
free rates. They contain nearly zero credit risk and that's why they are usually used as
benchmark rates. A not too precise approach is that corporate bonds dier from risk free
securities like U.S. Treasuries only in their perceived credit risk. Of course it is not true
since for example the U.S. Treasuries are usually much more liquid products than some
corporate bonds, but this approach can provide an easy and quick way with relatively
good results when estimating a yield curve or pricing products. If credit risk is the only
dierence in a model from the risk-free securities it is reasonable to use the risk-free yield
curve as a starting point and to transform it somehow to cope with the extra credit risk. A
big advantage of this approach is that precise statistical yield curves for risk-free interest
rates like U.S. Treasuries or LIBOR swap rates are usually available. Now one only has
to use some transformations to take in account the credit risk. One of the easiest ways is
to use a paralell shift of the original risk free curve of to get the yield curve of the credit
risky product. The dierence between the yield of a credit risky product and a risk-free
product of the same maturity is called credit spread.
36
4.2 Pricing with CDS 4 ADDITIONAL FEATURES
The periodical payments (usually annual or semiannual) the buyer pays to the seller
is computed using the face value and the credit default swap spread (or CDS rate):
PCDS = F V CDSspread
Here PCDS refers to the annual cost of the CDS, F V denotes Face Value and CDSspread
is the credit default swap spread. The CDS spread of CDS rate is the factor that contains
the perceived credit risk of the company by the market. If market participants think a
company is becoming more credit risky the CDS rate rises while the opposite happens if
the company becomes more stable in the eyes of the public.
Credit Default Swaps have a maturity also. That is the time horizon when the contract
holds. Until maturity the buyer will pay the payments to the seller and the seller provide
security. The only case the contract terminates before maturity is a credit event. If that
occurs the buyer doesn't have to continue paying the periodical payments. CDS spreads
can be dierent on dierent time horizons and this way there is a time structure of
CDS spreads too. While it looks obvious that companies with lower credit ratings usually
have higher CDS spreads the relation between CDS maturity and the spread of the same
company is not that easy to see. Research on Eurobonds and domestic bonds from EU-
countries shows that the amount of the spread and maturity have a positive relationship
in the case of investment grade debt. [6]
Bond pricing with the use of CDS rates relies on no arbitrage considerations. If an
investor buys a bond and a CDS with maturity equal to the bond's maturity and face value
equal to the bond's face value this portfolio theoretically becomes a risk-free portfolio.
Then this portfolio should have a return equal to the return on a risk-free product with
the same maturity. Otherwise arbitrage opportunities would arise as the arbitrageur buys
the cheaper product and sells the more expensive contemporarily.
37
4.3 Corporate Bond Spreads 4 ADDITIONAL FEATURES
Figure 4: An example of the risk-free yield curve, the credit spread and the yield curve
aected by credit risk as the sum of the rst two.
38
4.4 Liquidity 4 ADDITIONAL FEATURES
example is a bond of the same company or a very similar company (same size, geopraphical
region, market sector, management stlye, leverage...etc.). Now the credit spread of this
bond can be derived from the market price, risk-free yield curve and properties of that
bond. The credit spread will be the value the risk-free yield curve should be shifted with
in order to reproduce the observable market price. It is a parallel shift of the risk-free
yield curve upwards. If CS denotes the credit spread, rf (t) is the risk-free interest rate,
Pc is the market price of the coupon bond that matures n years from now and pays $C
coupon annually and a principal of $100 at maturity, the following stands:
n
X
Pc = Ce(r(t)+CS)t + 100e(r(n)+CS)n
t=1
If the credit spread is obtained this way, it can be used to construct the yield curve
and price of the product where it is needed. The yield curve can be constructed two ways.
One of them is to simply use a paralell shift similar to the computed credit spread on the
risk-free curve. It is a quick and easy way to have a new yield curve that can be used to
price the product. The other way is to estimate a time structure of credit spreads and then
add this to the risk-free yield curve. The time structure can be obtained by evaluating
bond spreads on dierent maturities. Of course one should start the process from similar
type of bonds in credit properties.
4.4 Liquidity
An other important factor that aects the prices and yields of nancial products is
liquidity. There are dierent denitions and measures of liquidity. Generally a highly
traded product is called liquid. Liquid products are easy to buy and easy to sell in short
period of time without the deterioration of their value. They can be converted to cash
quickly. Illiquid products cannot be sold quickly without some waste in their value. In
stock markets one way to measure liquidity is observing the bid-ask spread of a product.
A relatively big spread means a smaller incoming cashow when one wants to sell the
product quickly so it is considered illiquid while a small spread refers to a liquid product.
Liquidity carries an extra value for investors. Illiquid products usually have higher
yields than liquid ones for compensation. U.S. Treasuries are one of the most liquid -
nancial products available so they are usually used as a benchmark for valuation. Even
39
4.4 Liquidity 4 ADDITIONAL FEATURES
among Treasuries liquidity carries an extra value, this causes the slight dierence between
the yield to maturities of on-the-run and o-the-run treasuries. The most lately issued
treasuries are called on-the-run and the ones that are in the market for more time called
seasoned or o-the-run. New issues are usually traded more than old ones, that causes
the higher liquidity of them. Figure 5 shows the slight dierence between the yields of
U.S. Treasuries due to the liquidity of the product. On-the-run securities have a bit lower
yield to maturity than seasoned ones:
When using this as the risk-free rate for calculating credit spreads, the results do not
only represent the risk of default of the issuer, it also incorporates the yield premium
arising from the much less liquidity on the secondary markets of corporate bonds. In a
research, Longsta [7] et al. (2005) shows that the default component explains only 50%
of the spread between the yields of Aaa/Aa rated bonds and treasuries. In the case of Baa
40
4.4 Liquidity 4 ADDITIONAL FEATURES
rated bonds it is 70%. The remaining part is mostly explained by the liquidity factor.
When one wants to estimate yield curves appropriate for evaluating a bond the men-
tioned ways starting from a risk-free yield curve can all lead to relatively good results.
However, Feldhtter suggests that the swap rate is the best as a benchmark risk-free rate
for corporate bond credit spread estimations. [8] The research also concludes that corpo-
rate bonds spreads are a better estimator of credit spread then CDS-spreads since the
latter can be disconnected from the credit component at times. One example according
to them is the Greek CDS and bond spread at 24 June, 2010. While CDS spread has
hit record high, the bond spreads didn't reacted that sensitively probably because of the
support from the European Central Bank bond buying program. Since it is possible to
buy CDSs without owning the bond of the subject company (this is called Naked CDS
contract ) there can be speculative motivations that drive the prices. Even if the bonds'
cash ows are protected some way and thus the values of them the credit event can hap-
pen and CDS owners can make prot from that. Figure 6 shows the Greek CDS and bond
spread around 24 June, 2010.
Figure 6: Historical data of the Greek CDS and bond spread values [8]
41
5 APPLICATIONS
5 Applications
5.1 Data Analysis
The data I have used is corporate bond data from Bloomberg. The plan was to focus
on CHF denominated bonds, altough the models are appropriate for any other currencies
of course. Swiss Bond Index was the starting point of collecting a representative sample of
bonds. The index consisted of 1276 bonds on the 30th September 2014. I used Microsoft
Excel and its Bloomberg extension to obtain the appropriate data.
From the known ISIN values I requested the following informations of the bonds:
The bold notations refer to the Bloomberg variables used in Excel. The data shows the
states of 14th, November 2014. It is observable in the spreadsheet 'ISINs from SBI' in
the attached Excel-le, titled data.xlsm. Since the bond index doesn't contain all bonds
of the companies included I needed some more work on that. First I separated the bonds
with the industry group 'Banks' as a focus of the analysis. From the original 1276 bonds
in the bond index 634 was in the 'Banks' industry group. I further narrowed the results
by centering the attention only on companies rated Aaa by Moody's. This way the set of
634 products decreased to 269. The next step was to collect all other bonds of the issuer
companies of these 269 products. I used the BOND_TO_EQY_TICKER function to
transform the ISIN to the Equity Ticker and after that the BOND_CHAIN function to
list all bonds available of the company the ticker denotes. It is in spreadsheet 'All bonds
of Aaa Banks'. After using a simple VBA-code to position the results I got 49998 bonds
42
5.1 Data Analysis 5 APPLICATIONS
in a column. Of course there were a lot of repetitions which I later corrected. For example
if there was a company with more than one bond in the Bond Index all of the company's
bonds appeared more than one times at this point. When nished removing duplicates
with Excel 7086 dierent bonds remained.
After that I requested the same data mentioned for the bonds: name, last price, ...etc.
In more than half of the 7068 bonds the result was not perfect because some or all of the
information wasn't available from Bloomberg. I cleared the data from the imperfect ones
and it resulted in 3029 dierent bonds with all the important information needed. The
only type where I left missing data is the Moody's rating category since that type is not
used in calculations directly. The spreadsheet 'All bonds of Aaa Banks 2' contains the
results. Figure 7 shows the rst few elements of the resulting dataset.
Figure 7: The rst few elements of the dataset after collecting and clearing it.
I have compared two types of linear yield curve models: polynomial approximation and
spline estimation. To be able to use the Ordinary Least Squares method I needed a cash-
ow matrix of the selected bonds. I have made a VBA code to construct a cashow matrix
from a selection of bonds. The code is in the attached data.xlsm le. The process starts
with collecting the maturities of the bonds into an array. Once it is done a new array
is made that contains all the dates when there is a cash ow from any one bonds of
the starting set. The date when the data is observed is included here even if there is no
payment. This date has to be an input in a cell and the code reads it from there. This
43
5.1 Data Analysis 5 APPLICATIONS
much bigger array is constructed with the use of the maturities and coupon frequency
data. I used a bubble sort algorithm to sort these dates in an incremental order and the
algorithm also unies repeating dates. The cash ow matrix's column will present the
cash ows of the products on these dates. The rows will be associated with the bonds.
I have set the matrix's elements to zero and after that lled with the appropriate cash
ows. In the case of every bond the algorithm started with the principal payment and
then moved backwards by the coupon payment frequencies to ll the selected cells with
the appropriate coupon payment amount. The selection of bonds I analyzed is Aaa rated
bonds of companies from Switzerland. Figure 8 shows an excerpt from the Cash-Flow
matrix result of the algorithm. The code also constructs three more arrays on dierent
spreadsheets. The vector of the last quoted prices, the incremental cash ow dates in a
column and the vector of the maturities. I found it easier to gather this four important
type of arrays from dierent spreadsheets when it came to Python implementation.
Figure 8: A part of the cash ow matrix constructed from Aaa rated bonds from Switzer-
land.
44
5.2 Modeling in Python 5 APPLICATIONS
The return of the function is an array with the estimated discount function values on the
cashow dates. I used this to present the results in a diagram but the code can be easily
modied to return for example the estimated vector of the i parameters or the discount
function's values on dierent time to maturity values. The algorithm is based on the OLS
method mentioned in the 'Statistical Yield Curve Models' chapter of this thesis.
The function I wrote for spline tting is spline (matu, cf, prices, dates, deg,
con) . It has one more argument than the polynomial function and that is an array of
the maturities already imported from the excel le. This vector is used when computing
45
5.2 Modeling in Python 5 APPLICATIONS
the knot points. I have written a subfunction knotpoints (matu, deg) that computes
the vector of the knot points. There is three way the knot points can be calculated and
the user can choose which way he or she prefers. The rst is fully automated, the number
of knot points is the square root of the number of observations rounded down to the
nearest integer. The points are located so that there are approximately equal number of
observations between every point. This approach is suggested by J. Huston McCulloch
[14]. The second way is that the user inputs the number of knot points and then these are
located automatically similarly to the rst case. The third is fully manual. The location
of the knot points are typed in manually one by one. Either way has been chosen the
extension of the knot points is automatically made by the code using parameter deg .
After the knotpoints are generated the spline function estimates the spline yield curve
model with OLS technique and after that returns the arrray of the discount function's
values on cashow dates.
I have made two small functions: yieldcurve (discount, dates) and forwardcurve
(yieldcurve, dates) . These are short codes that generate the spot and instantenous
forward curves from the discount curve values or from the spot curve. The returns are the
corresponding curve's values on the cashow dates.
46
5.3 The results 5 APPLICATIONS
Polynomial Model: The discount function was modeled as a third and as a fth
degree polynomial function. The constrained versions (where a constraint ensured that
d(0) = 1) resulted in much better short ends especially for the yield and forward curves.
Of course this raised the error term a bit as constraints usually do. Figure 9 presents the
resulting discount functions. The yield curves computed from the discount functions are
presented by Figure 10.
The yield curves computed from the discount functions are presented by Figure 10.
47
5.3 The results 5 APPLICATIONS
(a) Yield curve derived from the 3rd degree (b) Yield curve derived from the 5th degree
polynomial. polynomial.
The forward curves calculated from the yield curves are presented by Figure 11.
(a) Forward curve of the 3rd degree dis- (b) Forward curve of the 5th degree dis-
Figure 11: Forward curves calculated from the spot yield curves.
The sum of squared errors in the third degree case is 187.31. When tting the fth degree
polynomial the error decreased to 155.12. On these gures it is apparent how some extra
curvature in the discount function escalates when computing the yield and the forward
48
5.3 The results 5 APPLICATIONS
curves. Altough higher degree polynomials produce smaller errors, sometimes the results'
curvature may be considered too big to be realistic.
Spline Model: On the same data I examined two cubic spline models. Both of them
with the constraint d(0) = 1 because those produced much more realistic results. The
dierence was the number of the knot points. In the rst case a model with 4 knot points
was approximated while in the second case a model with six knot points. The knot points
were located automatically and the extensions were made automatically also with the use
of the knotpoints function. Figure 12 shows the estimated discount functions.
(a) Cubic spline with 4 knot points. (b) Cubic spline with 6 knot points.
The yield curves estimated from the discount functions above are presented in Figure
13.
49
5.3 The results 5 APPLICATIONS
(a) Yield curve computed from the spline (b) Yield curve computed from the spline
Figure 13: Yield curves computed from the spline discount function estimations.
(a) Forward curve of the spline with 4 knot (b) Forward curve of the spline with 6 knot
points. points.
The sum of squared errors of the ttings are the following. In the case of the cubic spline
with 4 knot points the error was 170.56. The sum of squared errors in the case of 6 knot
points was 130.27. By comparing the outlook of the curves and the error values in this
four cases I conclude that the best t was the cubic spline with 4 knot points on this set
of bonds. Altough the one with 6 knot points resulted in smaller errors, the shapes of the
yield curve and forward curve are not realistic.
50
6 SUMMARY
6 Summary
I found that linear yield curve models are quite easy to implement and to work with
in applications. They are not slow even when working with much bigger observations
number and produced sensible results. The algorithm that slowed down the modeling is
the part that computes the cashow matrix from the list of the bonds in Excel. I plan to
improve that, for example by changing the bubble sort algorithm to a quicksort, and by
restructuring the algorithm. The excel le with the VBA function and the Python code
saved as an ipython notebook le can be downloaded from:
https://dl.dropboxusercontent.com/u/100401660/data.xlsm
and
https://dl.dropboxusercontent.com/u/100401660/yieldcurve.ipynb
51
7 APPENDIX
7 Appendix
7.1 Appendix 1: An example of B-splines
The following graphs show the B-splines belong to the set of knot points: {0, 2, 5, 8, 11, 14, 19}.
52
7.1 Appendix 1: An example of B-splines 7 APPENDIX
53
7.1 Appendix 1: An example of B-splines 7 APPENDIX
54
REFERENCES REFERENCES
References
[1] Mitzhaletzky Gyrgy: Interest Rate Models (university lecture, 2014)
[2] Frank J. Fabozzi, Steven V. Mann: Handbook of Fixed Income Securities (McGraw-
Hill, 2005)
[3] Jessica James, Nick Webber: Interest Rate Modelling (John Wiley and Sons, 2000)
[4] Mark Fisher, Douglas Nychka, David Zervos: Fitting the term structure of interest
rates with smoothing splines, (FEDS 95-1, 1994)
[5] John C. Hull: Options, futures and other derivatives (6th edition, 2005)
[6] Stefan Trck, Matthias Laub, Svetlozar T. Rachev: The Term Structure of Credit
Spreads and Credit Default Swaps - an empirical investigation (2004)
[7] Francis A. Longsta, Sanjay Mithal, Eric Neis: Corporate Yield Spreads: Default Risk
of Liquidity? (2005)
[8] Peter Feldhtter: Where to look for credit risk? - The corporate bond market or the
CDS market? (Annual Financial Market Liquidity Conference presentation, 2014)
[9] Antonio Daz, Frank Skinner: Estimating Corporate Yield Curves (2001)
[10] Jerry Yi Xiao: Term Structure Estimations for U.S. Corporate Bond Yields
[11] Daniel F. Waggoner: Spline methods for extracting interest rate curves from coupon
bond prices, 1997
[13] Cox, J.C., J.E. Ingersoll, S.A. Ross: A Theory of the Term Structure of Interest Rates.
(Econometrica 53: 385407, 1985)
[14] J. Huston McCulloch: The Tax-adjusted Yield Curve (Journal of Finance, 1975)
55