Discover millions of ebooks, audiobooks, and so much more with a free trial

Only $11.99/month after trial. Cancel anytime.

Numerical Methods and Optimization in Finance
Numerical Methods and Optimization in Finance
Numerical Methods and Optimization in Finance
Ebook1,416 pages9 hours

Numerical Methods and Optimization in Finance

Rating: 3 out of 5 stars

3/5

()

Read preview

About this ebook

Computationally-intensive tools play an increasingly important role in financial decisions. Many financial problems—ranging from asset allocation to risk management and from option pricing to model calibration—can be efficiently handled using modern computational techniques. Numerical Methods and Optimization in Finance presents such computational techniques, with an emphasis on simulation and optimization, particularly so-called heuristics. This book treats quantitative analysis as an essentially computational discipline in which applications are put into software form and tested empirically.

This revised edition includes two new chapters, a self-contained tutorial on implementing and using heuristics, and an explanation of software used for testing portfolio-selection models. Postgraduate students, researchers in programs on quantitative and computational finance, and practitioners in banks and other financial companies can benefit from this second edition of Numerical Methods and Optimization in Finance.

  • Introduces numerical methods to readers with economics backgrounds
  • Emphasizes core simulation and optimization problems
  • Includes MATLAB and R code for all applications, with sample code in the text and freely available for download
LanguageEnglish
Release dateAug 16, 2019
ISBN9780128150665
Numerical Methods and Optimization in Finance
Author

Manfred Gilli

Manfred Gilli is Professor emeritus at the Geneva School of Economics and Management at the University of Geneva, Switzerland, where he has taught numerical methods in economics and finance. He is also a Faculty member of the Swiss Finance Institute, a member of the Advisory Board of Computational Statistics and Data Analysis, and a member of the editorial board of Computational Economics. He formerly served as president of the Society for Computational Economics.

Related to Numerical Methods and Optimization in Finance

Related ebooks

Finance & Money Management For You

View More

Related articles

Reviews for Numerical Methods and Optimization in Finance

Rating: 2.75 out of 5 stars
3/5

2 ratings0 reviews

What did you think?

Tap to rate

Review must be at least 10 words

    Book preview

    Numerical Methods and Optimization in Finance - Manfred Gilli

    book."

    Part I

    Fundamentals

    Outline

    Chapter 1. Introduction

    Chapter 2. Numerical analysis in a nutshell

    Chapter 3. Linear equations and Least Squares problems

    Chapter 4. Finite difference methods

    Chapter 5. Binomial trees

    Chapter 1

    Introduction

    Abstract

    The chapter provides an overview of the book and lays out principles for handling financial models. We discuss financial models and software; we also provide a brief discussion of the various sources of approximation error in financial modeling. We stress that numerical methods in finance are tools, i.e. they are means, not ends. The appropriateness and quality of such tools needs to be judged with respect to the application at hand. We argue that quantitative models are useful in finance, and that effective tools to solve them are needed. But we also emphasize the need to remember the limitations imposed by any given model and, even more so, by the difficulty to estimate and forecast financial quantities. Several examples illustrate these points.

    Keywords

    Numerical methods in finance; Financial Modeling; Model accuracy; Model risk; Approximation; Optimization; Financial software

    Chapter Outline

    1.1  About this book

    The growth of computing power

    Computational finance

    1.2  Principles

    1.3  On software

    1.4  On approximations and accuracy

    1.5  Summary: the theme of the book

    1.1 About this book

    I think there is a world market for maybe five computers. So said, allegedly, Thomas J. Watson, then chairman of ibm, in 1943. It would take another ten years, until 1953, before ibm delivered its first commercial electronic computer, the 701.

    Stories and quotations like this abound: people make predictions about computing technology that turn out to be spectacularly wrong.¹ To be fair, Watson probably never made that statement; most of such infamous forecasts are either made up or taken out of context.

    But in any case, Watson's alleged statement reflects the spirit of the time, and reading it today plainly shows the extent to which computing power has become available: nowadays in everyone's pocket, there are devices that perform millions of times faster than ibm's 701.

    The growth of computing power

    Many examples have been made to illustrate this growth;² let us provide one that starts in the Swiss city of Geneva, where this book originated. In case you do not know Switzerland, Fig. 1.1 shows a map.

    Figure 1.1 A map of the beautiful country called Switzerland.

    Imagine you stand at the wonderful lakefront of Geneva, with a view on Mont Blanc. You decide to take a run to Lake Zurich. We admit this is unlikely, given the distance of 250 km. But it is only an example, so please bear with us. Assume you could run the whole distance with a speed of 20 km per hour, which is about the speed that a world-class marathon runner could manage. (We ignore the fact that Switzerland is a rather mountainous country.) It would take you more than 12 hours to arrive in Zurich. Now, instead of running, suppose you took a plane with an average speed of 800 km per hour. This is about 40 times faster, and you would arrive in less than half an hour. What is the point of the example? For one, few people would run from Geneva to Zurich. But more importantly, we wanted to give you an idea of speedup. It is just 40 in this case, not a large number, but it makes a huge difference, and it makes things possible which otherwise would not be.

    This book is not about traveling. It is about computational methods in finance. Quantitative methods and their implementation in software form have become ever more important in scientific research and the industry over the last decades, and much has changed. On one hand, ever more data is collected and stored today, waiting to be analyzed. At the same time, computing power has increased beyond imagination. If we measure the speed of a computer by the number of operations it can perform in a second, then computers have improved by a factor of perhaps 1,500,000 since the early 1980s.of a second. Better yet, we are not talking about supercomputers, but about the kind of computers we have on our desktops. And in any case, in the past, the power of supercomputers at one point in time was available for private use just a few years later.

    Of course, it is not only hardware that has improved, but software, too. If people still operated on terminals or had to use punch-cards for storing programs, computing would be much less powerful today. This book is about using this massively-increased computing power in finance. Indeed, this evolution, which took place in roughly a man's work-life, has led to several consequences.

    Less division-of-labor. Because computers have become so fast and easy to use, people in many disciplines can turn from specialists into polymaths. Or, to put it differently, they become specialists in more-broadly-defined fields. We see this happening not only in finance; but also in statistics and data analysis, where often a single person prepares, processes, and analyzes data, estimates models, runs simulations, and more (much helped by the fact that many such tasks can be automated). Or think of publishing. Modern computers and software have enabled people to not only write papers and books, but to actually produce them, i.e., create artwork or graphics, define the layout and so on.

    Portable software. Software and computing models that rely on specific hardware architectures lose their appeal. For instance, parallel computations that exploit specific communication channels in hardware have become less attractive. Instead of spending the next year with rewriting their programs for the latest supercomputer architecture, people can and should now use their time to think about their applications and write useful software. (Then, after a year, they can buy a better, faster machine.)

    Interpreted languages. In the past, implementing algorithms often meant creating prototypes in a higher-level language and then rewriting such prototypes in low-level languages such as C. Today, prototypes written in languages such as MATLAB®, R, Python, Julia or Lua are so fast that a reimplementation is rarely needed. As a consequence, implementation times have decreased, and we can much faster explore new ideas and adapt existing programs.

    Computational finance

    Computational finance is not a well-defined discipline. It is the intersection of financial economics, scientific computing, econometrics, software engineering, and many other fields. Its goal is to better understand prices and markets—if you are an academic—, and to make money—if you are more practically inclined. This book is about tools for computational finance, with an emphasis on such techniques that have most benefited from the growth in computing power: simulation and optimization techniques. More specifically, we will focus on computationally-intensive optimization methods: heuristics.

    The theme of the book is the practical, computational application of financial theory; we do not deal with the theory itself; in some cases, there may not even be much established theory. Quantitative finance today is very much driven by theory, which is often highly mathematical. But we feel that researchers should much more emphasize empirical and experimental results, similar to how data analysis set itself apart from statistics: the former emphasized working with data; the latter preferred mathematical reasoning. Hence, we will not develop ideas theoretically but consider quantitative analysis as a primarily computational discipline, in which applications are put into software form and tested empirically. For every topic in this book, we discuss the implementation of methods. Algorithms will be given in pseudocode; MATLAB or R code will be provided for all important examples.

    The readers we have in mind are students at Master or phd level in programs on quantitative and computational finance, and researchers in finance. The book could be the main reference for courses in computational finance programs, or an additional reference for quantitative or mathematical finance courses. But the book will also be valuable to practitioners in banks and other financial institutions. Many of the chapters have the flavor of case studies. From a pedagogical view, this allows the learning of the required steps for tackling specific problems; these steps can then be applied to other problems. From the practical side the selected problems will, we hope, be relevant enough to make the book a reference on how to implement a given technique. We have also included many smaller code recipes for particular tasks, such as producing specific random variates or ‘repairing’ variance–covariance matrices, that are often used in practical applications.

    The ideal, prototypic kind of reader that we have in mind—the Analyst—does not work on theory, at least not exclusively, but his job requires a close interaction between theoretical ideas and computation with data.

    The book is structured into three parts. The first part, Fundamentals, begins with an introduction to numerical analysis, so we discuss computer arithmetic, approximation errors, how to solve linear equations, how to approximate derivatives, and other topics. These discussions will serve as a reference to which later chapters often come back. For instance, the Greeks for option pricing models can often be computed by finite differences. Unfortunately, numerical methods are rarely discussed in standard finance books, even though they are the basis for empirically applying and testing models. Beyond the initial chapters, the book will not discuss numerical methods in an abstract way. For a general treatment see, for instance, Heath (2005) or the concise and very recommended summary given by Trefethen (2008b). We will only discuss numerical aspects that are relevant to our applications. Further chapters will explain deterministic numerical methods to price instruments, namely trees and finite difference methods, and their application to standard products.

    The second part, Simulation, starts with chapters on how to generate random numbers and how to model dependence. Chapter 8 discusses how time series processes, simple assets, and portfolios can be simulated. There is also a short example on how to implement an agent-based model. By means of several case studies, applications will illustrate how these models can be used for generating more realistic price processes and how simulation can help to develop an intuitive understanding of econometric models and solve practical problems.

    The third part, Optimization, deals with optimization problems in finance. We start with fundamental—in the sense of ubiquitous—problems and methods to solve them, such as root finding. Indeed, root-finding algorithms may be the most widely used numerical tools in finance: they are needed, among other things, for computing the yield to maturity (a.k.a. internal interest rate) of bonds, and for computing the implied volatility of options. Both operations are performed millions of times each day across the financial world. We also discuss how to solve Least Squares problems, yet another fundamental problem.

    Unfortunately, many optimization models cannot be solved with standard methods that are readily available in software packages. Thus, we are going to show how to use another class of techniques, so-called heuristics; in fact, we will spend most of the book's third part on these techniques. Chapter 11 will detail building blocks of numerical optimization algorithms. Though we include gradient-based techniques such as Newton's method, emphasis will be put on more robust techniques such as direct search. Chapter 12, Heuristic Methods in a Nutshell, will then move from these building blocks to specific techniques, and give an overview of heuristic methods. The remaining chapters will deal with specific problems from portfolio optimization, the estimation of econometric models, and the calibration of option pricing models.

    1.2 Principles

    We start with some principles, or guidelines, for the applications in the book.

    1.  We don't know much in finance. No, we are not being modest here. We refers to finance and the people working in finance in general (which includes us). A number of people may object to this statement, so let us clarify: what we mean by not knowing much is that there is little empirically founded and tested, objective knowledge in finance that can be confidently exploited in practical applications. True, there is a vast body of theory. But when we look at the empirical track record of much of this theory—let us say there remains room for improvement.

    This has an important implication: when it comes to empirical applications, it is difficult in finance to give general statements like this model is better than that model or this method is better than that method. This is less of a problem in numerical analysis, where we can quite objectively compare one method with another. But in finance, we really don't know much. This makes it difficult to decide what model or technique is the appropriate one for a specific purpose.

    There is a second, related implication. If it is so difficult to tell what a good model is, then all that is said must reflect opinion, as opposed to facts. Books—like this one—reflect opinion. In fact, we use the we throughout, but this book is written by three authors, and the we does not mean that we always agree. Everything in this book reflects the opinion of at least one of us. We cannot claim that the techniques we discuss are the best and final answers, but all results come from extensive analyses, and we have found those techniques useful, both in research and in practice.

    We really want to stress this point. Some textbooks in finance give the impression that, for example, if you want to do portfolio optimization, this is what you need to do. No, please. It should be This is one possibility, and if you have a better idea, please try. This is all the more true since many models in finance were not motivated by empirical usefulness, but rather mathematical elegance or mere tractability. We will argue in this book that modern computing power (which we all have on our desktops) allows us to give up the need to adhere to rigid mathematical structures (no, an objective function need not be quadratic).

    2.  Don't be scared.⁶ Academic finance and economics has become ever more formal and mathematical since the 1980s or so. In our experience, this can be intimidating, and not just to students. One way to overcome this is to show that even complicated models may be only a few lines of computer code and, thus, manageable. (So even for seemingly standard material like binomial trees, we will detail implementation issues which, to our knowledge, are rarely discussed in detail in other books.) Implementing a model gives more intuition about a model than only manipulating its equations. The reason: we get a feel of magnitude of possible errors; we see which difficulties are real, and which ones we need not bother with. And implementing a model is anyway the necessary first step to a test whether the model makes practical sense. The purpose of computational finance as stated above (both academic and practical) means that the goal is neither to write beautiful equations nor to write beautiful code, but to get applications to run. Writing reliable software is often important here, but reliable means that the software fulfills its purpose.

    3.  Judge the quality of a solution with respect to the application. We are interested in methods for computational finance. And in our definition of computational finance, the relevance of a model is determined by whether it fulfills its purpose. So it should not be judged by

    (i)  how elegant the mathematics is;

    (ii)  whether it nicely fits into a theoretical framework (e.g., if a model is built to help forecast interest rates, our concern should not be whether the model excludes arbitrage opportunities);

    (iii)  how elegantly or in what language the code is written (of course, if the purpose of a program is to compute an answer fast, efficiency becomes a

    Enjoying the preview?
    Page 1 of 1