//SYS21///INTEGRAS/ELS/PAGINATION/ELSEVIER UK/CMF/3B2/FINALS_21-11-03/PRELIMS.3D –1 – [1–14/14] 21.11.20032:55PM COMPUTATIONAL FINANCE //SYS21///INTEGRAS/ELS/PAGINATION/ELSEVIER UK/CMF/3B2/FINALS_21-11-03/PRELIMS.3D –2 – [1–14/14] 21.11.20032:55PM //SYS21///INTEGRAS/ELS/PAGINATION/ELSEVIER UK/CMF/3B2/FINALS_21-11-03/PRELIMS.3D –3 – [1–14/14] 21.11.20032:55PM COMPUTATIONAL FINANCE Numerical Methods for Pricing Financial Instruments George Levy AMSTERDAM BOSTON HEIDELBERG LONDON NEWYORK OXFORD PARIS SANDIEGO SANFRANCISCO SINGAPORE SYDNEY TOKYO //SYS21///INTEGRAS/ELS/PAGINATION/ELSEVIER UK/CMF/3B2/FINALS_21-11-03/PRELIMS.3D –4 – [1–14/14] 21.11.20032:55PM Butterworth-Heinemann Elsevier LinacreHouse,JordanHill,OxfordOX28DP 200WheelerRoad,Burlington,MA01803 Firstpublished2004 Copyright#2004,GeorgeLevy.Allrightsreserved TherightofGeorgeLevytobeidentifiedastheauthorofthiswork hasbeenassertedinaccordancewiththeCopyright,Designs andPatentsAct1988 Nopartofthispublicationmaybereproducedinanymaterialform(including photocopyingorstoringinanymediumbyelectronicmeansandwhether ornottransientlyorincidentallytosomeotheruseofthispublication)without thewrittenpermissionofthecopyrightholderexceptinaccordancewiththe provisionsoftheCopyright,DesignsandPatentsAct1988orunderthetermsof alicenceissuedbytheCopyrightLicensingAgencyLtd,90TottenhamCourtRoad, London,EnglandWIT4LP.Applicationsforthecopyrightholder’swritten permissiontoreproduceanypartofthispublicationshouldbeaddressed tothepublisher. PermissionsmaybesoughtdirectlyfromElsevier’sScienceandTechnology RightsDepartmentinOxford,UK.Phone:(þ44)(0)1865843830; fax:(þ44)(0)1865853333;e-mail:[email protected]. Youmayalsocompleteyourrequeston-lineviatheElsevierhomepage (http://www.elsevier.com),byselecting‘CustomerSupport’andthen‘Obtaining Permissions’ BritishLibraryCataloguinginPublicationData AcataloguerecordforthisbookisavailablefromtheBritishLibrary LibraryofCongressCataloguinginPublicationData AcataloguerecordforthisbookisavailablefromtheLibraryofCongress ISBN 0 7506 5722 7 For information on all Elsevier Butterworth-Heinemann publications visitourwebsiteatwww.bh.com TypesetbyIntegraSoftwareServicesPvt.Ltd,Pondicherry,India www.integra-india.com PrintedandboundinTheNetherlands //SYS21///INTEGRAS/ELS/PAGINATION/ELSEVIER UK/CMF/3B2/FINALS_21-11-03/PRELIMS.3D –5 – [1–14/14] 21.11.20032:55PM To Kathryn //SYS21///INTEGRAS/ELS/PAGINATION/ELSEVIER UK/CMF/3B2/FINALS_21-11-03/PRELIMS.3D –6 – [1–14/14] 21.11.20032:55PM //SYS21///INTEGRAS/ELS/PAGINATION/ELSEVIER UK/CMF/3B2/FINALS_21-11-03/PRELIMS.3D –7 – [1–14/14] 21.11.20032:55PM Contents Preface xi Part I Using NumericalSoftware Components within Microsoft Windows 1 1 Introduction 3 2 DynamicLink Libraries (DLLs) 6 2.1 Visual Basicand ExcelVBA 6 2.2 VB.NET 16 2.3 C# 21 3 ActiveX andCOM 28 3.1 Introduction 28 3.2 The COM interface IDispatch 30 3.3 Type libraries 31 3.4 Using IDispatch 31 3.5 ActiveX controls and the Internet 33 3.6 Using ActiveX components on a Web page 34 4 Afinancial derivative pricing example 38 4.1 Interactive user-interface 38 4.2 Languageuser-interface 38 4.3 Use within Delphi 41 5 ActiveX components and numerical optimization 44 5.1 Ray tracing example 44 5.2 Portfolio allocation example 49 5.3 Numerical optimization within Microsoft Excel 51 6 XML and transformation using XSL 54 6.1 Introduction 54 6.2 XML 55 //SYS21///INTEGRAS/ELS/PAGINATION/ELSEVIER UK/CMF/3B2/FINALS_21-11-03/PRELIMS.3D –8 – [1–14/14] 21.11.20032:55PM viii Contents 6.3 XML schema 57 6.4 XSL 59 6.5 Stock market data example 60 7 Epilogue 64 7.1 Wrapping Cwith Cþþ forOO numerics in.NET 64 7.2 Final remarks 73 PartII Pricing Assets 75 8 Introduction 77 8.1 Anintroduction to options andderivatives 77 8.2 Brownian motion 78 8.3 ABrownian model ofasset price movements 81 8.4 Ito’s lemma in one dimension 83 8.5 Ito’s lemma in manydimensions 84 9 Analytic methods and single asset Europeanoptions 87 9.1 Introduction 87 9.2 Put–callparity 88 9.3 Vanillaoptions and the Black–Scholes model 90 9.4 Barrieroptions 110 10 Numeric methodsand singleasset American options 116 10.1 Introduction 116 10.2 Perpetual options 116 10.3 Approximations forvanillaAmerican options 121 10.4 Lattice methods forvanillaoptions 137 10.5 Implied lattice methods 159 10.6 Grid methods forvanillaoptions 177 10.7 PricingAmerican optionsusing a stochastic lattice 212 11 Monte Carlosimulation 221 11.1 Introduction 221 11.2 Pseudorandom and quasirandom sequences 222 11.3 Generation of multivariate distributions: independentvariates 229 11.4 Generation of multivariate distributions: correlated variates 234 12 MultiassetEuropean and American options 247 12.1 Introduction 247 12.2 The multiasset Black–Scholes equation 247 12.3 Multidimensional Monte Carlo methods 248 12.4 Multidimensional lattice methods 253 12.5 Two asset options 257 //SYS21///INTEGRAS/ELS/PAGINATION/ELSEVIER UK/CMF/3B2/FINALS_21-11-03/PRELIMS.3D –9 – [1–14/14] 21.11.20032:55PM Contents ix 12.6 Three asset options 267 12.7 Four asset options 272 13 Dealingwith missingdata 274 13.1 Introduction 274 13.2 Iterative multiple linear regression, MREG 275 13.3 The EM algorithm 278 Part III Financial Econometrics 285 14 Introduction 287 14.1 Assetreturns 289 14.2 Nonsynchronoustrading 291 14.3 Bid-ask spread 293 14.4 Models of volatility 294 14.5 Stochastic autoregressive volatility, ARV 296 14.6 Generalized hyperbolic Levy motion 297 15 GARCHmodels 301 15.1 Box Jenkins models 301 15.2 Gaussian Linear GARCH 303 15.3 The IGARCHmodel 309 15.4 The GARCH-M model 309 15.5 Regression-GARCH and AR-GARCH 310 16 Nonlinear GARCH 311 16.1 AGARCH-I 313 16.2 AGARCH-II 316 16.3 GJR–GARCH 317 17 GARCHconditional probabilitydistributions 319 17.1 Gaussian distribution 319 17.2 Student’s tdistribution 321 17.3 General error distribution 323 18 Maximum likelihoodparameter estimation 327 18.1 The conditionallog likelihood 327 18.2 The covariance matrix ofthe parameter estimates 328 18.3 Numerical optimization 332 18.4 Scaling the data 334 19 Analytic derivativesof thelog likelihood 336 19.1 The first derivatives 336 19.2 The second derivatives 339