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

StandardLmmCalibrator Class Reference

#include <LiborCalibrator.h>

Inheritance diagram for StandardLmmCalibrator:

LmmCalibrator DriftlessLmmCalibrator PredictorCorrectorLmmCalibrator List of all members.

Detailed Description

Calibrator for a Libor market model which follows a dynamics described in the book, that is, driftless or predictor-corrector. Implements everything except computation of the aggregate volatilities to expiry of Libor and swap rate logarithms which differ in the two models.

Very likely other models based on the same factor loading types (deterministic volatilities and constant correlations) and possibly others will be able to use this class. It all depends wether there is a useable Black-Scholes analytic approximation for the caplet and swaption forward prices based on a forecast of the aggregate volatility to expiry of Libor and swaprate logarithms. See book, 6.6, 6.7 (predictor corrector model) and 6.8.2, 6.8.3 (driftless model) as well as Appendix, C.4 for the general Black-Scholes type approximation.

Currently the calibrator assumes that all the forward prices of caplets Caplet(i) and Swaptions Swaption(i,n), i=1,2,...,n are in the files CapletsIn, SwaptionsIn in the form described in SyntheticData/Readme.html. Nothing is checked. The routine writeSyntheticData() produces output in this form.

Definition at line 443 of file LiborCalibrator.h.

Public Member Functions

 StandardLmmCalibrator (LiborFactorLoading *fl, const char *capletsInFile="CapletsIn.txt", const char *swaptionsInFile="SwaptionsIn.txt", const char *capletsOutFile="CapletsOut.txt", const char *swaptionsOutFile="SwaptionsOut.txt")
virtual Real objectiveFunction (const RealArray1D &x)
Real objectiveFunction ()
virtual void setScalingFactors ()=0
virtual Real capletForwardPrice (int i, Real strike)=0
virtual Real swaptionForwardPrice (int i, Real strike)=0
void writeCovariationMatrix (int p, int q)
LiborFactorLoadingcalibrate (int nVals)

Static Public Member Functions

void writeSyntheticDataSample (int n, int volType=VolSurface::JR, int corrType=Correlations::CS)
void writeSyntheticDataSample ()
void testCalibration (int nVals, int dim, int dataLmmType, int dataVolSurfaceType, int dataCorrelationType, int lmmType, int volSurfaceType, int correlationType)

Protected Member Functions

Real root_xCx (int i)

Protected Attributes

RealVector capletImpliedSigma
UTRRealMatrix cvMatrix
Real capletVol
Real swaptionVol
RealVector x

Constructor & Destructor Documentation

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

Member Function Documentation

virtual Real StandardLmmCalibrator::objectiveFunction const RealArray1D   x [virtual]

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

Implements LmmCalibrator.

Real StandardLmmCalibrator::objectiveFunction   [virtual]

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

Implements LmmCalibrator.

virtual void StandardLmmCalibrator::setScalingFactors   [pure virtual]

From the current parameters for the volatility surface and correlations set the scaling factors of the factor loading to the values which reproduce the caplet prices exactly. See book, 6.11.3.

Implemented in DriftlessLmmCalibrator, and PredictorCorrectorLmmCalibrator.

virtual Real StandardLmmCalibrator::capletForwardPrice int    i,
Real    strike
[pure virtual]

Caplet on . Forward price computed from current parameters of the factorloading.

Reimplemented from LmmCalibrator.

Implemented in DriftlessLmmCalibrator, and PredictorCorrectorLmmCalibrator.

virtual Real StandardLmmCalibrator::swaptionForwardPrice int    i,
Real    strike
[pure virtual]

Swaption on , expires at . Forward price computed from current parameters of the factorloading.

Reimplemented from LmmCalibrator.

Implemented in DriftlessLmmCalibrator, and PredictorCorrectorLmmCalibrator.

void StandardLmmCalibrator::writeSyntheticDataSample int    n,
int    volType = VolSurface::JR,
int    corrType = Correlations::CS

Writes a sample of synthetic caplet and swaption prices in dimension n to files in the directory SyntheticData in the src directory.

n dimension of Libor process (number of accrual intervals).
volType type of VolSurface VolSurface::JR,M,CONST.
corrType type of Correlations Correlations::JR,CS.

void StandardLmmCalibrator::writeSyntheticDataSample   [static]

Writes a sample of synthetic caplet and swaption prices in dimension n=20,30,40 for all factorloading types.

void StandardLmmCalibrator::testCalibration int    nVals,
int    dim,
int    dataLmmType,
int    dataVolSurfaceType,
int    dataCorrelationType,
int    lmmType,
int    volSurfaceType,
int    correlationType

Tests calibration on the synthetic data in the directory SyntheticData. This directory contains synthetic caplet and swaption prices in dimensions 20,30,40,50 (number of Libor accrual intervals). These data have been produced using the sample LMMs returned by the method LiborMarketModel#sample(int,int,int,int). Following up how these are constructed one can determine what parameters are used in each case. We don't check that the parameters have legal values. Please make sure they do.

nVals number of evaluations of the objective function (suggested:500).
dim dimension of the LMM, number of accrual periods = 20,30,40,50.
dataLmmType type of LMM that produced the data (LiborFactorLoading::DL,PC).
dataVolSurfaceType type of VolSurface that produced the data (VolSurface::CONST,M,JR).
dataCorrelationType type of Correlations that produced the data (Correlations::CS,JR).
lmmType type of LMM to be calibrated: (LiborFactorLoading::DL,PC).
volSurfaceType type of VolSurface to be calibrated (VolSurface::CONST,M,JR).
correlationType type of Correlations to be calibrated (Correlations::CS,JR).

void StandardLmmCalibrator::writeCovariationMatrix int    p,
int    q

Writes the log-Libor covariation matrix CV with indices

into the field cvMatrix with the same subscripts i,j=p,...,q-1; i<=j.

LiborFactorLoading* StandardLmmCalibrator::calibrate int    nVals [virtual]

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

the calibrated factorLoading

Implements LmmCalibrator.

Real StandardLmmCalibrator::root_xCx int    i [protected]

The squareroot where $C$ is the covariation matrix in the field cvMatrix with indices j,k=i,...,n-1 and x is the vector in the field x indexed as x[j], j=i,...,n-1. This quantity is used to compute caplet and swaption aggregate volatilities and the fields cvMatrix and x are then set approproately. See book 6.6, 6.7, 6.8.2, 6.8.3. Note that we don't take the detour using a pseudo square root of the covariation matrix C.

Member Data Documentation

RealVector StandardLmmCalibrator::capletImpliedSigma [protected]

Definition at line 447 of file LiborCalibrator.h.

UTRRealMatrix StandardLmmCalibrator::cvMatrix [protected]

Definition at line 449 of file LiborCalibrator.h.

Real StandardLmmCalibrator::capletVol [protected]

Definition at line 451 of file LiborCalibrator.h.

Real StandardLmmCalibrator::swaptionVol [protected]

Definition at line 451 of file LiborCalibrator.h.

RealVector StandardLmmCalibrator::x [protected]

Definition at line 452 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