CalibrateSABR2





http://www.QuantTools.com
CapeTools SABR Calibration function list

Welcome | Documentation format | QuantTools Groups | QuantTools Categories | Licence

Key TAGs | Excel Index | API Index



Calibrates the parameters of the SABR model (ATMVol, Alpha, Beta, Rho).

This version differs from the CalibrateSABR() function in that it generates a single column (for a single underlying in fact) for each of the ATM, Alpha, Beta and Rho parameters used within the SABRVolCurve() function.

Thus by repeated use of this function for each underlying tenor (FRAs or Swap rates) you can fully create calibrated SABR matrices required by the SABRVolCurve() function.



Note: Within Excel, the function is named - CT.ENG.CalibrateSABR2




High level graphic of CalibrateSABR2() function with parameters. Blue square node is the actual function with the parameters ordered.



Parameter Description


  1. CalibATMVol parameter

    Calibrate for the 'ATMVol' parameter (true) or keep the current value (false).
  2. CalibAlpha parameter

    Calibrate for the 'Alpha' parameter (true) or keep the current value (false).
  3. CalibBeta parameter

    Calibrate for the 'Beta' parameter (true) or keep the current value (false).
  4. CalibRho parameter

    Calibrate for the 'Rho' parameter (true) or keep the current value (false).
  5. SABRVCKey parameter

    Key to an already created SABRVolCurve object. Required both for obtaining starting guess values as well as obtaining fixed values for those SABR parameters that are not to be calibrated.
  6. VCKey parameter

    Key to an already created ExpiryKVolMatrix object. For a single interest rate underlying, this object specifies the volatility smile for all possible option maturities.
  7. YCKey parameter

    Key to an already constructed YieldCurve object. The underlying rate will be computed via this object.
  8. OptimizationObject parameter

    Key to an already created Optimization object ( LevenbergMarquardt(), ConjugateGradient(), SteepestDescent() or Simplex() ).


Extended information

Function Syntax

VB Syntax


Variant CTSABRCalibration.CalibrateSABR2( _
Boolean CalibATMVol, _
Boolean CalibAlpha, _
Boolean CalibBeta, _
Boolean CalibRho, _
String SABRVCKey, _
String VCKey, _
String YCKey, _
String OptimizationObject)


Excel Spreadsheet Syntax


=CT.ENG.CalibrateSABR2(
Excel Boolean Value Cell CalibATMVol,
Excel Boolean Value Cell CalibAlpha,
Excel Boolean Value Cell CalibBeta,
Excel Boolean Value Cell CalibRho,
Excel String Cell SABRVCKey,
Excel String Cell VCKey,
Excel String Cell YCKey,
Excel String Cell OptimizationObject)


C++ Syntax


static CTRangeDataCPP CalibrateSABR2(
bool CalibATMVol,
bool CalibAlpha,
bool CalibBeta,
bool CalibRho,
std::string SABRVCKey,
std::string VCKey,
std::string YCKey,
std::string OptimizationObject);


DotNET Syntax


CTRangeData CTSABRCalibrationSA.CalibrateSABR2(
System.Boolean CalibATMVol,
System.Boolean CalibAlpha,
System.Boolean CalibBeta,
System.Boolean CalibRho,
System.String SABRVCKey,
System.String VCKey,
System.String YCKey,
System.String OptimizationObject);

Parameter data types

ArgNameArgTypeIsKey
CalibATMVolBooleanFALSE
CalibAlphaBooleanFALSE
CalibBetaBooleanFALSE
CalibRhoBooleanFALSE
SABRVCKeyStringTRUE
VCKeyStringTRUE
YCKeyStringTRUE
OptimizationObjectStringTRUE


Example Inputs

The first column represents the name of the parameters. The second column specifies whether the parameters are optional or not. Finally the last column provides some sample input data.
Function call input string-keys are always in the format : "NAME.EXTTAG.TICKER" The "EXTTAG.TICKER" part is determined from the output of other, capetools, object creation functions.


ArgNameIsOptional (Excel only)Example
CalibATMVolFALSEtrue
CalibAlphaFALSEtrue
CalibBetaFALSEtrue
CalibRhoFALSEtrue
SABRVCKeyFALSESABRVCKeyNAME.EXTTAG.TICKER (from a function call)
VCKeyFALSEVCKeyNAME.EXTTAG.TICKER (from a function call)
YCKeyFALSEYCKeyNAME.EXTTAG.TICKER (from a function call)
OptimizationObjectFALSEOptimizationObjectNAME.EXTTAG.TICKER (from a function call)


Example function usage


The C# example below contains all the sub-function calls leading up to this function call. As a result, the example can contain a lot of code.

The VB.NET, J#, C++.NET, Java, Excel VBA, Visual Basic 6 (via COM) and C++ examples below contain function code stubs for the calls leading up to this function call. However, the function call for this function is displayed.
You can easily reproduce the stub functions code from the C# example.


If you are accessing this functrion via the MiniXL libraries, this function is present within the CT.QL.Models20 MiniXL Excel Addin.

Within our Excel Example Addin Generator, we have used the following QuantTools sub-functions in order to prepare the arguments needed to call the CalibrateSABR2() function. If you are executing this function via the MiniXL libraries, the module addin name, (in brackets, to the right of the sub-functions listed below), indicates the MiniXL library in which the sub-function is held. You will need to load this library into your Excel session (along with any other libraries that the sub-function call within the addin requires (ie - CT.QT.Utils20 addin in almost all cases) in order for the example to compute successfully.

These are the financial QuantTools sub-function calls that are used within the examples :





The objects generated by these sub-functions are inter-connected in the following way :




The following four examples demostrate calling this function within a Microsoft .NET environment

The following four examples demostrate calling this function within a non .NET environment

The following is a sample output from executing the CalibrateSABR2() function call


Example
optionMatUndStart (t)fwdRateatmVolalphabetarhoerror
3M0.2555560.04392440.1808110.3171390.9955560.09916050.000103489
6M0.5111110.04436740.1833370.3175360.9987030.1073790.00010201
9M0.7555560.04475060.181580.3171240.9955320.1197090.000100792
12M1.005560.04508680.1831310.3165220.9999010.1234979.99279e-005
2Y2.011110.04597090.1778220.3141620.9924680.1486339.85444e-005
4Y4.005560.04534460.1780940.3084730.9992250.1300099.92202e-005
6Y6.005560.0455860.1706770.3031430.9904890.1426669.90114e-005
8Y8.011110.04659350.1716650.2994440.996480.1602769.61025e-005
10Y10.00560.04746880.1672920.2946750.9943790.1815049.3876e-005
12Y12.00560.04867540.1655990.2910910.9937390.2079839.08172e-005
14Y14.01110.04951790.1614660.2866580.9901680.2299828.86915e-005
16Y16.00560.04968310.1618310.283680.9948010.2281398.82155e-005
18Y18.00560.05040670.1591040.2797070.9943930.2452568.59711e-005
20Y20.00830.05185310.1581460.2769370.9945470.2720178.30794e-005
22Y22.00560.05503250.1569830.2738480.9911450.3349117.61983e-005



Copyright (c) 2003-2007 CapeTools - All Rights Reserved.