Table Of ContentFinancial Engineering Explained
SeriesEditor
WimSchoutens
DepartmentofMathematics
KatholiekeUniversiteitLeuven,
Heverlee,Belgium
FinancialEngineeringExplainedisaseriesofconcise,practicalguidestomodern
finance, focusing on key, technical areas of risk management and asset pricing.
Written for practitioners, researchers and students, the series discusses a range of
topicsinanon-mathematicalbuthighlyintuitiveway.Eachself-containedvolume
is dedicated to a specific topic and offers a thorough introduction with all the
necessary depth, but without too much technical ballast. Where applicable, theory
is illustrated with real world examples, with special attention to the numerical
implementation.
SeriesAdvisoryBoard:
PeterCarr,ExecutiveDirector,NYUMathematicalFinance;GlobalHeadofMarket
Modeling,MorganStanley.
ErnstEberlein,DepartmentofMathematicalStochastics,UniversityofFreiburg.
MatthiasScherer,ChairofMathematicalFinance,TechnischeUniversitätMünchen.
Titlesintheseries:
EquityDerivativesExplained,MohamedBouzoubaa
TheGreeksandHedgingExplained,PeterLeoni
SmilePricingExplained,PeterAusting
FinancialEngineeringwithCopulasExplained,MatthiasSchererand
Jan-FrederikMai
InterestRatesExplainedVolume1,JörgKienitz
Forthcomingtitles:
InterestRatesExplainedVolume2,JörgKienitz
Submissions:[email protected]
Moreinformationaboutthisseriesat
http://www.springer.com/series/14984
Marc Henrard
Algorithmic Differentiation
in Finance Explained
MarcHenrard
AdvisoryPartner,
OpenGamma
London,UnitedKingdom
ISBN978-3-319-53978-2 ISBN978-3-319-53979-9(eBook)
DOI10.1007/978-3-319-53979-9
LibraryofCongressControlNumber:2017941212
TheEditor(s)(ifapplicable)andTheAuthor(s)2017
Thisworkissubjecttocopyright.AllrightsaresolelyandexclusivelylicensedbythePublisher,whether
thewholeorpartofthematerialisconcerned,specificallytherightsoftranslation,reprinting,reuse
ofillustrations,recitation,broadcasting,reproductiononmicrofilmsorinanyotherphysicalway,and
transmissionorinformationstorageandretrieval,electronicadaptation,computersoftware,orbysimilar
ordissimilarmethodologynowknownorhereafterdeveloped.
Theuseofgeneraldescriptivenames,registerednames,trademarks,servicemarks,etc.inthispublication
doesnotimply,evenintheabsenceofaspecificstatement,thatsuchnamesareexemptfromtherelevant
protectivelawsandregulationsandthereforefreeforgeneraluse.
Thepublisher,theauthorsandtheeditorsaresafetoassumethattheadviceandinformationinthisbook
arebelievedtobetrueandaccurateatthedateofpublication.Neitherthepublishernortheauthorsor
theeditorsgiveawarranty,expressorimplied,withrespecttothematerialcontainedhereinorforany
errorsoromissionsthatmayhavebeenmade.Thepublisherremainsneutralwithregardtojurisdictional
claimsinpublishedmapsandinstitutionalaffiliations.
Coverimage©RowanMoore/GettyImages
Printedonacid-freepaper
ThisPalgraveMacmillanimprintispublishedbySpringerNature
TheregisteredcompanyisSpringerInternationalPublishingAG
Theregisteredcompanyaddressis:Gewerbestrasse11,6330Cham,Switzerland
Contents
1 Introduction .............................................. 1
2 ThePrinciplesofAlgorithmic
Differentiation ............................................ 15
3 ApplicationtoFinance ...................................... 31
4 AutomaticAlgorithmicDifferentiation ......................... 49
5 DerivativestoNon-inputsandNon-derivativestoInputs ........... 67
6 Calibration ............................................... 77
AppendixA MathematicalResults ............................. 99
Index ...................................................... 101
List of Figures
Fig. 1.1 Comparison of the convergence for different finite
differenceapproximationofthefirstorderderivative .......... 6
Fig. 1.2 Comparison of the convergence for different finite
differenceapproximationsofthefirstorderderivative.
Includingthe“verysmallshifts”partofthegraph ............ 9
Fig. 6.1 VisualrepresentationofthetransitionmatrixoftheEUR
discountingforcollateralinUSDwithFedFundrates ......... 82
Fig. 6.2 Computationtimeratios(presentvalueandsensitivities
timetopresentvaluetime)forthefinitedifferenceand
AADmethods.Thevegarepresentsthederivativeswith
respecttotheSABRparameters;thedeltarepresentsthe
derivativeswithrespecttothecurves.TheAADmethod
usestheimplicitfunctionapproach.Figuresforannually
amortizedswaptionsinaLMMcalibratedtovanilla
swaptionsinvaluedwiththeSABRmodel ................. 90
Fig. 6.3 Representation of LMM calibration for a 2 years
amortised swaption. Each yearly volatility block is
multipliedbyacommonmultiplicativefactorandeach
yearlydisplacementblockcontainsthesamenumber.......... 94
Fig. 6.4 Computationtimeratios(priceandsensitivitiestimeto
pricetime)forthefinitedifferenceandAADmethods.
Thevegarepresentsthederivativeswithrespecttothe
SABRparameters;thedeltarepresentsthederivatives
with respect to the curves. The AAD method uses
theimplicitfunctionapproach.Figuresforannually
amortisedswaptionsinaLMMcalibratedyearlytothree
vanillaswaptionsinSABR ............................. 95
vii
viii ListofFigures
Fig. 6.5 Computationtimeratios(priceandsensitivitiestimeto
pricetime)forthefinitedifferenceandAADmethods.
Thevegarepresentsthederivativeswithrespecttothe
SABRparameters;thedeltarepresentsthederivatives
with respect to the curves. The AAD method uses
theimplicitfunctionapproach.Figuresforannually
amortisedswaptionsinaLMMcalibratedyearlytothe
givennumberofvanillaswaptionswithdifferentstrikes
inSABR........................................... 96
List of Tables
Table.2.1 The generic single assignment code for a function
computingasinglevalue .............................. 19
Table.2.2 Thegenericcodeforafunctioncomputingasingle
value and its standard algorithmic differentiation
pseudo-code ....................................... 20
Table.2.3 Thegenericcodeforafunctioncomputingasingle
valueanditsadjointalgorithmicdifferentiationcode ......... 23
Table.2.4 Computationtimefortheexamplefunctionandfour
derivatives ......................................... 25
Table.2.5 Thegenericcodeforafunctioncomputingasingle
valuewithanif statement ............................. 27
Table.2.6 Thegenericcodeforafunctioncomputingasingle
valueanditsalgorithmicdifferentiationcode ............... 27
Table.3.1 Computationtimefordifferentimplementationsofthe
Blackfunctionandfivederivatives(withrespectto
forward,volatility,numeraire,strike,andexpiry) ............ 35
Table.3.2 Computation time for the SABR price and eight
derivatives(withrespecttoforward,alpha,beta,rho,
nu,numeraire,strike,andexpiry) ....................... 40
Table.3.3 Computationtimeforthepresentvalueanddifferent
typeofsensitivities.Themulti-curvesethastwocurves
andatotalof30nodes ................................ 47
Table.4.1 TapeforthesimplefunctiondescribedinListing2.1 ......... 58
Table.4.2 Computationtimefortheexamplefunctionandfour
derivatives ......................................... 60
Table.4.3 Computation time for the Black function and five
derivatives ......................................... 61
Table.4.4 ComputationtimefortheSABRvolatilityfunctionand
sevenderivatives .................................... 61
ix
x ListofTables
Table.4.5 ComputationtimefortheSABRoptionpricefunction
andeightderivatives ................................. 62
Table.4.6 Computation time for the Black function and five
derivatives ......................................... 64
Table.4.7 ComputationtimefortheSABRpricefunctionand
eightderivatives .................................... 65
Table.6.1 Summarizedrepresentationofthedependencyofthe
EURwithcollateralinUSDFedFunddiscounting
curvetotheothercurvesoftheexample ................... 82
Table.6.2 Performancefordifferentapproachestoderivatives
computations:cashsettledswaptioninHull-Whiteone
factormodel........................................ 88
Table.6.3 Performancefordifferentapproachestoderivatives
computations:amortizedswaptionintheLMM ............. 89