CalibrateSABR





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).



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




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



Parameter Description


  1. ATMVol parameter

    Starting point for the At-the-money volatility.
  2. Alpha parameter

    Starting point for the Alpha parameter.
  3. Beta parameter

    Starting point for the Beta parameter.
  4. Rho parameter

    Starting point for the Rho parameter.
  5. CalibATMVol parameter

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

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

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

    Calibrate for the 'Rho' parameter (true) or keep the current value (false).
  9. CalibInstKey parameter

    Calibration Instrument object Key to an already constructed SABR Calibration instrument object (You can create this object via a call to SABRCalibInst(), SABRCalibInst2() or SABRCalibInst3()).
  10. OptimizationObject parameter

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


Extended information

Function Syntax

VB Syntax


Variant CTSABRCalibration.CalibrateSABR( _
Double ATMVol, _
Double Alpha, _
Double Beta, _
Double Rho, _
Boolean CalibATMVol, _
Boolean CalibAlpha, _
Boolean CalibBeta, _
Boolean CalibRho, _
String CalibInstKey, _
String OptimizationObject)


Excel Spreadsheet Syntax


=CT.ENG.CalibrateSABR(
Excel Numeric Cell ATMVol,
Excel Numeric Cell Alpha,
Excel Numeric Cell Beta,
Excel Numeric Cell Rho,
Excel Boolean Value Cell CalibATMVol,
Excel Boolean Value Cell CalibAlpha,
Excel Boolean Value Cell CalibBeta,
Excel Boolean Value Cell CalibRho,
Excel String Cell CalibInstKey,
Excel String Cell OptimizationObject)


C++ Syntax


static CTRangeDataCPP CalibrateSABR(
double ATMVol,
double Alpha,
double Beta,
double Rho,
bool CalibATMVol,
bool CalibAlpha,
bool CalibBeta,
bool CalibRho,
std::string CalibInstKey,
std::string OptimizationObject);


DotNET Syntax


CTRangeData CTSABRCalibrationSA.CalibrateSABR(
System.Double ATMVol,
System.Double Alpha,
System.Double Beta,
System.Double Rho,
System.Boolean CalibATMVol,
System.Boolean CalibAlpha,
System.Boolean CalibBeta,
System.Boolean CalibRho,
System.String CalibInstKey,
System.String OptimizationObject);

Parameter data types

ArgNameArgTypeIsKey
ATMVolDoubleFALSE
AlphaDoubleFALSE
BetaDoubleFALSE
RhoDoubleFALSE
CalibATMVolBooleanFALSE
CalibAlphaBooleanFALSE
CalibBetaBooleanFALSE
CalibRhoBooleanFALSE
CalibInstKeyStringTRUE
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
ATMVolFALSE0.21
AlphaFALSE0.4
BetaFALSE0.9
RhoFALSE0.45
CalibATMVolFALSEtrue
CalibAlphaFALSEtrue
CalibBetaFALSEtrue
CalibRhoFALSEtrue
CalibInstKeyFALSECalibInstKeyNAME.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 CalibrateSABR() 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 CalibrateSABR() function call


Example
NameInitialCalibrated
atmVol0.210.180231
alpha0.40.317961
beta0.90.99456
rho0.450.100847
#########################################################################################################
OptionMatFwdRateStrikeBlackVolSABRVolDiff (BLK-SABR)Ratio (BLK/SABR)
0.2555560.04392440.020.21230.216276-0.003975880.981617
0.2555560.04392440.0250.20230.2007540.001546491.0077
0.2555560.04392440.030.19430.1905750.003724921.01955
0.2555560.04392440.0350.18830.1849480.003352491.01813
0.2555560.04392440.040.18430.1831250.001174571.00641
0.2555560.04392440.0450.18230.184207-0.001907340.989646
0.2555560.04392440.050.18430.187257-0.002956860.98421
0.2555560.04392440.0550.18830.191491-0.00319130.983334
0.2555560.04392440.060.19430.196356-0.00205590.98953
0.2555560.04392440.0650.20230.2014960.0008037111.00399
0.2555560.04392440.070.21230.20670.005600281.02709
0.2555560.04392440.0750.21230.2118440.0004562471.00215



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