A Workout in Computational Finance - Andreas Binder - E-Book

A Workout in Computational Finance E-Book

Andreas Binder

0,0
50,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

A comprehensive introduction to various numerical methods used in computational finance today Quantitative skills are a prerequisite for anyone working in finance or beginning a career in the field, as well as risk managers. A thorough grounding in numerical methods is necessary, as is the ability to assess their quality, advantages, and limitations. This book offers a thorough introduction to each method, revealing the numerical traps that practitioners frequently fall into. Each method is referenced with practical, real-world examples in the areas of valuation, risk analysis, and calibration of specific financial instruments and models. It features a strong emphasis on robust schemes for the numerical treatment of problems within computational finance. Methods covered include PDE/PIDE using finite differences or finite elements, fast and stable solvers for sparse grid systems, stabilization and regularization techniques for inverse problems resulting from the calibration of financial models to market data, Monte Carlo and Quasi Monte Carlo techniques for simulating high dimensional systems, and local and global optimization tools to solve the minimization problem.

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

Android
iOS
von Legimi
zertifizierten E-Readern

Seitenzahl: 461

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

Series Page

Title Page

Copyright Page

Dedication

Acknowledgements

About the Authors

1: Introduction and Reading Guide

PROLOGUE

WHAT YOU CAN EXPECT FROM THE DIFFERENT CHAPTERS

ACCOMPANYING SOFTWARE

READING GUIDE

2: Binomial Trees

2.1 EQUITIES AND BASIC OPTIONS

2.2 THE ONE PERIOD MODEL

2.3 THE MULTIPERIOD BINOMIAL MODEL

2.4 BLACK-SCHOLES AND TREES

2.5 STRENGTHS AND WEAKNESSES OF BINOMIAL TREES

2.6 CONCLUSION

3: Finite Differences and the Black-Scholes PDE

3.1 A CONTINUOUS TIME MODEL FOR EQUITY PRICES

3.2 BLACK-SCHOLES MODEL: FROM THE SDE TO THE PDE

3.3 FINITE DIFFERENCES

3.4 TIME DISCRETIZATION

3.5 STABILITY CONSIDERATIONS

3.6 FINITE DIFFERENCES AND THE HEAT EQUATION

3.7 APPENDIX: ERROR ANALYSIS

4: Mean Reversion and Trinomial Trees

4.1 SOME FIXED INCOME TERMS

4.2 BLACK76 FOR CAPS AND SWAPTIONS

4.3 ONE-FACTOR SHORT RATE MODELS

4.4 THE HULL-WHITE MODEL IN MORE DETAIL

4.5 TRINOMIAL TREES

5: Upwinding Techniques for Short Rate Models

5.1 DERIVATION OF A PDE FOR SHORT RATE MODELS

5.2 UPWIND SCHEMES

5.3 A PUTTABLE FIXED RATE BOND UNDER THE HULL-WHITE ONE FACTOR MODEL

6: Boundary, Terminal and Interface Conditions and their Influence

6.1 TERMINAL CONDITIONS FOR EQUITY OPTIONS

6.2 TERMINAL CONDITIONS FOR FIXED INCOME INSTRUMENTS

6.3 CALLABILITY AND BERMUDAN OPTIONS

6.4 DIVIDENDS

6.5 SNOWBALLS AND TARNS

6.6 BOUNDARY CONDITIONS

7: Finite Element Methods

7.1 INTRODUCTION

7.2 GRID GENERATION

7.3 ELEMENTS

7.4 THE ASSEMBLING PROCESS

7.5 A ZERO COUPON BOND UNDER THE TWO FACTOR HULL-WHITE MODEL

7.6 APPENDIX: HIGHER ORDER ELEMENTS

8: Solving Systems of Linear Equations

8.1 DIRECT METHODS

8.2 ITERATIVE SOLVERS

9: Monte Carlo Simulation

9.1 THE PRINCIPLES OF MONTE CARLO INTEGRATION

9.2 PRICING DERIVATIVES WITH MONTE CARLO METHODS

9.3 AN INTRODUCTION TO THE LIBOR MARKET MODEL

9.4 RANDOM NUMBER GENERATION

10: Advanced Monte Carlo Techniques

10.1 VARIANCE REDUCTION TECHNIQUES

10.2 QUASI MONTE CARLO METHOD

10.3 BROWNIAN BRIDGE TECHNIQUE

11: Valuation of Financial Instruments with Embedded American/Bermudan Options within Monte Carlo Frameworks

11.1 PRICING AMERICAN OPTIONS USING THE LONGSTAFF AND SCHWARTZ ALGORITHM

11.2 A MODIFIED LEAST SQUARES MONTE CARLO ALGORITHM FOR BERMUDAN CALLABLE INTEREST RATE INSTRUMENTS

11.3 EXAMPLES

12: Characteristic Function Methods for Option Pricing

12.1 EQUITY MODELS

12.2 FOURIER TECHNIQUES

13: Numerical Methods for the Solution of PIDEs

13.1 A PIDE FOR JUMP MODELS

13.2 NUMERICAL SOLUTION OF THE PIDE

13.3 APPENDIX: NUMERICAL INTEGRATION VIA NEWTON-COTES FORMULAE

14: Copulas and the Pitfalls of Correlation

14.1 CORRELATION

14.2 COPULAS

15: Parameter Calibration and Inverse Problems

15.1 IMPLIED BLACK-SCHOLES VOLATILITIES

15.2 CALIBRATION PROBLEMS FOR YIELD CURVES

15.3 REVERSION SPEED AND VOLATILITY

15.4 LOCAL VOLATILITY

15.5 IDENTIFYING PARAMETERS IN VOLATILITY MODELS

16: Optimization Techniques

16.1 MODEL CALIBRATION AND OPTIMIZATION

16.2 HEURISTICALLY INSPIRED ALGORITHMS

16.3 A HYBRID ALGORITHM FOR HESTON MODEL CALIBRATION

16.4 PORTFOLIO OPTIMIZATION

17: Risk Management

17.1 VALUE AT RISK AND EXPECTED SHORTFALL

17.2 PRINCIPAL COMPONENT ANALYSIS

17.3 EXTREME VALUE THEORY

18: Quantitative Finance on Parallel Architectures

18.1 A SHORT INTRODUCTION TO PARALLEL COMPUTING

18.2 DIFFERENT LEVELS OF PARALLELIZATION

18.3 GPU PROGRAMMING

18.4 PARALLELIZATION OF SINGLE INSTRUMENT VALUATIONS USING (Q)MC

18.5 PARALLELIZATION OF HYBRID CALIBRATION ALGORITHMS

19: Building Large Software Systems for the Financial Industry

Bibliography

Index

For other titles in the Wiley Finance series please see www.wiley.com/go/finance

This edition first published 2013 © 2013 Michael Aichinger and Andreas Binder.

Registered office John Wiley & Sons Ltd, The Atrium, Southern Gate, Chichester, West Sussex, PO19 8SQ, United Kingdom

For details of our global editorial offices, for customer services and for information about how to apply for permission to reuse the copyright material in this book please see our website at www.wiley.com.

All rights reserved. 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 or otherwise, except as permitted by the UK Copyright, Designs and Patents Act 1988, without the prior permission of the publisher.

Wiley publishes in a variety of print and electronic formats and by print-on-demand. Some material included with standard print versions of this book may not be included in e-books or in print-on-demand. If this book refers to media such as a CD or DVD that is not included in the version you purchased, you may download this material athttp://booksupport.wiley.com. For more information about Wiley products, visit www.wiley.com.

Designations used by companies to distinguish their products are often claimed as trademarks. All brand names and product names used in this book are trade names, service marks, trademarks or registered trademarks of their respective owners. The publisher is not associated with any product or vendor mentioned in this book.

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 the 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. It is sold on the understanding that the publisher is not engaged in rendering professional services and neither the publisher nor the author shall be liable for damages arising herefrom. If professional advice or other expert assistance is required, the services of a competent professional should be sought.

Library of Congress Cataloging-in-Publication Data

Aichinger, Michael, 1979– A workout in computational finance / Michael Aichinger and Andreas Binder.  pages cm Includes bibliographical references and index. ISBN 978-1-119-97191-7 (cloth) 1. Finance—Mathematical models. I. Binder, Andreas, 1964– II. Title. HG106.A387 2013 332.01’51—dc23 2013017386

A catalogue record for this book is available from the British Library.

ISBN 978-1-119-97191-7 (hardback) ISBN 978-1-119-97348-5 (ebk) ISBN 978-1-119-97349-2 (ebk) ISBN 978-1-119-97350-8 (ebk)

Cover image: Shutterstock.com

To Elke, Michael, Lisa and Florian

To Julian

Acknowledgements

The authors would not have been able to write this book without the support of their colleagues: Johannes Fürst and Christian Kletzmayr provided a lot of detailed calculations. Sascha Kratky has been an invaluable help for technical support. Andreas Obereder tried (but did not always succeed) to organize tight deadlines. Michael Schwaiger, as the UnRisk product manager, was a great help in providing software parts. Stefan Janecek is the one who improved the English language of the first version.

AB wants to thank Heinz W. Engl for being his academic teacher and mentor for the last 30 years.

MA wants to thank Herbert Exner for many fruitful discussions that led to valuable insight.

MA and AB are grateful to Wiley for their understanding when deadlines did not hold.

About the Authors

Michael Aichinger

Michael Aichinger, FRM, obtained his Ph.D. in Theoretical Physics from the Johannes Kepler Universität Linz with a thesis on numerical methods in density functional theory and their application to 2D finite electron systems. A mobility grant led him to the Texas A&M University (2003) and to the Helsinki University of Technology (2004). In 2007, Michael Aichinger joined the Industrial Mathematics Competence Center, where he has been working as a senior researcher and consultant in the field of quantitative finance for the last five years. He also works for the Austrian Academy of Sciences at the Radon Institute for Computational and Applied Mathematics, where he is involved in several industrial mathematics and computational physics projects.

Andreas Binder

Andreas Binder obtained his Ph.D. in Industrial Mathematics from the Johannes Kepler Universität Linz with a thesis on continuous casting of steel. A research grant led him to the Oxford Centre for Industrial and Applied Mathematics, UK, in 1991. After returning to Linz, he became assistant professor at the Industrial Mathematics Institute. In 1996, he left university and became managing director of MathConsult GmbH. Andreas Binder has authored two introductory books on mathematical finance and 25 journal articles in the fields of industrial mathematics and of mathematical finance.

1

Introduction and Reading Guide

PROLOGUE

We wrote this book with the aim of giving practitioners in computational finance a sound overview of relevant numerical methods. Some of the methods presented in this book are widely used today, while others should, in our opinion, gain more importance in the future. By, “computational finance” we loosely refer to all tasks related to the valuation of financial instruments, risk analysis and some aspects of risk management. Together with our colleagues at MathConsult GmbH, we have been working on a wide range of computational finance projects since 1997. During that time, we have observed that the numerical quality of software used in financial institutions widely varies.

Particular attention is thus given to working out the strengths and weaknesses of the different methods, and to reveal possible traps in their application. We have used real-world examples of valuation, risk analysis and calibration of specific financial instruments and models to introduce each method. A strong emphasis is laid on stable and robust schemes for the numerical treatment.

We have named the book “A Workout in Computational Finance” because due to our experience in training finance professionals, it is our strong belief that computational methods are best studied in a practical, hands-on approach, requiring the student to write at least part of the program code herself. To facilitate this style of learning, the book comes with accompanying software distilled from the UnRisk software package.1

The reader is assumed to have a basic knowledge of mathematical finance and financial derivatives, and a strong interest in quantitative methods. The typical reader of the book is a “junior quant” at a financial institution who wants to gain deeper insight into numerical methods, or, if she has a background in economy, wants to take first steps towards a more quantitative approach. Alternatively, university students at the graduate level may find the topics in this book useful when deciding on a possible future career in finance.

WHAT YOU CAN EXPECT FROM THE DIFFERENT CHAPTERS

In the following, we give a short overview of the contents of the different chapters. Together with the reading guide this should allow the reader to select her topics of interest.

Chapter 2: Binomial Trees

Binomial trees a conceptionally elegant method for valuating derivatives: They are explicit (i.e., no system of equations needs to be solved), and they intrinsically include no-arbitrage conditions. From a numerical point of view, their lack of adaptivity as well as stability problems limit their range of applicability.

Chapter 3: Finite Differences and the Black-Scholes PDE

In this chapter the derivation of the Black-Scholes partial differential equation is explained in detail. The differential operators are discretized using finite difference formulae, and various methods for the time discretization are introduced. Stability issues resulting from the chosen spatial and time discretizations are discussed. The application of the finite difference method to the prototype model of the heat equation concludes the chapter.

Chapter 4: Mean Reversion and Trinomial Trees

When models exhibit mean reverting behavior, such as the Vasicek model for interest rates, binomial trees do not recombine anymore. Trinomial trees have been introduced to cure this problem. To retain their stability, up- and down-branching is used, cutting off the calculation domain and therefore implicitly changing the boundary conditions.

Chapter 5: Upwinding Techniques

Particular finite difference formulae need to be applied to cure the instabilities occurring if partial differential equations arising from mean reverting models are discretized. These formulae are derived in Chapter 5 and their ability to cope with the instabilities is examined. The chapter concludes with a detailed example of the application of upwinding techniques to a putable fixed rate bond under a one factor short rate model.

Chapter 6: Boundary, Terminal and Interface Conditions

To valuate a specific financial instrument, its term sheet must be translated into boundary-, terminal- and possibly also interface conditions (for coupons or callabilities) for the differential equation to be solved. These conditions are formulated for a range of instruments. It turns out that for heavily path-dependent instruments, Monte Carlo techniques may be the more appropriate choice. For the case of mean reverting interest rate models, the influence of artificial boundary conditions is studied.

Chapter 7: Finite Element Methods

The basic concepts of the finite element method are described, and for a number of different elements, the element matrices are derived. Particular emphasis is laid on the assembling process of the global matrices and the incorporation of boundary conditions. Similarly to the finite difference technique, stabilization terms need to be added if the finite element method is applied to convection-diffusion-reaction problems. An example comparing the numerical results obtained with the finite element method to results obtained with tree techniques concludes the chapter.

Chapter 8: Solving Systems of Linear Equations

In Chapters 3, 5, 7 and 13 different discretization techniques for partial (integro) differential equations are discussed, all of them leading to systems of linear equations. This chapter provides an overview of different techniques to solve them. Dependent on the type of problem and the problem size, direct methods or iterative solvers methods may be preferable. A number of basic algorithms for both types of methods are discussed and explained based on small examples.

Chapter 9: Monte Carlo Simulation

The principles of Monte Carlo integration techniques and their application for the pricing of derivatives are explained. Furthermore, different discretization techniques for the stochastic differential equations used to model the propagation of the underlying risk factors are discussed. The Libor market model is examined as an example of a high-dimensional model where Monte Carlo methods are typically applied to valuate derivatives. The final part of the chapter emphasizes random number generation, which is one of the major building blocks of every Monte Carlo-based pricing routine.

Chapter 10: Advanced Monte Carlo Techniques

Different techniques exist to reduce the variance of Monte Carlo estimators. Some of the more general algorithms are explained based on examples such as the pricing of exotic options. In contrast to the Monte Carlo method, Quasi Monte Carlo methods do not use sequences of pseudo-random numbers, but use sequences of low-discrepancy numbers instead. The most important sequences are introduced and applied to the pricing of a structured interest rate product under the Libor market model. As a technique to speed up Monte Carlo as well as Quasi Monte Carlo simulations the Brownian bridge method is outlined.

Chapter 11: Least Squares Monte Carlo

A well-known problem when using Monte Carlo methods for pricing is the inclusion of American or Bermudan call- or putability. We present a detailed outline of a Least Squares Monte Carlo algorithm in this chapter and apply this algorithm to a number of structured interest and foreign exchange rate instruments.

Chapter 12: Characteristic Function Methods for Option Pricing

For many distributions the density functions are not known or are not analytically tractable, but their corresponding Fourier transforms, the characteristic functions, are. This circumstance provides the basis for the methods presented in two fast and reliable methods for the valuation of European vanilla options based on the Fast Fourier Transformation and cosine series expansion are discussed. An overview of equity models beyond Black-Scholes is given in this chapter, as the calibration of these models is one of the major areas where the characteristic function methods can be applied.

Chapter 13: Numerical Methods for the Solution of PIDEs

The extension of the methods discussed in Chapters 3, 5 and 7 to cope with partial integro differential equations is discussed in this chapter.

Chapter 14: Copulas and the Pitfalls of Correlation

In the first two parts of this chapter, a number of common measures for dependence and basic concepts of copulas are presented. Subsequently, the most important copulas applied in finance are discussed and some estimation and sampling methods for them are outlined. An example showing the impact of different copula functions on the probability of default closes the chapter.

Chapter 15: Parameter Calibration and Inverse Problems

Market data are changing more or less continuously. To reflect this fact in the valuation of financial instruments, the parameters of the mathematical models describing the movement of underlyings have to be (re)calibrated on a regular basis. This is a classical inverse problem, and therefore instabilities are to be expected. Several examples for equity and for interest rate models are discussed in detail.

Chapter 16: Optimization Techniques

To solve the calibration problems outlined in Chapter 15, optimization techniques need to be applied. We differentiate gradient-based and heuristically motivated methods, discuss algorithms for both types and show that hybrids of the two worlds can successfully be applied to estimate parameters, using the calibration of a Heston model as an example. For constrained optimization problems we introduce the interior point method and show the capability of this method in the field of portfolio optimization.

Chapter 17: Risk Management

Many of the methods discussed up to this point in the book can be used to value single instruments or portfolios. Frequently, such algorithms are used as building blocks in a risk management system where these valuations must be performed over thousands of different scenarios. In this chapter we will discuss the different possibilities to generate such scenarios and how to assess the risk measures from the simulation results. A short outline of extreme value theory and its application to the calculation of Value at Risk and Expected Shortfall concludes the chapter.

Chapter 18: Quantitative Finance on Parallel Architectures

In many fields of quantitative finance it is necessary to perform thousands or even millions of valuations of often highly structured instruments. Parallel computation techniques are used to significantly speed up these valuations. Multicore CPUs and recent GPUs, have fueled this trend by providing affordable and readily available parallel hardware. Based on examples we examine how different parallelization techniques can successfully be applied.

Chapter 19: Building Large Software Systems for the Financial Industry

This is a short chapter on the authors’ experiences in building a large software system for risk management of financial instruments.

ACCOMPANYING SOFTWARE

The buyer of the book is entitled to download the accompanying software from www.unrisk.com/Workout after registration. A tutorial on how to use the software together with the book is available on the webpage.

READING GUIDE

The diagram below shows the interrelations between different chapters and the suggested order of reading. Vertical arrows indicate suggested order of reading within a group of associated chapters, all other arrows indicate relations between different groups. For example, the Chapters on P(I)DE methods should be read in the order 3, 5–7, 13, and Chapter 8 (Solving Systems of Linear Equations) depends on material covered the P(I)DE chapters.

1 The UnRisk ENGINE and the UnRisk FACTORY are software packages for valuation and risk management of financial instruments and portfolios thereof. UnRisk has been developed by MathConsult since 1999 and now contains more than 1 million lines of multi language code. UnRisk is a registered trademark of MathConsult. Details: www.unrisk.com

3

Finite Differences and the Black-Scholes PDE

In the preceding chapter, we have outlined how to calculate an explicit solution for the price of a European call/put option as the limit of the binomial tree setup. A different method to obtain the same solution is the transformation of the Black-Scholes stochastic differential equation (SDE) into the corresponding partial differential equation (PDE) (Wilmott, 1998).

3.1 A CONTINUOUS TIME MODEL FOR EQUITY PRICES

In this section we summarize mathematical foundations required for the derivation of the Black-Scholes PDE (Hull, 2002). Readers familiar with stochastic differential equations, Wiener processes and the Itô calculus can skip this section.

Returns

Let Sn be the price of an asset at the end of trading day n. Then, we can calculate the log-return, 1

(3.1)

The log-return over a time period of days is simply calculated by the sum over the respective daily log-returns,

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!