LINEBURG

 << Пред. стр. страница 16(всего 20)ОГЛАВЛЕНИЕ След. стр. >>

116
Chapter 19

Term Structure Models
Contents
19.1 The Nelson Siegel term structure approximation . . . . . . . . . . . . . . . . . 117
19.2 Cubic spline. . . . . . . ...... .......... . . . . . . . . . . . . . . . . . 117
19.3 Cox Ingersoll Ross. . . ...... .......... . . . . . . . . . . . . . . . . . 120
19.4 Vasicek . . . . . . . . . . ...... .......... . . . . . . . . . . . . . . . . . 122

We now expand on the analysis of the term structure in chapter 3. As shown there, the term structure is
best viewed as an abstract function of term to maturity, equally well described by the prices of zero coupon
bonds (discount factors), yield on zero coupon bonds (spot rates) or forward rates. In the earlier case we
considered two particular implementations of the term structure: A п¬‚at term structure or a term structure
estimated by linear interpolations of the spot rates.
A number of alternative ways of estimating the term structure has been considered. Some are purely used
as interpolation functions, while others are fully speciп¬Ѓed, dynamic term structure models. We show two
examples of the п¬Ѓrst type, the approximating function proposed in Nelson and Siegel [1987] and a cubic
spline used by e.g. McCulloch [1971]. We also consider the term structure models of Cox et al. [1985] and
Vasicek [1977].

19.1 The Nelson Siegel term structure approximation

Proposed by Nelson and Siegel [1987].

#include <cmath>
using namespace std;

double term structure yield nelson siegel(const double& t,
const double& beta0,
const double& beta1,
const double& beta2,
const double& lambda) {
if (t==0.0) return beta0;
double tl = t/lambda;
double r = beta0 + (beta1+beta2) * ((1в€’exp(в€’tl))/tl) + beta2 * exp(в€’tl);
return r;
};

Code 19.1:

19.2 Cubic spline.

Cubic splines are well known for their good interpolation behaviour.

117
#ifndef TERM STRUCTURE CLASS NELSON SIEGEL
#deп¬Ѓne TERM STRUCTURE CLASS NELSON SIEGEL

#include "term_structure_class.h"

class term structure class nelson siegel : public term structure class {
private:
double beta0 , beta1 , beta2 , lambda ;
public:
term structure class nelson siegel(const double& beta0,
const double& beta1,
const double& beta2,
const double& lambda);
virtual double yield(const double& T) const;
};

#endif

Code 19.2:

#include "term_structure_class_nelson_siegel.h"
#include "fin_recipes.h"

term structure class nelson siegel::term structure class nelson siegel( const double& b0,
const double& b1,
const double& b2,
const double& l) {
beta0 = b0; beta1 = b1; beta2 = b2; lambda = l;
};

double term structure class nelson siegel::yield(const double& t) const {
if (t<=0.0) return beta0 ;
return term structure yield nelson siegel(t,beta0 ,beta1 ,beta2 ,lambda );
};

Code 19.3:

#include <cmath>
#include <vector>
using namespace std;

double term structure discount factor cubic spline(const double& t,
const double& b1,
const double& c1,
const double& d1,
const vector<double>& f,
const vector<double>& knots){
double d = 1.0 + b1*t + c1*(pow(t,2)) + d1*(pow(t,3));
for (int i=0;i<knots.size();i++) {
if (t >= knots[i]) { d += f[i] * (pow((tв€’knots[i]),3)); }
else { break; };
};
return d;
};

Code 19.4:

118
#ifndef TERM STRUCTURE CLASS CUBIC SPLINE
#deп¬Ѓne TERM STRUCTURE CLASS CUBIC SPLINE

#include "term_structure_class.h"
#include <vector>
using namespace std;

class term structure class cubic spline : public term structure class {
private:
double b ;
double c ;
double d ;
vector<double> f ;
vector<double> knots ;
public:
term structure class cubic spline(const double& b,
const double& c,
const double& d,
const vector<double>& f,
const vector<double> & knots);
virtual Лњterm structure class cubic spline();
virtual double discount factor(const double& T) const;
};

#endif

Code 19.5:

#include "term_structure_class_cubic_spline.h"
#include "fin_recipes.h"

term structure class cubic spline::term structure class cubic spline ( const double& b,
const double& c,
const double& d,
const vector<double>& f,
const vector<double>& knots) {
b = b; c = c; d = d; f .clear(); knots .clear();
if (f.size()!=knots.size()){ return; };
for (int i=0;i<f.size();++i) {
f .push back(f[i]);
knots .push back(knots[i]);
};
};

term structure class cubic spline::Лњterm structure class cubic spline(){
f .clear();
knots .clear();
};

double term structure class cubic spline::discount factor(const double& T) const {
return term structure discount factor cubic spline(T,b ,c ,d ,f ,knots );
};

Code 19.6:

119
19.3 Cox Ingersoll Ross.

The Cox et al. [1985] model is the most wellвЂ“known example of a continous time, general equilibrium model
of the term structure.

#include <cmath>
using namespace std;

double term structure discount factor cir(const double& t,
const double& r,
const double& kappa,
const double& lambda,
const double& theta,
const double& sigma){
double sigma sqr=pow(sigma,2);
double gamma = sqrt(pow((kappa+lambda),2)+2.0*sigma sqr);
double denum = (gamma+kappa+lambda)*(exp(gamma*t)в€’1)+2*gamma;
double p=2*kappa*theta/sigma sqr;
double enum1= 2*gamma*exp(0.5*(kappa+lambda+gamma)*t);
double A = pow((enum1/denum),p);
double B = (2*(exp(gamma*t)в€’1))/denum;
double dfact=A*exp(в€’B*r);
return dfact;
};

Code 19.7:

#ifndef TERM STRUCTURE CLASS CIR
#deп¬Ѓne TERM STRUCTURE CLASS CIR

#include "term_structure_class.h"

class term structure class cir : public term structure class {
private:
double r ; // interest rate
double kappa ; // mean reversion parameter
double lambda ; // risk aversion
double theta ; // long run mean
double sigma ; // volatility
public:
term structure class cir(const double& r,
const double& k,
const double& l,
const double& th,
const double& sigma);

virtual double discount factor(const double& T) const;
};

#endif

Code 19.8:

120
#include "term_structure_class_cir.h"
#include "fin_recipes.h"
#include "term_structure_models.h"

term structure class cir::term structure class cir(const double& r,
const double& k,
const double& l,
const double& th,
const double& sigma) {
r = r;
kappa = k;
lambda = l;
theta = th;
sigma = sigma;
};

double term structure class cir::discount factor(const double& T) const{
return term structure discount factor cir(T,r ,kappa ,lambda ,theta ,sigma );
};

Code 19.9:

121
19.4 Vasicek

#include <cmath>
using namespace std;

double term structure discount factor vasicek(const double& time,
const double& r,
const double& a,
const double& b,
const double& sigma){
double A,B;
double sigma sqr = sigma*sigma;
double aa = a*a;
if (a==0.0){
B = time;
A = exp(sigma sqr*pow(time,3))/6.0;
}
else {
B = (1.0 в€’ exp(в€’a*time))/a;
A = exp( ((Bв€’time)*(aa*bв€’0.5*sigma sqr))/aa в€’((sigma sqr*B*B)/(4*a)));
};
double d = A*exp(в€’B*r);
return d;
}

Code 19.10:

#ifndef TERM STRUCTURE CLASS VASICEK
#deп¬Ѓne TERM STRUCTURE CLASS VASICEK

#include "term_structure_class.h"

class term structure class vasicek : public term structure class {
private:
double r ;
double a ;
double b ;
double sigma ;
public:
term structure class vasicek(const double& r,
const double& a,
const double& b,
const double& sigma);

virtual double discount factor(const double& T) const;
};

#endif

Code 19.11:

122
#include "term_structure_class_vasicek.h"
#include "fin_recipes.h"

term structure class vasicek::term structure class vasicek(const double& r,
const double& a,
const double& b,
const double& sigma) {
r = r; a = a; b = b; sigma = sigma;
};

double term structure class vasicek::discount factor(const double& T) const{
return term structure discount factor vasicek(T,r ,a ,b ,sigma );
};

Code 19.12:

123
Chapter 20

Binomial Term Structure models
Contents
20.1 The Rendleman and Bartter model . . . . . . . . . . . . . . . . . . . . . . . . . 124
20.2 Readings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125

Pricing bond options with the Black Scholes model, or its binomial approximation, as done in chapter 17,
does not always get it right. For example, it ignores the fact that at the maturity of the bond, the bond
volatility is zero. The bond volatility decreases as one gets closer to the bond maturity. This behaviour
is not captured by the assumptions underlying the Black Scholes assumption. We therefore look at more
complicated term structure models, the unifying theme of which is that they are built by building trees of
the interest rate.

20.1 The Rendleman and Bartter model

The Rendleman and Bartter approach to valuation of interest rate contingent claims (see Rendleman and
Bartter [1979] and Rendleman and Bartter [1980]) is a particular simple one. Essentially, it is to apply the
same binomial approach that is used to approximate options in the Black Scholes world, but the random
variable is now the interest rate. This has implications for multiperiod discounting: Taking the present value
is now a matter of choosing the correct sequence of spot rates, and it may be necessary to keep track of the
whole вЂњtreeвЂќ of interest rates.
The general idea is to construct a tree as shown in п¬Ѓgure 20.1.

Figure 20.1: Interest rate tree

ruu = uur0
ВЁ
B
ВЁВЁ
ВЁВЁ
ВЁ
ВЁ
ВЁ rr = ur0
ВЁ ru
ВЁ
B
ВЁВЁ r
rr
ВЁ
ВЁ r
ВЁВЁ r
 << Пред. стр. страница 16(всего 20)ОГЛАВЛЕНИЕ След. стр. >>