Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

LmmCalibrator Class Reference

#include <LiborCalibrator.h>

Inheritance diagram for LmmCalibrator:

StandardLmmCalibrator DriftlessLmmCalibrator PredictorCorrectorLmmCalibrator List of all members.

Detailed Description

Class which calibrates the parameters of the factorloading of any given LMM to a set of caplet and swaption (forward) prices read from two separate files respectively. See book, 6.11. The factor loading is calibrated to all caplets Caplet(i) (on ) and all coterminal swaptions Swaption(i,n) (swap on ) expiring at time respectively. The strikes can be chosen arbitrarily.

To simplify the procedure we calibrate by matching caplet prices exactly. This is restrictive and certainly suboptimal but it does allow us to compute the volatility scaling factors c_i (book, 6.11.1) from the caplet prices and hence limits the dimension of the optimization problem to seven (the number of parameters for both volatility surface and correlations, see book, 6.11.3). To find suitable parameter values we use a primitive form of global search along a Sobol sequence in the parameter region.

The data which we use for calibration purposes are synthetic prices compute from the analytic approximations for caplet and swaption pries in the various LMMs. The data files reside in the directory SyntheticData in the source file directory.

Definition at line 195 of file LiborCalibrator.h.

Public Member Functions

 LmmCalibrator (LiborFactorLoading *fl, const char *capletsInFile="CapletsIn.txt", const char *swaptionsInFile="SwaptionsIn.txt", const char *capletsOutFile="CapletsOut.txt", const char *swaptionsOutFile="SwaptionsOut.txt")
virtual ~LmmCalibrator ()
LiborFactorLoadinggetFactorLoading ()
Array1D< CapletData * > & getCaplets ()
Array1D< SwaptionData * > & getSwaptions ()
template<typename Instrument> void read (istream &is, Array1D< Instrument * > &instruments)
template<typename Instrument> void write (ostream &os, const Array1D< Instrument * > &instruments)
void readCaplets ()
void readSwaptions ()
void writeCaplets ()
void writeSwaptions ()
Real rho (int i, int j)
Real L_i0 (int i)
Real H_i0 (int i)
Real B_i0 (int i)
Real H_pq0 (int p, int q)
Real B_pq0 (int p, int q)
Real swapRate (int p, int q)
Real capletForwardPrice (int i, Real strike, Real Sigma)
Real swaptionForwardPrice (int i, Real strike, Real Sigma)
virtual Real capletForwardPrice (int i, Real strike)
virtual Real swaptionForwardPrice (int i, Real strike)
void writeSyntheticData ()
virtual Real objectiveFunction ()=0
virtual Real objectiveFunction (const RealArray1D &x)=0
Real meanRelativeCalibrationError ()
virtual LiborFactorLoadingcalibrate (int nVals)=0

Protected Attributes

LiborFactorLoadingfactorLoading
int n
const RealArray1DX0
const RealArray1Ddelta
RealVector U0
RealVector H0
Real Bn0
UTRRealMatrix S_pq0
ifstream capletsIn
ifstream swaptionsIn
ofstream logFile
ofstream capletsOut
ofstream swaptionsOut
Array1D< CapletData * > caplets
Array1D< SwaptionData * > swaptions


Constructor & Destructor Documentation

LmmCalibrator::LmmCalibrator LiborFactorLoading   fl,
const char *    capletsInFile = "CapletsIn.txt",
const char *    swaptionsInFile = "SwaptionsIn.txt",
const char *    capletsOutFile = "CapletsOut.txt",
const char *    swaptionsOutFile = "SwaptionsOut.txt"
 

virtual LmmCalibrator::~LmmCalibrator   [inline, virtual]
 

Definition at line 234 of file LiborCalibrator.h.


Member Function Documentation

LiborFactorLoading* LmmCalibrator::getFactorLoading   [inline]
 

Definition at line 238 of file LiborCalibrator.h.

Array1D<CapletData*>& LmmCalibrator::getCaplets   [inline]
 

Definition at line 239 of file LiborCalibrator.h.

Array1D<SwaptionData*>& LmmCalibrator::getSwaptions   [inline]
 

Definition at line 240 of file LiborCalibrator.h.

template<typename Instrument>
void LmmCalibrator::read istream &    is,
Array1D< Instrument * > &    instruments
[inline]
 

Read Instruments from ifstream is into Array instruments.

Definition at line 248 of file LiborCalibrator.h.

template<typename Instrument>
void LmmCalibrator::write ostream &    os,
const Array1D< Instrument * > &    instruments
[inline]
 

Write Instruments from array instruments to ofstream. Writes all fields including calibratedForwardPrice and relative error.

Definition at line 262 of file LiborCalibrator.h.

void LmmCalibrator::readCaplets  
 

void LmmCalibrator::readSwaptions  
 

void LmmCalibrator::writeCaplets  
 

Writes caplets from list.

void LmmCalibrator::writeSwaptions  
 

Writes swaptions from list.

Real LmmCalibrator::rho int    i,
int    j
 

The current correlations .

Real LmmCalibrator::L_i0 int    i
 

Libor L_i(0)

Real LmmCalibrator::H_i0 int    i
 

H_i(0)

Real LmmCalibrator::B_i0 int    i
 

B_i(0)

Real LmmCalibrator::H_pq0 int    p,
int    q
 

H_pq(0)=B_pq(0)/B_n(0)

Real LmmCalibrator::B_pq0 int    p,
int    q
 

H_pq(0)=B_pq(0)/B_n(0)

Real LmmCalibrator::swapRate int    p,
int    q
 

S_{pq}(0)

Real LmmCalibrator::capletForwardPrice int    i,
Real    strike,
Real    Sigma
 

Forward price of Caplet(i). Sigma is the aggregate volatility of the caplet to expiry. See book 6.8.2 and 6.6.

Real LmmCalibrator::swaptionForwardPrice int    i,
Real    strike,
Real    Sigma
 

Forward price of Swaption(i,n) (swap on ). Sigma is the aggregate volatility o of the swap rate logarithm to expiry. See book 6.8.3 and 6.7.

virtual Real LmmCalibrator::capletForwardPrice int    i,
Real    strike
[inline, virtual]
 

Caplet on . Forward price computed from current parameters of the factor loading. Method is only needed to write synthetic data. Empty implementation returns 0. See also capletForwardPrice(int, Real, Real). How the volatility Sigma is computed depends on the LMM type and will have to be defined in the calibrator for each type of LMM.

Reimplemented in StandardLmmCalibrator, DriftlessLmmCalibrator, and PredictorCorrectorLmmCalibrator.

Definition at line 336 of file LiborCalibrator.h.

References Real.

virtual Real LmmCalibrator::swaptionForwardPrice int    i,
Real    strike
[inline, virtual]
 

Swaption on , expires at . Forward price computed from current parameters of the factor loading. Method is only needed to write synthetic data. Empty implementation returns 0. See also swaptionForwardPrice(int, Real, Real). How the volatility Sigma is computed depends on the LMM type and will have to be defined in the calibrator for each type of LMM.

Reimplemented in StandardLmmCalibrator, DriftlessLmmCalibrator, and PredictorCorrectorLmmCalibrator.

Definition at line 347 of file LiborCalibrator.h.

References Real.

void LmmCalibrator::writeSyntheticData  
 

Computes the analytic forward prices of all at the money caplets and swaptions from the current parameters (state) of the factor loading and writes them to the caplet and swaption outfiles in the format in which the calibrator reads them for calibration. Note that these data cannot be read in the same pass of the program since the outfiles are associated with the ofstreams.

This needs the appropriate implementations of the functions capletForwardPrice(int, Real) and swaptionForwardPrice(int, Real) which depend on the type of LMM and will have to be defined in the calibrator for each type of LMM.

virtual Real LmmCalibrator::objectiveFunction   [pure virtual]
 

Pricing error under the current parameters of the factor loading (all caplets and coterminal swaptions).

Implemented in StandardLmmCalibrator.

virtual Real LmmCalibrator::objectiveFunction const RealArray1D   x [pure virtual]
 

The objective function as a function of the parameter values x applied to the factor loading.

Implemented in StandardLmmCalibrator.

Real LmmCalibrator::meanRelativeCalibrationError  
 

Mean relative pricing error over all caplets and swaptions. Assumes the calibrated forward prices and relative errors have already been written into the caplet and swaption data objects.

virtual LiborFactorLoading* LmmCalibrator::calibrate int    nVals [pure virtual]
 

Calibrates the factor loading with nVals evaluations of the objective function (sum squared error over all caplets and coterminal swaptions) and prints the result to the files "CapletsOut.txt", "SwaptionsOut.txt".

Returns:
the calibrated factor loading.

Implemented in StandardLmmCalibrator.


Member Data Documentation

LiborFactorLoading* LmmCalibrator::factorLoading [protected]
 

Definition at line 200 of file LiborCalibrator.h.

int LmmCalibrator::n [protected]
 

Definition at line 201 of file LiborCalibrator.h.

const RealArray1D& LmmCalibrator::X0 [protected]
 

Definition at line 203 of file LiborCalibrator.h.

const RealArray1D& LmmCalibrator::delta [protected]
 

Definition at line 204 of file LiborCalibrator.h.

RealVector LmmCalibrator::U0 [protected]
 

Definition at line 207 of file LiborCalibrator.h.

RealVector LmmCalibrator::H0 [protected]
 

Definition at line 208 of file LiborCalibrator.h.

Real LmmCalibrator::Bn0 [protected]
 

Definition at line 209 of file LiborCalibrator.h.

UTRRealMatrix LmmCalibrator::S_pq0 [protected]
 

Definition at line 210 of file LiborCalibrator.h.

ifstream LmmCalibrator::capletsIn [protected]
 

Definition at line 213 of file LiborCalibrator.h.

ifstream LmmCalibrator::swaptionsIn [protected]
 

Definition at line 214 of file LiborCalibrator.h.

ofstream LmmCalibrator::logFile [protected]
 

Definition at line 217 of file LiborCalibrator.h.

ofstream LmmCalibrator::capletsOut [protected]
 

Definition at line 218 of file LiborCalibrator.h.

ofstream LmmCalibrator::swaptionsOut [protected]
 

Definition at line 219 of file LiborCalibrator.h.

Array1D<CapletData*> LmmCalibrator::caplets [protected]
 

Definition at line 221 of file LiborCalibrator.h.

Array1D<SwaptionData*> LmmCalibrator::swaptions [protected]
 

Definition at line 222 of file LiborCalibrator.h.


The documentation for this class was generated from the following file:
Generated on Mon Sep 22 02:16:33 2003 for Libor-Library by doxygen1.3-rc3