Next: Fixed Income modelling, with Up: Term Structure algorithms. Previous: Term structure approximations.   Contents   Index

Subsections

# Term structure models.

The previous section discussed methods that can be viewed as ways of nonparametrically estimating the term structure function. We next look at economic models of the term structure.

## The Vasicek model.

Proposed by Vasicek (1977).

// file vasicek.cc
// author: Bernt A Oedegaard

#include "math.h"

double term_structure_discount_factor_vasicek(double time,
double r,
double a, double b, 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;
}


## The original Cox Ingersoll Ross model.

The term structure model described in Cox et al. (1985) is one of the most commonly used in academic work, because it is a general equilibrium model that still is simple enough'' to let us find closed form expressions for derivative securities.

#### Calculating discount factors.

The short interest rate.

The discount factor for a payment at time T.

where

and

Five parameters
1. - The short term interest rate.
2. - The mean reversion parameter.
3. - market'' risk parameter.
4. - the long-run mean of the process.
5. - the variance rate of the process.

#### Computer algorithm.

// file termstru_discfact_cir.cc
// author: Bernt A Oedegaard

#include <math.h>                     // mathematics library

double term_structure_discount_factor_cir(double t,
double r,
double kappa,
double lambda,
double theta,
double sigma)
// this is the original CIR formulation of their term structure.
{
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;
};


## The estimated CIR model used by Brown and Dybvig.

If the Cox et al. (1985) model is estimated from a cross-section of bond prices, all the parameters are not identifiable from the data. As shown in Brown and Dybvig (1986), it is only possible to separately identify four factors .

### Discount factor.

// file esti_cir.cc
// author Bernt Arne Oedegaard

#include <math.h>

double term_structure_discount_factor_estimated_cir( double t,   // time to maturity.
double r,	// short interest rate.
double phi1,
double phi2,
double phi3)
{
double tmp = (phi2*(exp(phi1*t)-1.0)+phi1);
double A = (phi1*exp(phi2*t))/tmp;
A = pow(A,phi3);
double B = (exp(phi1*t)-1.0)/tmp;
double dfact =  A*exp(-B*r);
return dfact;
}


Next: Fixed Income modelling, with Up: Term Structure algorithms. Previous: Term structure approximations.   Contents   Index
Bernt Arne Odegaard
1999-09-09