Handbook in Monte Carlo Simulation - Paolo Brandimarte - E-Book

Handbook in Monte Carlo Simulation E-Book

Paolo Brandimarte

0,0
139,99 €

oder
-100%
Sammeln Sie Punkte in unserem Gutscheinprogramm und kaufen Sie E-Books und Hörbücher mit bis zu 100% Rabatt.
Mehr erfahren.
Beschreibung

An accessible treatment of Monte Carlo methods, techniques, and applications in the field of finance and economics Providing readers with an in-depth and comprehensive guide, the Handbook in Monte Carlo Simulation: Applications in Financial Engineering, Risk Management, and Economics presents a timely account of the applicationsof Monte Carlo methods in financial engineering and economics. Written by an international leading expert in thefield, the handbook illustrates the challenges confronting present-day financial practitioners and provides various applicationsof Monte Carlo techniques to answer these issues. The book is organized into five parts: introduction andmotivation; input analysis, modeling, and estimation; random variate and sample path generation; output analysisand variance reduction; and applications ranging from option pricing and risk management to optimization. The Handbook in Monte Carlo Simulation features: * An introductory section for basic material on stochastic modeling and estimation aimed at readers who may need a summary or review of the essentials * Carefully crafted examples in order to spot potential pitfalls and drawbacks of each approach * An accessible treatment of advanced topics such as low-discrepancy sequences, stochastic optimization, dynamic programming, risk measures, and Markov chain Monte Carlo methods * Numerous pieces of R code used to illustrate fundamental ideas in concrete terms and encourage experimentation The Handbook in Monte Carlo Simulation: Applications in Financial Engineering, Risk Management, and Economics is a complete reference for practitioners in the fields of finance, business, applied statistics, econometrics, and engineering, as well as a supplement for MBA and graduate-level courses on Monte Carlo methods and simulation.

Sie lesen das E-Book in den Legimi-Apps auf:

Android
iOS
von Legimi
zertifizierten E-Readern

Seitenzahl: 888

Veröffentlichungsjahr: 2014

Bewertungen
0,0
0
0
0
0
0
Mehr Informationen
Mehr Informationen
Legimi prüft nicht, ob Rezensionen von Nutzern stammen, die den betreffenden Titel tatsächlich gekauft oder gelesen/gehört haben. Wir entfernen aber gefälschte Rezensionen.



Contents

Cover

Half Title page

Title page

Copyright page

Preface

Part One: Overview and Motivation

Chapter One: Introduction to Monte Carlo Methods

1.1 Historical origin of Monte Carlo simulation

1.2 Monte Carlo simulation vs. Monte Carlo sampling

1.3 System dynamics and the mechanics of Monte Carlo simulation

1.4 Simulation and optimization

1.5 Pitfalls in Monte Carlo simulation

1.6 Software tools for Monte Carlo simulation

1.7 Prerequisites

For further reading

References

Chapter Two: Numerical Integration Methods

2.1 Classical quadrature formulas

2.2 Gaussian quadrature

2.3 Extension to higher dimensions: Product rules

2.4 Alternative approaches for high-dimensional integration

2.5 Relationship with moment matching

2.6 Numerical integration in R

For further reading

References

Part Two: Input Analysis: Modeling and Estimation

Chapter Three: Stochastic Modeling in Finance and Economics

3.1 Introductory examples

3.2 Some common probability distributions

3.3 Multivariate distributions: Covariance and correlation

3.4 Modeling dependence with copulas

3.5 Linear regression models: A probabilistic view

3.6 Time series models

3.7 Stochastic differential equations

3.8 Dimensionality reduction

3.9 Risk-neutral derivative pricing

For further reading

References

Chapter Four: Estimation and Fitting

4.1 Basic inferential statistics in R

4.2 Parameter estimation

4.3 Checking the fit of hypothetical distributions

4.4 Estimation of linear regression models by ordinary least squares

4.5 Fitting time series models

4.6 Subjective probability: The Bayesian view

For further reading

References

Part Three: Sampling and Path Generation

Chapter Five: Random Variate Generation

5.1 The structure of a Monte Carlo simulation

5.2 Generating pseudorandom numbers

5.3 The inverse transform method

5.4 The acceptance-rejection method

5.5 Generating normal variates

5.6 Other ad hoc methods

5.7 Sampling from copulas

For further reading

References

Chapter Six: Sample Path Generation for Continuous-Time Models

6.1 Issues in path generation

6.2 Simulating geometric Brownian motion

6.3 Sample paths of short-term interest rates

6.4 Dealing with stochastic volatility

6.5 Dealing with jumps

For further reading

References

Part Four: Output Analysis and Efficiency Improvement

Chapter Seven: Output Analysis

7.1 Pitfalls in output analysis

7.2 Setting the number of replications

7.3 A world beyond averages

7.4 Good and bad news

For further reading

References

Chapter Eight: Variance Reduction Methods

8.1 Antithetic sampling

8.2 Common random numbers

8.3 Control variates

8.4 Conditional Monte Carlo

8.5 Stratified sampling

8.6 Importance sampling

For further reading

References

Chapter Nine: Low-Discrepancy Sequences

9.1 Low-discrepancy sequences

9.2 Halton sequences

9.3 Sobol low-discrepancy sequences

9.4 Randomized and scrambled low-discrepancy sequences

9.5 Sample path generation with low-discrepancy sequences

For further reading

References

Part Five: Miscellaneous Applications

Chapter Ten: Optimization

10.1 Classification of optimization problems

10.2 Optimization model building

10.3 Monte Carlo methods for global optimization

10.4 Direct search and simulation-based optimization methods

10.5 Stochastic programming models

10.6 Stochastic dynamic programming

10.7 Numerical dynamic programming

10.8 Approximate dynamic programming

For further reading

References

Chapter Eleven: Option Pricing

11.1 European-style multidimensional options in the BSM world

11.2 European-style path-dependent options in the BSM world

11.3 Pricing options with early exercise features

11.4 A look outside the BSM world: Equity options under the Heston model

11.5 Pricing interest rate derivatives

For further reading

References

Chapter Twelve: Sensitivity Estimation

12.1 Estimating option greeks by finite differences

12.2 Estimating option greeks by pathwise derivatives

12.3 Estimating option greeks by the likelihood ratio method

For further reading

References

Chapter Thirteen: Risk Measurement and Management

13.1 What is a risk measure?

13.2 Quantile-based risk measures: Value-at-risk

13.3 Issues in Monte Carlo estimation of V@R

13.4 Variance reduction methods for V@R

13.5 Mean–risk models in stochastic programming

13.6 Simulating delta hedging strategies

13.7 The interplay of financial and nonfinancial risks

For further reading

References

Chapter Fourteen: Markov Chain Monte Carlo and Bayesian Statistics

14.1 Acceptance–rejection sampling in Bayesian statistics

14.2 An introduction to Markov chains

14.3 The Metropolis–Hastings algorithm

14.4 A re-examination of simulated annealing

For further reading

References

Index

Handbook in Monte Carlo Simulation

Copyright © 2014 by John Wiley & Sons, Inc. All rights reserved.

Published by John Wiley & Sons, Inc., Hoboken, New Jersey. All rights reserved.Published simultaneously in Canada.

No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning, or otherwise, except as permitted under Section 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, Inc., 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 750-4470, or on the web at www.copyright.com. Requests to the Publisher for permission should be addressed to the Permissions Department, John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030, (201) 748-6011, fax (201) 748-6008, or online at http://www.wiley.com/go/permission.

Limit of Liability/Disclaimer of Warranty: While the publisher and author have used their best efforts in preparing this book, they make no representations or warranties with respect to the accuracy or completeness of the contents of this book and specifically disclaim any implied warranties of merchantability or fitness for a particular purpose. No warranty may be created or extended by sales representatives or written sales materials. The advice and strategies contained herein may not be suitable for your situation. You should consult with a professional where appropriate. Neither the publisher nor author shall be liable for any loss of profit or any other commercial damages, including but not limited to special, incidental, consequential, or other damages.

For general information on our other products and services or for technical support, please contact our Customer Care Department within the United States at (800) 762-2974, outside the United States at (317) 572-3993 or fax (317) 572-4002.

Wiley also publishes its books in a variety of electronic formats. Some content that appears in print may not be available in electronic format. For information about Wiley products, visit our web site at www.wiley.com.

Library of Congress Cataloging-in-Publication Data:

Brandimarte, Paolo.  Handbook in Monte Carlo simulation : applications in financial engineering, risk management, and economics / Paolo Brandimarte.    pages cm  Includes bibliographical references and index.  ISBN 978-0-470-53111-2 (cloth)  1. Finance—Mathematical models. 2. Economics—Mathematical models. 3. Monte Carlo method. I. Title. HG106.B735 2014  330.01′518282—dc23  2013047832

Preface

The aim of this book is to provide a wide class of readers with a low- to intermediate-level treatment of Monte Carlo methods for applications in finance and economics. The target audience consists of students and junior practitioners with a quantitative background, and it includes not only students in economics and finance, but also in mathematics, statistics, and engineering. In fact, this is the kind of audience I typically deal with in my courses. Not all of these readers have a strong background in either statistics, financial economics, or econometrics, which is why I have also included some basic material on stochastic modeling in the early chapters, which is typically skipped in higher level books. Clearly, this is not meant as a substitute for a proper treatment, which can be found in the references listed at the end of each chapter. Some level of mathematical maturity is assumed, but the prerequisites are rather low and boil down to the essentials of probability and statistics, as well as some basic programming skills.1 Advanced readers may skip the introductory chapters on modeling and estimation, which are also included as a reminder that no Monte Carlo method, however sophisticated, will yield useful results if the input model is flawed. Indeed, the power and flexibility of such methods may lure us into a false sense of security, making us forget some of their inherent limitations.

Option pricing is certainly a relevant application domain for the techniques we discuss in the book, but this is not meant to be a book on financial engineering. I have also included a significant amount of material on optimization in its many guises, as well as a chapter related to computational Bayesian statistics. I have favored a wide scope over a deeply technical treatment, for which there are already some really excellent and more demanding books. Many of them, however, do not quite help the reader to really “feel” what she is learning, as no ready-to-use code is offered. In order to allow anyone to run the code, play with it, and hopefully come up with some variations on the theme, I have chosen to develop code in R. Readers familiar with my previous book written in MATLAB might wonder whether I have changed my mind. I did not: I never use R in research or consulting, but I use it a lot for teaching. When I started writing the book, I was less than impressed by the lack of an adequate development environment, and some design choices of the language itself left me a bit puzzled. As an example, the * operator in MATLAB multiplies matrices row by column; whenever you want to work elementwise, you use the . operator, which has a clear and uniform meaning when applied to other operators. On the contrary, the operator * works elementwise in R, and row-by-column matrix product is accomplished by the somewhat baroque operator %*%. Furthermore, having to desperately google every time you have to understand a command, because documentation is a bit poor and you have to make your way in a mess of packages, may be quite frustrating at times. I have also found that some optimization functions are less accurate and less clever in dealing with limit cases than the corresponding MATLAB functions. Having said that, while working on the book, I have started to appreciate R much more. Also my teaching experience with R has certainly been fun and rewarding. A free tool with such a potential as R is certainly most welcome, and R developers must be praised for offering all of this. Hopefully, the reader will find R code useful as a starting point for further experimentation. I did not assemble R code into a package, as this would be extremely misleading: I had no plan to develop an integrated and reliable set of functions. I just use R code to illustrate ideas in concrete terms and to encourage active learning. When appropriate, I have pointed out some programming practices that may help in reducing the computational burden, but as a general rule I have tried to emphasize clarity over efficiency. I have also avoided writing an introduction to R programming, as there are many freely available tutorials (and a few good books2). A reader with some programming experience in any language should be able to make her way through the code, which has been commented on when necessary. My assumption is that a reader, when stumbling upon an unknown function, will take advantage of the online help and the example I provide in order to understand its use and potentiality. Typically, R library functions are equipped with optional parameters that can be put to good use, but for the sake of conciseness I have refrained from a full description of function inputs.

Book structure

The book is organized in five parts.

1. Part I, Overview and Motivation, consists of two chapters. Chapter 1 provides an introduction to Monte Carlo methods and applications. The different classes of dynamic models that are encountered in simulation are outlined, and due emphasis is placed on pitfalls and limitations of Monte Carlo methods. Chapter 2 deals with numerical integration methods. Numerical integration is quite relevant, as it provided most of the historical motivation to develop Monte Carlo methods; furthermore, there are cases in which one is much better off using good quadrature formulas than throwing random numbers around. Finally, framing Monte Carlo methods within numerical integration provides the necessary discipline to understand and properly use low-discrepancy sequences, sometimes referred to as quasi–Monte Carlo methods.
2. Part II, Input Analysis: Modeling and Estimation, is specifically aimed at students and newcomers, as it includes two introductory chapters dealing with stochastic model building (Chapter 3) and model fitting (Chapter 4). Essentially, in this part of the book we are concerned with the modeling of inputs of a Monte Carlo simulation. Many advanced books on Monte Carlo methods for finance skip and take for granted these concepts. I have preferred to offer a limited treatment for the sake of unfamiliar readers, such as students in engineering or practitioners without an econometrics background. Needless to say, space does not allow for a deep treatment, but I believe that it is important to build at least a framework for further study. In order to make this part useful to intermediate readers, too, I have taken each topic as an excuse for a further illustration of R functionalities. Furthermore, some more advanced sections may be useful to students in economics and finance as well, such as those on stochastic calculus, copulas, and Bayesian statistics.
3. Part III, Sampling and Path Generation, is more technical and consists of two chapters. In Chapter 5 we deal with pseudorandom number and variate generation. While it is certainly true that in common practice one takes advantage of reliable generators provided by software tools like R, and there is no need for an overly deep treatment, some basic knowledge is needed in order to select generators and to manage simulation runs properly. We also outline scenario generation using copulas. In Chapter 6 we deal with sample path generation for continuous-time models based on stochastic differential equations. This is an essential tool for any financial engineer and is at the heart of many derivative pricing methods. It is important to point out that this is also relevant for risk managers, insurers, and some economists as well.
4. Part IV, Output Analysis and Efficiency Improvement, looks at the final step of the simulation process. Monte Carlo methods are extremely powerful and flexible; yet, their output may not be quite reliable, and an unreasonable computational effort may be called for, unless suitable countermeasures are taken. Chapter 7 covers very simple, and possibly overlooked, concepts related to confidence intervals. Counterexamples are used to point out the danger of forgetting some underlying assumptions. Chapter 8 deals with variance reduction strategies that are essential in many financial engineering and risk management applications; indeed, the techniques illustrated here are applied in later chapters, too. Chapter 9 deals with low-discrepancy sequences, which are sometimes gathered under the quasi–Monte Carlo nickname. Actually, there is nothing stochastic in low-discrepancy sequences, which should be regarded as deterministic numerical integration strategies. For a certain range of problem dimensionality, they are a good alternative to pseudorandom sampling.
5. Part IV, Miscellaneous Applications, includes five more or less interrelated chapters dealing with:
The interplay between optimization and Monte Carlo methods, including stochastic methods for deterministic global optimization, scenario generation for stochastic programming with recourse, and stochastic dynamic programming (Chapter 10)
Option pricing, with an emphasis on variance reduction methods (Chapter 11)
Obtaining sensitivity of performance measures with Monte Carlo simulation (Chapter 12)
Risk measurement and management, with an emphasis on value-at-risk and related risk measures for financial risk management (Chapter 13)
Markov chain Monte Carlo (MCMC) methods, which are relevant for different applications, most notably computational Bayesian statistics (Chapter 14)
There are some logical precedences among these final chapters, but they need not be read in a strict sequential order. Chapter 14 is independent of the others, and the only link is represented by the possibility of regarding simulated annealing, a stochastic approach for both global and combinatorial optimization, as an MCMC method. Stochastic dynamic programming, dealt with in Chapter 10, is needed to understand American-style option pricing in Chapter 11. Measuring option price sensitivity is used as a motivating example in Chapter 12, but the methods outlined there have a much more general applicability, as they can also be used within optimization procedures. Finally, there is certainly a natural link between option pricing and the risk management examples discussed in Chapter 13.

Supplements and R code

The code has been organized in two files per chapter. The first one contains all of the function definitions and the reference to required packages, if any; this file should be sourced before running the scripts, which are included as chunks of code in a second file. An archive including all of the R code will be posted on a webpage. My current URL is

http://staff.polito.it/paolo.brandimarte/

A hopefully short list of errata will be posted there as well. One of the many corollaries of Murphy’s law states that my URL is going to change shortly after publication of the book. An up-to-date link will be maintained on the Wiley webpage:

http://www.wiley.com/

For comments, suggestions, and criticisms, all of which are quite welcome, my e-mail address is

PAOLO BRANDIMARTE

Turin, February 2014

1In case of need, the mathematical prerequisites are covered in my other book: Quantitative Methods: An Introduction for Business Management. Wiley, 2011.

2Unfortunately, I have also run into very bad books using R; hopefully, this one will not contribute to the list.

Part One

Overview and Motivation

Chapter One

Introduction to Monte Carlo Methods

The term Monte Carlo is typically associated with the process of modeling and simulating a system affected by randomness: Several random scenarios are generated, and relevant statistics are gathered in order to assess, e.g., the performance of a decision policy or the value of an asset. Stated as such, it sounds like a fairly easy task from a conceptual point of view, even though some programming craft might be needed. Although it is certainly true that Monte Carlo methods are extremely flexible and valuable tools, quite often the last resort approach for overly complicated problems impervious to a more mathematically elegant treatment, it is also true that running a bad Monte Carlo simulation is very easy as well. There are several reasons why this may happen:

We are using a wrong model of uncertainty:
– Because we are using an unrealistic probability distribution
– Or because we are missing some link among the underlying risk factors
– Or because some unknown parameters have been poorly estimated
– Or because the very nature of uncertainty in our problem does not lend itself to a stochastic representation
The output estimates are not reliable enough, i.e., the estimator variance is so large that a much larger sample size is required.
There is a systematic error in the estimates, which could be low or high biased.
The way we generate sample paths, possibly discretizing a continuous-time model, induces a non-negligible error.
We are using poor random variate generators.
There is some possibly subtle bug in the computer program implementing the method.

Some of these issues are technical and can be addressed by the techniques that we will explore in this book, but others are more conceptual in nature and point out a few intrinsic and inescapable limitations of Monte Carlo methods; it is wise not to forget them, while exploring the richness and power of the approach.

The best countermeasure, in order to avoid the aforementioned pitfalls, is to build reasonably strong theoretical foundations and to gain a deep understanding of the Monte Carlo approach and its variants. To that end, a good first step is to frame Monte Carlo methods as a numerical integration tool. Indeed, while the term simulation sounds more exciting, the term Monte Carlo sampling is often used. The latter is more appropriate when we deal with Monte Carlo sampling as a tool for numerical integration or statistical computing. Granted, the idea of simulating financial markets is somewhat more appealing than the idea of computing a multidimensional integral. However, a more conceptual framework helps in understanding powerful methods for reducing, or avoiding altogether, the difficulties related to the variance of random estimators. Some of these methods, such as low-discrepancy sequences and Gaussian quadrature, are actually deterministic in nature, but their understanding needs a view integrating numerical integration and statistical sampling.

In this introductory chapter, we consider first the historical roots of Monte Carlo; we will see in Section 1.1 that some early Monte Carlo methods were actually aimed at solving deterministic problems. Then, in Section 1.2 we compare Monte Carlo sampling and Monte Carlo simulation, showing their deep relationship. Typical simulations deal with dynamic systems evolving in time, and there are three essential kinds of dynamic models:

Continuous-time models
Discrete-time models
Discrete-event models

These model classes are introduced in Section 1.3, where we also illustrate how their nature affects the mechanics of Monte Carlo simulation. In this book, a rather relevant role is played by applications involving optimization. This may sound odd to readers who associate simulation with performance evaluation; on the contrary, there is a multiway interaction between optimization and Monte Carlo methods, which is outlined in Section 1.4.

In this book we illustrate a rather wide range of applications, which may suggest the idea that Monte Carlo methods are almost a panacea. Unfortunately, this power may hide many pitfalls and dangers. In Section 1.5 we aim at making the reader aware of some of these traps. Finally, in Section 1.6 we list a few software tools that are commonly used to implement Monte Carlo simulations, justifying the choice of R as the language of this book, and in Section 1.7 we list prerequisites and references for readers who may need a refresher on some background material.

1.1 Historical origin of Monte Carlo simulation

Monte Carlo methods involve random sampling, but the actual aim is to estimate a deterministic quantity. Indeed, a well-known and early use of Monte Carlo-like methods is Buffon’s needle approach to estimate π.1 The idea, illustrated in Fig. 1.1, is to randomly throw n times a needle of length l on a floor consisting of wood strips of width t > l, and to observe the number of times h that the needle crosses the border between two strips. Let X be the distance from the center of the needle to the closest border; X is a uniform random variable on the range [0, t/2], and its probability density function is 2/t on that interval and 0 outside.2 By a similar token, let θ be the acute angle between the needle and that border; this is another uniformly distributed variable, on the range [0, π/2], with density 2/π on that support. Using elementary trigonometry, it is easy to see that the needle will cross a border when

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!

Lesen Sie weiter in der vollständigen Ausgabe!