Class diff_CIR

java.lang.Object
  extended by diff_CIR

public class diff_CIR
extends java.lang.Object

CIR interest rate model in differential form, where r is the short term risk free rate of return, dt is the time step differential, r is pulled back to the mu-level at a rate of alpha, a represents the function a(r)=alpha(mu-r) used in the SDEIntegrator. The first derivative of a, d_a = -alpha. The sde is an SDEIntegrator used to find r(t+delta_t), where the function b(r,t) is the constant sigma


Field Summary
protected  double a
           
protected  double alpha
           
protected  double b
           
protected  double B_maturity
           
protected  double call
           
protected  double d_a
           
protected  double d_b
           
protected  double dd_a
           
protected  double dd_b
           
protected  double ddd_b
           
protected  double dt
           
protected  double mu
           
protected  double put
           
protected  double r
           
protected  double r0
           
protected  SDEIntegrator sde
           
protected  double sigma
           
 
Constructor Summary
diff_CIR()
          Creates a new instance of diff_CIR with default values
diff_CIR(double _dt, double _mu, double _alpha, double _sigma, double _r0)
          Creates a new instance of diff_CIR
 
Method Summary
 DataCurve[] gen_AverBondandIRvsMaturity(int n_sim, int n_points, double S)
           
 DataCurve[] gen_BondandIRvsMaturity(int n_points, double S)
          Curve[0] has the time dependent IR Curve[1] has the time dependent price of the Bond
 double get_a()
          gets a(r)
 double get_alpha()
          gets the rate alpha at which r(t) converges to mu
 double get_B_maturity()
           
 double get_b()
           
 double get_d_a()
           
 double get_d_b()
           
 double get_dd_a()
           
 double get_dd_b()
           
 double get_ddd_b()
           
 double get_dt()
           
 double get_mu()
          gets the long term average rate of return mu
 double get_r()
          gets the short term risk free interest rate
 double get_r0()
          gets the initial short term risk free interest rate
 double get_sigma()
          gets the volatility sigma of r(t)
static void main(java.lang.String[] args)
           
 void set_a()
          sets the a(r) function used in the SDEIntegrator for the particular case of the Cox Ingersoll Ross Model
 void set_alpha(double _alpha)
          sets the rate at which r(t) goes back to mu
 void set_B_maturity(double b)
           
 void set_b()
          sets the b(r,t) function used in the SDEIntegrator
 void set_call(double c)
           
 void set_d_a()
           
 void set_d_b()
          sets the db(r,t)/dr function used in the SDEIntegrator
 void set_dd_a()
           
 void set_dd_b()
          sets the d^2b(r,t)/dr^2 function used in the SDEIntegrator
 void set_ddd_b()
          sets the d^3b(r,t)/dr^3 function used in the SDEIntegrator
 void set_dt(double _dt)
           
 void set_mu(double _mu)
          long term average interest rate
 void set_put(double p)
           
 void set_r(double _p)
          sets the short term risk free interest rate
 void set_r0(double _p)
          sets the initial short term risk free interest rate
 void set_SDE()
           
 void set_sigma(double _sigma)
          sets the volatility sigma of r(t)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

r

protected double r

r0

protected double r0

B_maturity

protected double B_maturity

dt

protected double dt

a

protected double a

d_a

protected double d_a

dd_a

protected double dd_a

b

protected double b

d_b

protected double d_b

dd_b

protected double dd_b

ddd_b

protected double ddd_b

alpha

protected double alpha

mu

protected double mu

sigma

protected double sigma

call

protected double call

put

protected double put

sde

protected SDEIntegrator sde
Constructor Detail

diff_CIR

public diff_CIR()
Creates a new instance of diff_CIR with default values


diff_CIR

public diff_CIR(double _dt,
                double _mu,
                double _alpha,
                double _sigma,
                double _r0)
Creates a new instance of diff_CIR

Method Detail

set_a

public void set_a()
sets the a(r) function used in the SDEIntegrator for the particular case of the Cox Ingersoll Ross Model


set_d_a

public void set_d_a()

set_dd_a

public void set_dd_a()

set_b

public void set_b()
sets the b(r,t) function used in the SDEIntegrator


set_d_b

public void set_d_b()
sets the db(r,t)/dr function used in the SDEIntegrator


set_dd_b

public void set_dd_b()
sets the d^2b(r,t)/dr^2 function used in the SDEIntegrator


set_ddd_b

public void set_ddd_b()
sets the d^3b(r,t)/dr^3 function used in the SDEIntegrator


main

public static void main(java.lang.String[] args)

set_SDE

public void set_SDE()

set_B_maturity

public void set_B_maturity(double b)

get_B_maturity

public double get_B_maturity()

set_call

public void set_call(double c)

set_put

public void set_put(double p)

set_dt

public void set_dt(double _dt)

get_dt

public double get_dt()

get_a

public double get_a()
gets a(r)


get_d_a

public double get_d_a()

get_dd_a

public double get_dd_a()

set_r

public void set_r(double _p)
sets the short term risk free interest rate


set_r0

public void set_r0(double _p)
sets the initial short term risk free interest rate


set_alpha

public void set_alpha(double _alpha)
sets the rate at which r(t) goes back to mu


set_mu

public void set_mu(double _mu)
long term average interest rate


set_sigma

public void set_sigma(double _sigma)
sets the volatility sigma of r(t)


get_r

public double get_r()
gets the short term risk free interest rate


get_r0

public double get_r0()
gets the initial short term risk free interest rate


get_alpha

public double get_alpha()
gets the rate alpha at which r(t) converges to mu


get_mu

public double get_mu()
gets the long term average rate of return mu


get_sigma

public double get_sigma()
gets the volatility sigma of r(t)


get_b

public double get_b()

get_d_b

public double get_d_b()

get_dd_b

public double get_dd_b()

get_ddd_b

public double get_ddd_b()

gen_BondandIRvsMaturity

public DataCurve[] gen_BondandIRvsMaturity(int n_points,
                                           double S)
Curve[0] has the time dependent IR Curve[1] has the time dependent price of the Bond


gen_AverBondandIRvsMaturity

public DataCurve[] gen_AverBondandIRvsMaturity(int n_sim,
                                               int n_points,
                                               double S)