# Applications to Finance Monte Carlo Simulation

Hui Wang Monte Carlo Simulation with Applications to Finance Monte Carlo Simulation with Applications to Finance CHAPMAN & HALL/CRC Financial Mathematics Series Aims and scope: The field of financial mathematics forms an ever-expanding slice of the financial sector. This series aims to capture new developments and summarize what is known over the whole spectrum of this field. It will include a broad range of textbooks, reference works and handbooks that are meant to appeal to both academics and practitioners. The inclusion of numerical code and concrete realworld examples is highly encouraged. Series Editors M.A.H. Dempster Dilip B. Madan Rama Cont Centre for Financial Research Department of Pure Mathematics and Statistics University of Cambridge Robert H. Smith School of Business University of Maryland Center for Financial Engineering Columbia University New York Published Titles American-Style Derivatives; Valuation and Computation, Jerome Detemple Analysis, Geometry, and Modeling in Finance: Advanced Methods in Option Pricing, Pierre Henry-Labordère An Introduction to Exotic Option Pricing, Peter Buchen Credit Risk: Models, Derivatives, and Management, Niklas Wagner Engineering BGM, Alan Brace Financial Modelling with Jump Processes, Rama Cont and Peter Tankov Interest Rate Modeling: Theory and Practice, Lixin Wu Introduction to Credit Risk Modeling, Second Edition, Christian Bluhm, Ludger Overbeck, and Christoph Wagner Introduction to Stochastic Calculus Applied to Finance, Second Edition, Damien Lamberton and Bernard Lapeyre Monte Carlo Methods and Models in Finance and Insurance, Ralf Korn, Elke Korn, and Gerald Kroisandt Monte Carlo Simulation with Applications to Finance, Hui Wang Numerical Methods for Finance, John A. D. Appleby, David C. Edelman, and John J. H. Miller Option Valuation: A First Course in Financial Mathematics, Hugo D. Junghenn Portfolio Optimization and Performance Analysis, Jean-Luc Prigent Quantitative Fund Management, M. A. H. Dempster, Georg Pflug, and Gautam Mitra Risk Analysis in Finance and Insurance, Second Edition, Alexander Melnikov Robust Libor Modelling and Pricing of Derivative Products, John Schoenmakers Stochastic Finance: A Numeraire Approach, Jan Vecer Stochastic Financial Models, Douglas Kennedy Structured Credit Portfolio Analysis, Baskets & CDOs, Christian Bluhm and Ludger Overbeck Understanding Risk: The Theory and Practice of Financial Risk Management, David Murphy Unravelling the Credit Crunch, David Murphy Proposals for the series should be submitted to one of the series editors above or directly to: CRC Press, Taylor & Francis Group 4th, Floor, Albert House 1-4 Singer Street London EC2A 4BQ UK Monte Carlo Simulation with Applications to Finance Hui Wang Brown University Providence, Rhode Island, USA MATLAB® is a trademark of The MathWorks, Inc. and is used with permission. The MathWorks does not warrant the accuracy of the text or exercises in this book. This book’s use or discussion of MATLAB® software or related products does not constitute endorsement or sponsorship by The MathWorks of a particular pedagogical approach or particular use of the MATLAB® software. CRC Press Taylor & Francis Group 6000 Broken Sound Parkway NW, Suite 300 Boca Raton, FL 33487-2742 © 2012 by Taylor & Francis Group, LLC CRC Press is an imprint of Taylor & Francis Group, an Informa business No claim to original U.S. Government works Version Date: 20120518 International Standard Book Number-13: 978-1-4665-6690-3 (eBook – PDF) This book contains information obtained from authentic and highly regarded sources. Reasonable efforts have been made to publish reliable data and information, but the author and publisher cannot assume responsibility for the validity of all materials or the consequences of their use. The authors and publishers have attempted to trace the copyright holders of all material reproduced in this publication and apologize to copyright holders if permission to publish in this form has not been obtained. If any copyright material has not been acknowledged please write and let us know so we may rectify in any future reprint. Except as permitted under U.S. Copyright Law, no part of this book may be reprinted, reproduced, transmitted, or utilized in any form by any electronic, mechanical, or other means, now known or hereafter invented, including photocopying, microfilming, and recording, or in any information storage or retrieval system, without written permission from the publishers. For permission to photocopy or use material electronically from this work, please access www.copyright.com (http://www.copyright.com/) or contact the Copyright Clearance Center, Inc. (CCC), 222 Rosewood Drive, Danvers, MA 01923, 978-750-8400. CCC is a not-for-profit organization that provides licenses and registration for a variety of users. For organizations that have been granted a photocopy license by the CCC, a separate system of payment has been arranged. Trademark Notice: Product or corporate names may be trademarks or registered trademarks, and are used only for identification and explanation without intent to infringe. Visit the Taylor & Francis Web site at http://www.taylorandfrancis.com and the CRC Press Web site at http://www.crcpress.com Preface This book can serve as the text for a one-semester course on Monte Carlo simulation. The intended audience is advanced undergraduate students or students in master’s programs who wish to learn the basics of this exciting topic and its applications to finance. The book is largely self-contained. The only prerequisite is some experience with probability and statistics. Prior knowledge on option pricing is helpful but not essential. As in any study of Monte Carlo simulation, coding is an integral part and cannot be ignored. The book contains a large number of MATLAB R coding exercises. They are designed in a progressive manner so that no prior experience with MATLAB is required. Much of the mathematics in the book is informal. For example, random variables are simply defined to be functions on the sample space, even though they should be measurable with respect to appropriate σ -algebras; exchanging the order of integrations is carried out liberally, even though it should be justified by the Tonelli–Fubini Theorem. The motivation for doing so is to avoid the technical measure theoretic jargon, which is of little concern in practice and does not help much to further the understanding of the topic. The book is an extension of the lecture notes that I have developed for an undergraduate course on Monte Carlo simulation at Brown University. I would like to thank the students who have taken the course, as well as the Division of Applied Mathematics at Brown, for their support. Hui Wang Providence, Rhode Island January, 2012 vi MATLAB R is a trademark of The MathWorks, Inc. For product information, please contact: The MathWorks, Inc. 3 Apple Hill Drive Natick, MA 01760-2098 USA Tel: 508 647 7000 Fax: 508-647-7001 E-mail: info@mathworks.com Web: www.mathworks.com Contents 1 Review of Probability 1.1 Probability Space . . . . . . . . . . . . . . . 1.2 Independence and Conditional Probability 1.3 Random Variables . . . . . . . . . . . . . . . 1.4 Random Vectors . . . . . . . . . . . . . . . . 1.5 Conditional Distributions . . . . . . . . . . 1.6 Conditional Expectation . . . . . . . . . . . 1.7 Classical Limit Theorems . . . . . . . . . . . Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1 2 6 13 18 21 23 25 2 Brownian Motion 2.1 Brownian Motion . . . . . . . . . . . . . . 2.2 Running Maximum of Brownian Motion . 2.3 Derivatives and Black–Scholes Prices . . . 2.4 Multidimensional Brownian Motions . . . Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 31 33 35 43 45 3 Arbitrage Free Pricing 3.1 Arbitrage Free Principle . . . . . . 3.2 Asset Pricing with Binomial Trees . 3.3 The Black–Scholes Model . . . . . Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 51 53 61 64 4 Monte Carlo Simulation 4.1 Basics of Monte Carlo Simulation . . . . 4.2 Standard Error and Confidence Interval 4.3 Examples of Monte Carlo Simulation . . 4.4 Summary . . . . . . . . . . . . . . . . . . Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 67 69 72 80 82 . . . . . . . . viii CONTENTS 5 Generating Random Variables 5.1 Inverse Transform Method . . . . . . . . . . . 5.2 Acceptance-Rejection Method . . . . . . . . . 5.3 Sampling Multivariate Normal Distributions Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 87 90 93 98 6 Variance Reduction Techniques 6.1 Antithetic Sampling . . . . . 6.2 Control Variates . . . . . . . 6.3 Stratified Sampling . . . . . Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103 103 109 115 125 . . . . 133 133 144 164 173 . . . . . . 183 184 188 194 197 200 202 . . . . . . 205 205 207 208 209 211 232 10 Sensitivity Analysis 10.1 Commonly Used Greeks . . . . . . . . . . . . . . . . . . . . . 10.2 Monte Carlo Simulation of Greeks . . . . . . . . . . . . . . . Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237 238 239 253 A Multivariate Normal Distributions 257 . . . . . . . . . . . . . . . . . . . . 7 Importance Sampling 7.1 Basic Ideas of Importance Sampling 7.2 The Cross-Entropy Method . . . . . 7.3 Applications to Risk Analysis . . . . Exercises . . . . . . . . . . . . . . . . . . . 8 Stochastic Calculus 8.1 Stochastic Integrals . . . . . . . . 8.2 Itô Formula . . . . . . . . . . . . 8.3 Stochastic Differential Equations 8.4 Risk-Neutral Pricing . . . . . . . 8.5 Black–Scholes Equation . . . . . Exercises . . . . . . . . . . . . . . . . . 9 Simulation of Diffusions 9.1 Euler Scheme . . . . . . . . . . . 9.2 Eliminating Discretization Error . 9.3 Refinements of Euler Scheme . . 9.4 The Lamperti Transform . . . . . 9.5 Numerical Examples . . . . . . . Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . CONTENTS ix B American Option Pricing 259 B.1 The Value of an American Option . . . . . . . . . . . . . . . . 259 B.2 Dynamic Programming and Binomial Trees . . . . . . . . . . 261 B.3 Diffusion Models: Binomial Approximation . . . . . . . . . . 264 C Option Pricing Formulas 269 Bibliography 277 Index 280 This page intentionally left blank Chapter 1 Review of Probability Probability theory is the essential mathematical tool for the design and analysis of Monte Carlo simulation schemes. It is assumed that the reader is somewhat familiar with the elementary probability concepts such as random variables and multivariate probability distributions. However, for the sake of completeness, we use this chapter to collect a number of basic results from probability theory that will be used repeatedly in the rest of the book. 1.1 Probability Space In probability theory, sample space is the collection of all possible outcomes. Throughout the book, the sample space will be denoted by Ω. A generic element of the sample space represents a possible outcome and is called a sample point. A subset of the sample space is called an event. 1. The empty set is denoted by ∅. 2. The complement of an event A is denoted by Ac . 3. The intersection of events A and B is denoted by A ∩ B or simply AB. 4. The union of events A and B is denoted by A ∪ B. A probability measure P on Ω is a mapping from the events of Ω to the real line R that satisfies the following three axioms: (i) P(Ω) = 1. 2 CHAPTER 1. REVIEW OF PROBABILITY (ii) 0 ≤ P( A ) ≤ 1 for every event A. (iii) For every sequence of mutually exclusive events { A1 , A2 , . . .}, that is, Ai ∩ A j = ∅ for all i 6 = j, ∞ P (∪∞ n=1 A n ) = ∑ P ( An ) . n=1 Lemma 1.1. Let P be a probability measure. Then the following statements hold. 1. P( A ) + P( Ac ) = 1 for any event A. 2. P( A ∪ B ) = P( A ) + P( B ) − P( AB ) for any events A and B. More generally, P( A1 ∪ · · · ∪ An ) = ∑ P( Ai ) − ∑ P( Ai A j ) + ∑ i i< j P( Ai A j Ak ) i< j< k + · · · + (− 1)n+1 P( A1 · · · An ) for an arbitrary collection of events A1 , . . . , An. This lemma follows immediately from the three axioms. We leave the proof to the reader as an exercise. 1.2 Independence and Conditional Probability Two events A and B are said to be independent if P( AB ) = P( A ) · P( B). More generally, a collection of events A1 , A2 , · · · , An are said to be independent if P ( A k1 A k2 · · · A km ) = P ( A k1 ) · P ( A k2 ) · · · · · P ( A km ) for any 1 ≤ k1 < k2 < . . . < km ≤ n. Lemma 1.2. Suppose that events A and B are independent. Then so are events Ac and B, A and Bc , and Ac and Bc . Similar results hold for an arbitrary collection of independent events. P ROOF. Consider the events Ac and B. Since ( Ac B ) and ( AB ) are disjoint and ( Ac B ) ∪ ( AB ) = B, it follows that P( Ac B ) + P( AB ) = P( B ) . 3 1.2. INDEPENDENCE AND CONDITIONAL PROBABILITY By the independence of A and B, P( AB ) = P( A )P( B). Therefore, P( Ac B ) = = = = P( B ) − P( AB ) P ( B ) − P ( A ) P ( B) P( B )[1 − P( A )] P ( B )P ( A c) . In other words, Ac and B are independent. The proof for other cases is similar and thus omitted. Consider two events A and B with P( B ) > 0. The conditional probability of A given B is defined to be P( A | B) = P( AB ) . P( B ) (1.1) When P( B ) = 0, the conditional probability P( A | B) is undefined. However, it is always true that P( AB ) = P( A | B)P( B), where the right-hand-side is defined to be 0 as long as P( B ) = 0. Lemma 1.3. Given any event B with P( B ) > 0, the following statements hold. 1. An event A is independent of B if and only if P( A | B) = P( A ). 2. For any disjoint events A and C, P( A ∪ C | B) = P( A | B) + P( C | B) . 3. For any events A1 and A2 , P( A1 A2 | B ) = P( A1 | B ) · P( A2 | A1 B ) . P ROOF. All these claims follow directly from the definition (1.1). We should only give the proof of (3). The right-hand-side equals P( A1 B ) P( A1 A2 B ) P( A1 A2 B ) · = , P( B ) P( A1 B ) P( B ) which equals the left-hand-side. We complete the proof. 4 CHAPTER 1. REVIEW OF PROBABILITY Theorem 1.4. (Law of Total Probability). Suppose that { Bn } is a partition of the sample space, that is, { Bn } are mutually exclusive and ∪ n Bn = Ω. Then for any event A, P( A ) = ∑ P( A | Bn )P( Bn ) . n P ROOF. Observe that { ABn} are disjoint events and ∪ n ABn = A. It follows that P( A ) = ∑ P( ABn) = ∑ P( A | Bn)P( Bn ) . n n We complete the proof. Example 1.1. An investor has purchased bonds from five S&P AAA-rated banks and three S&P A-rated banks. S&P rating Probability AAA 1 AA 4 A 12 BBB 50 BB 300 B 1100 CCC 2800 Annual default probability in basis points, 100 basis points = 1% Assuming that all these banks are independent, what is the probability that (a) at least one of the banks default? (b) exactly one bank defaults? S OLUTION : The probability that at least one of the banks default equals 1 − P(none of the banks default) = 1 − ( 1 − 0.0001)5 · ( 1 − 0.0012)3 = 1 − 0.99995 · 0.99883 = 40.94 bps. Observe that there are five equally likely ways that exactly one AAA-rated bank defaults and three equally likely ways that exactly one A-rated bank defaults. Hence, the probability that exactly one bank defaults equals 5 · 0.99994 · 0.0001 · 0.99883 + 3 · 0.99995 · 0.99882 · 0.0012 = 40.88 bps. The answers to (a) and (b) are nearly identical because the probability that more than one bank will default is negligible. 1.2. INDEPENDENCE AND CONDITIONAL PROBABILITY 5 Example 1.2. A technical analyst has developed a simple model that uses the data from previous two days to predict the stock price movement of the following day. Let “+” and “−” denote the stock price movement in a trading day: “ + ” = stock price moves up or remains unchanged, “ − ” = stock price moves down. Below is the probability distribution. (Yesterday, today) (+ , +) (− , +) (+ , −) (− , −) Tomorrow + − 0.2 0.8 0.4 0.6 0.7 0.3 0.5 0.5 Assume that the stock price movements yesterday and today are (− , +). Compute the probability that the stock price movement will be “+” for (a) tomorrow, (b) the day after tomorrow. S OLUTION : Define the following events: A1 = stock price movement tomorrow is “+”, A2 = stock price movement the day after tomorrow is “+”, B = stock price movements yesterday and today are (− , +). Then the probability that the stock price movement tomorrow will be “+” is P( A1 | B ) = P(+|−, +) = 0.4. By Lemma 1.3, the probability that the stock price movement the day after tomorrow will be “+” is P( A2 | B ) = = = = = P( A1 A2 | B ) + P( Ac1 A2 | B ) P( A1 | B ) · P( A2 | A1 B ) + P( Ac1 | B ) · P( A2 | Ac1 B ) P(+|−, +) · P(+|+, +) + P(−|−, +) · P(+|+, −) 0.4 × 0.2 + 0.6 × 0.7 0.5. 6 CHAPTER 1. REVIEW OF PROBABILITY 1.3 Random Variables A random variable is a mapping from the sample space to the real line R. The cumulative distribution function (cdf) of a random variable X is defined by F ( x ) = P( X ≤ x ) for every x ∈ R. It is always nondecreasing and continuous from the right. Furthermore, lim F ( x ) = 0, lim F ( x ) = 1. x→−∞ 1.3.1 x→+∞ Discrete Random Variables A random variable is said to be discrete if it can assume at most countably many possible values. Suppose that { x1, x2 , · · · } is the set of all possible values of a random variable X. The function p ( xi) = P( X = xi ) , i = 1, 2, · · · is called the probability mass function of X. The expected value (or expectation, mean) of X is defined to be E [ X ] = ∑ xi p ( xi ). i More generally, given any function h : R → R, the expected value of the random variable h ( X) is given by E [ h( X )] = ∑ h ( xi) p ( xi) . i While the expected value measures the average of a random variable, the most common measure of the variability of a random variable is the variance, which is defined by Var[ X] = E [( X − E [ X ])2 ] = E [ X2 ] − ( E [ X ])2. The standard deviation of X is just the square root of the variance: q Std[ X] = Var[ X]. Among the most frequently used discrete random variables are Bernoulli random variables, binomial random variables, and Poisson random variables. 7 1.3. RANDOM VARIABLES 1. Bernoulli with parameter p. A random variable X that takes values in { 0, 1} and P( X = 1 ) = p, P( X = 0 ) = 1 − p. E [ X ] = p, Var[ X] = p ( 1 − p ) . 2. Binomial with parameters ( n, p ). A random variable X that takes values in { 0, 1, . . . , n } and n P( X = k ) = pk ( 1 − p )n−k . k E [ X] = np, Var[ X] = np ( 1 − p ) . 3. Poisson with parameter λ….

Purchase answer to see full attachment