Libor.LiborProcess
Class CS_FactorLoading

java.lang.Object
  extended byLibor.LiborProcess.FactorLoading
      extended byLibor.LiborProcess.CS_FactorLoading

public class CS_FactorLoading
extends FactorLoading

Implements the correlation and volatility structure from the document LiborProcess.ps which follows ideas of B. Coffey and J. Schoenmakers (CS).


Constructor Summary
CS_FactorLoading(int n, double A, double D, double alpha, double beta, double rho00, double[] c, double[] Tc)
          For the meaning of the parameters A,D,alpha,beta,rho00 see LiborProcess.ps.
 
Method Summary
 ColtMatrix correlationMatrix()
          The correlation matrix rho_ij as a ColtMatrix.
 double[][] getRho()
          Accessor to correlation matrix rho[][].
 double integral_sgi_sgj_rhoij(int i, int j, double t, double T)
          The integral
integral_t^T sigma_i(s)sigma_j(s)rho_ijds =<log(L_i),log(L_j)>_t^T
neeeded for the distribution of time step increments.
static void main(java.lang.String[] args)
          Small test program.
 double rho(int i, int j)
          Instantaneous log-Libor correlations rho_ij for i,j>=1.
static CS_FactorLoading sample(int n)
          Provides a sample CS_FactorLoading object of dimension n.
 double sigma(int i, double t)
          Volatility sigma_i(t) of log(L_i(t)), defined on [0,T_i].
 java.lang.String toString()
          A message what type of factor loading it is, all the parameter values.
 
Methods inherited from class Libor.LiborProcess.FactorLoading
getCholeskyRootArray, getCovariationMatrixArray, getDimension, getTenorStructure, logCovariationCholeskyRoot, logCovariationCholeskyRoot, logCovariationMatrix, logCovariationMatrix, rho
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CS_FactorLoading

public CS_FactorLoading(int n,
                        double A,
                        double D,
                        double alpha,
                        double beta,
                        double rho00,
                        double[] c,
                        double[] Tc)
For the meaning of the parameters A,D,alpha,beta,rho00 see LiborProcess.ps. Parameter array c[ ] starts with c[0]=c_0 even though L_0(t) is constant and so superfluous.

Parameters:
n - number of forward Libors including L_0.
c - array of c_j factors calibrating volatilities to caplet prices.
Tc - continuous time tenor structure (0=T_0,T_1,...,T_n).
Method Detail

getRho

public double[][] getRho()
Accessor to correlation matrix rho[][]. WARNING: rho[i][j]=rho_{i+1,j+1} because we do not store the correlations rho_{0,j}.


correlationMatrix

public ColtMatrix correlationMatrix()
The correlation matrix rho_ij as a ColtMatrix. See LiborProcess.ps. Used for testing purposes only.


rho

public double rho(int i,
                  int j)

Instantaneous log-Libor correlations rho_ij for i,j>=1.

Specified by:
rho in class FactorLoading
Parameters:
i - index of L_i(t), must satisfy i>=1.
j - index of L_j(t), must satisfy j>=1.

sigma

public double sigma(int i,
                    double t)
Volatility sigma_i(t) of log(L_i(t)), defined on [0,T_i].

Specified by:
sigma in class FactorLoading
Parameters:
i - index of forward Libor L_i(t).
t - current continuous time.

integral_sgi_sgj_rhoij

public double integral_sgi_sgj_rhoij(int i,
                                     int j,
                                     double t,
                                     double T)
The integral
integral_t^T sigma_i(s)sigma_j(s)rho_ijds =<log(L_i),log(L_j)>_t^T
neeeded for the distribution of time step increments. See document LiborProcess.ps

Specified by:
integral_sgi_sgj_rhoij in class FactorLoading
Parameters:
i - index of forward Libor L_i(t).
j - index of forward Libor L_j(t).

sample

public static CS_FactorLoading sample(int n)

Provides a sample CS_FactorLoading object of dimension n. Parameter values are as follows:

delta_j=0.25, c_j=0.25, A=1.3, D=2, alpha=0.9, beta=0.01, rho00=0.9*exp(-0.02*n).

This choice implies annualized Libor volatilities of about 33% and a humped volatility peaking halfway out to the reset date.

Parameters:
n - dimension of the Libor process

toString

public java.lang.String toString()
A message what type of factor loading it is, all the parameter values.

Specified by:
toString in class FactorLoading

main

public static void main(java.lang.String[] args)
Small test program. Allocates a factor loading of size n=50 to time the computation of the matrix arrays (happens in the constructor). There is a separate class of junit tests which tests the class more thoroughly.