g r o . d a o l n w o d - s k o o b e - e e r f . w w w Computational Finance Using C and C# g r o . d a o l n w o d - s k o o b e - e e r f . w w w Quantitative Finance Series Aims and Objectives • Booksbasedontheworkoffinancialmarketpractitionersandacademics • Presentingcutting-edgeresearchtotheprofessional/practitionermarket • Combiningintellectualrigourandpracticalapplication • Coveringtheinteractionbetweenmathematicaltheoryandfinancialpractice • Toimproveportfolioperformance,riskmanagementandtradingbookperformance • Coveringquantitativetechniques Market Brokers/Traders; Actuaries; Consultants; Asset Managers; Fund Managers; Regula- tors;CentralBankers;TreasuryOfficials;TechnicalAnalysis;andAcademicsforMas- tersinFinanceandMBAmarket. Series Titles ComputationalFinanceUsingCandC# TheAnalyticsofRiskModelValidation ForecastingExpectedReturnsintheFinancialMarkets CorporateGovernanceandRegulatoryImpactonMergersandAcquisitions InternationalMergersandAcquisitionsActivitySince1990 ForecastingVolatilityintheFinancialMarkets,ThirdEdition VentureCapitalinEurope FundsofHedgeFunds InitialPublicOfferings LinearFactorModelsinFinance ComputationalFinance AdvancesinPortfolioConstructionandImplementation AdvancedTradingRules,SecondEdition RealR&DOptions PerformanceMeasurementinFinance EconomicsforFinancialMarkets ManagingDownsideRiskinFinancialMarkets DerivativeInstruments:Theory,Valuation,Analysis ReturnDistributionsinFinance Series Editor: Dr Stephen Satchell Dr Satchell is Reader in Financial Econometrics at Trinity College, Cambridge; Visiting Professor at Birkbeck College, City University Business School and Univer- sity of Technology, Sydney. He also works in a consultative capacity to many firms, andeditsthejournalDerivatives:use,tradingandregulationsandtheJournalofAsset Management. Computational Finance Using C and C# George Levy AMSTERDAM•BOSTON•HEIDELBERG•LONDON•NEWYORK OXFORD•PARIS•SANDIEGO•SANFRANCISCO•SINGAPORE SYDNEY•TOKYO AcademicPressisanimprintofElsevier CoverimagecourtesyofiStockphoto AcademicPressisanimprintofElsevier 30CorporateDrive,Suite400,Burlington,MA01803,USA 525BStreet,Suite1900,SanDiego,California92101-4495,USA 84Theobald’sRoad,LondonWC1X8RR,UK Copyright©2008,ElsevierLtd.Allrightsreserved. No part of this publication may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopy, recording, or any information storageandretrievalsystem,withoutpermissioninwritingfromthepublisher. PermissionsmaybesoughtdirectlyfromElsevier’sScience&TechnologyRights DepartmentinOxford,UK:phone:(+44)1865843830,fax:(+44)1865853333, E-mail:[email protected] viatheElsevierhomepage(http://elsevier.com),byselecting“Support&Contact” then“CopyrightandPermission”andthen“ObtainingPermissions.” LibraryofCongressCataloging-in-PublicationData Levy,George. ComputationalFinanceUsingCandC#/GeorgeLevy. p.cm.–(Quantitativefinance) Includesbibliographicalreferencesandindex. ISBN-13:978-0-7506-6919-1(alk.paper)1.Finance-Mathematicalmodels.I.Title. HG106.L4842008 332.0285’5133-dc22 2008000470 BritishLibraryCataloguing-in-PublicationData AcataloguerecordforthisbookisavailablefromtheBritishLibrary. ForinformationonallAcademicPresspublications visitourWebsiteatwww.books.elsevier.com PrintedintheUnitedStatesofAmerica 08 09 10 11 9 8 7 6 5 4 3 2 1 To my parents Paul and Paula Thispageintentionallyleftblank Contents Preface xi 1 Overviewoffinancialderivatives 1 2 Introductiontostochasticprocesses 5 2.1 Brownianmotion 5 2.2 ABrownianmodelofassetpricemovements 9 2.3 Ito’sformula(orlemma) 10 2.4 Girsanov’stheorem 12 2.5 Ito’slemmaformultiassetgeometricBrownianmotion 13 2.6 Itoproductandquotientrulesintwodimensions 15 2.7 Itoproductinndimensions 18 2.8 TheBrownianbridge 19 2.9 Time-transformedBrownianmotion 21 2.10 Ornstein–Uhlenbeckprocess 24 2.11 TheOrnstein–Uhlenbeckbridge 27 2.12 Otherusefulresults 31 2.13 Selectedproblems 33 3 Generationofrandomvariates 37 3.1 Introduction 37 3.2 Pseudo-randomandquasi-randomsequences 38 3.3 Generationofmultivariatedistributions:independentvariates 41 3.4 Generationofmultivariatedistributions:correlatedvariates 47 4 Europeanoptions 59 4.1 Introduction 59 4.2 Pricingderivativesusingamartingalemeasure 59 4.3 Putcallparity 60 4.4 VanillaoptionsandtheBlack–Scholesmodel 62 4.5 Barrieroptions 85 5 SingleassetAmericanoptions 97 5.1 Introduction 97 5.2 ApproximationsforvanillaAmericanoptions 97 5.3 Latticemethodsforvanillaoptions 114 viii ComputationalFinanceUsingCandC# 5.4 Gridmethodsforvanillaoptions 135 5.5 PricingAmericanoptionsusingastochasticlattice 172 6 Multiassetoptions 181 6.1 Introduction 181 6.2 ThemultiassetBlack–Scholesequation 181 6.3 MultidimensionalMonteCarlomethods 183 6.4 Introductiontomultidimensionallatticemethods 185 6.5 Twoassetoptions 190 6.6 Threeassetoptions 201 6.7 Fourassetoptions 205 7 Otherfinancialderivatives 209 7.1 Introduction 209 7.2 Interestratederivatives 209 7.3 Foreignexchangederivatives 228 7.4 Creditderivatives 232 7.5 Equityderivatives 237 8 C#portfoliopricingapplication 245 8.1 Introduction 245 8.2 Storingandretrievingthemarketdata 254 8.3 ThePricingUtilsclassandtheAnalytics_MathLib 262 8.4 Equitydealclasses 267 8.5 FXdealclasses 280 AppendixA: TheGreeksforvanillaEuropeanoptions 289 A.1 Introduction 289 A.2 Gamma 290 A.3 Delta 291 A.4 Theta 292 A.5 Rho 293 A.6 Vega 294 AppendixB: Barrieroptionintegrals 295 B.1 Thedownandoutcall 295 B.2 Theupandoutcall 298 AppendixC: Standardstatisticalresults 303 C.1 Thelawoflargenumbers 303 C.2 Thecentrallimittheorem 303 C.3 Thevarianceandcovarianceofrandomvariables 305 C.4 Conditionalmeanandcovarianceofnormaldistributions 310 C.5 Momentgeneratingfunctions 311 Contents ix AppendixD: Statisticaldistributionfunctions 313 D.1 Thenormal(Gaussian)distribution 313 D.2 Thelognormaldistribution 315 D.3 TheStudent’st distribution 317 D.4 Thegeneralerrordistribution 319 AppendixE: Mathematicalreference 321 E.1 Standardintegrals 321 E.2 Gammafunction 321 E.3 Thecumulativenormaldistributionfunction 322 E.4 Arithmeticandgeometricprogressions 323 AppendixF: Black–Scholesfinite-differenceschemes 325 F.1 Thegeneralcase 325 F.2 Thelogtransformationandauniformgrid 325 AppendixG: TheBrownianbridge:alternativederivation 329 AppendixH: Brownianmotion:moreresults 333 H.1 SomeresultsconcerningBrownianmotion 333 H.2 ProofofEq.(H.1.2) 334 H.3 ProofofEq.(H.1.4) 335 H.4 ProofofEq.(H.1.5) 335 H.5 ProofofEq.(H.1.6) 335 H.6 ProofofEq.(H.1.7) 338 H.7 ProofofEq.(H.1.8) 338 H.8 ProofofEq.(H.1.9) 338 H.9 ProofofEq.(H.1.10) 339 AppendixI: TheFeynman–Kacformula 341 AppendixJ: Answerstoproblems 343 J.1 Problem1 343 J.2 Problem2 344 J.3 Problem3 345 J.4 Problem4 346 J.5 Problem5 346 J.6 Problem6 347 J.7 Problem7 348 J.8 Problem8 350 J.9 Problem9 350 J.10 Problem10 352 J.11 Problem11 354 References 355 Index 361
Description: