universitext - link.springer.com978-3-642-56144-3/1.pdf · not imply. even in the absence of a...

15
Universitext

Upload: buingoc

Post on 28-May-2019

216 views

Category:

Documents


0 download

TRANSCRIPT

Universitext

Springer-Verlag Berlin Heidelberg GmbH

Sasha Cyganowski Peter Kloeden Jerzy Ombach

FroITl EleITlentary Probability to Stochastic Differential Equations withMAPLE®

Springer

Library of Congress Cataloging-in Publication Data applied for

Cyganowski, S.: From elementary probability to stochastic diff~rential equations with MAPLE I Sasha Cyganowski; Peter Kloeden; Jerzy Ombach. - Berlin; Heidelberg; New York; Barcelona; Hong Kong; London; Milan; Paris; Tokyo: Springer, 2002 (Universitext) ISBN 978-3-540-42666-0 ISBN 978-3-642-56144-3 (eBook) DOI 10.1007/978-3-642-56144-3 0101 deutsche buecherei

Mathematics Subject Classification (2000): 60-01,60-08

ISBN 978-3-540-42666-0

This work is subject to copyright. AII rights are reserved, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation, broadcasting, reproduction on microfilms or in any other way, and storage in data' banks. Duplication of this publication or parts thereof is permitted only under the provisions of the German Copyright Law of September 9. 1965. in its current version, and permission for use must always be obtained from Springer-Verlag. Violations are liable for prosecution under the German Copyright Law.

@Springer-VerlagBerlinHeidelbergl00l

Originally published by Springer-Verlag Berlin Heidelberg New York in 2002

The use of general descriptive names, registered names. trademarks. etc. in this publication does not imply. even in the absence of a specific statement. that such names are exempt from the rele­vant protective laws and regulations and therefore free for general use.

Typesetting: Camera-ready copy produced by the authors using a Springer T EX macro package Cover design: design 6- production GmbH. Heidelberg

Printed on acid-free paper SPIN: 10850538 46/3141db - 5 4 3 1 1 o

Preface

Measure and integration were once considered, especially by many of the morepractically inclined, to be an esoteric area of abstract mathematics best left topure mathematicians. However, it has become increasingly obvious in recentyears that this area is now an indispensable, even unavoidable, language andprovides a fundamental methodology for modern probability theory, stochas­tic analysis and their applications, especially in financial mathematics.

Our aim in writing this book is to provide a smooth and fast introductionto the language and basic results of modern probability theory and stochasticdifferential equations with help of the computer manipulator software packageMAPLE. It is intended for advanced undergraduate students or graduates, notnecessarily in mathematics, to provide an overview and intuitive backgroundfor more advanced studies as well as some practical skills in the use of MAPLE

software in the context of probability and its applications.This book is not a conventional mathematics book. Like such books it

provides precise definitions and mathematical statements, particularly thosebased on measure and integration theory, but instead of mathematical proofsit uses numerous MAPLE experiments and examples to help the reader un­derstand intuitively the ideas under discussion. The pace increases from ex­tensive and detailed explanations in the first chapters to a more advancedpresentation in the latter part of the book. The MAPLE is handled in a sim­ilar way, at first with simple commands, then some simple procedures aregardually developed and, finally, the stochastic package is introduced. Theadvanced mathematical proofs that have been omitted can be found in manymathematical textbooks and monographs on probability theory and stochas­tic analysis , some outstanding examples of which we have listed at the end ofthe book, see page 303. We see our book as supplementing such textbooks inthe practice classes associated with mathematical courses. In other disciplinesit could even be used as the main textbook on courses involving basic prob­ability, stochastic processes and stochastic differential equations. We hope itwill motivate such readers to furth er their study of mathematics and to makeuse of the many excellent mathematics books on these subjects.

As prerequisites we assume a familiarity with basic calculus and linearalgebra, as well as with elementary ordinary differential equations and, inthe final chapter, with simple numerical methods for such ODEs. AlthoughStatistics is not systematically treated, we introduce statistical concepts such

VI Preface

as sampling, estimators, hypothesis testing, confidence intervals, significancelevels and p-values and use them in examples, particularly those involvingsimulations.

We have used MAPLE 5.1 throughout the book, but note that most of ourprocedures and examples can also be used with MAPLE 6 and MAPLE 7. Allof the MAPLE presented in the book as well as the MAPLE software packagestochastic can be downloaded from the internet addresses

http://www.math.uni-frankfurt.de/-numerik/kloeden/maplesde/

and

http://www.im.uj.edu .pl/-ombach

Additional information and references on MAPLE in probability andstochastics can be found there.

This book has its origins in several earlier publications of the coauthors,with Chapters 1 to 7 being an extension of similar material in the Polishlanguage book [27] of the third author and with the remaining chapters be­ing originating from the technical report [8] and other papers on the MAPLE

software package stochastic by the first two coauthors and their coworkersas well as on the textbooks [19, 20] on the numerical solution of stochasticdifferential equations of the second coauthor and his coauthors.

We welcome feedback from readers.

Sasha Cyganowski, Clonmel, IrelandPeter Kloeden, Frankfurt am Main, GermanyJerzy Ombach, Krakow, Poland

August 31, 2001

Notation

Let us recall some standard notation and terminology. We assume that thereader is familiar with basic operations on sets, like unions, intersectionsand complements. In this book we will often use the operation of Cartesianproduct of sets. Let X and Y be given sets. Their Cartesian product is theset of all pairs having first elements in X and the second one in Y, that is:

X x Y = {(x,y) : x E X, Y E Y} .

The straightforward generalisation is as follows. Given sets X I, ... , Xn wedefine:

Xl X . .. X Xn = {(XI, .. . ,Xn ) : Xi E X i, i =1, . .. , n}.

If all sets Xi are the same, say Xi = X for i = 1, .. . ,n, we often write:

We denote by N the set of natural numbers, Z the set of integers, Q the setof rational numbers and jR the set of all real numbers. We can interpret theset jR as the straight line, the set jR2 as the plane and jR3 as three dimensionalspace. The set Rn will be called n-dimensional space.

A subset A of jRn is said to be an open set if for every point x =(Xl, . . . ,Xn) E A there exists an e > 0 such that any point Y = (YI,.. . ,Yn) EjRn s-close to x, (i.e. satisfies IXi - Yi/ < e for all i = 1, . . . , n) , also belongsto A, yEA. A subset A of Rn is said to be a closed set if its complementjRn \ A is open.

A function f : jRn ---t jRffi is continuous if for every point Xo E jRn andevery e > 0 there exists a fJ > 0 such that for any point X that is fJ-close toXo its image f(x) is s-close to f(xo). Equivalently, f is continuous, iffor anyopen set G C jRffi its preimage f-I(G) = {x E jRn : f(x) E G} is open.

Maple

As we have already mentioned above, one of the basic tools used in the bookis MAPLE. It represents a family of software developed over the past fifteenyears to perform algebraic and symbolic computation and, more generally, toprovide its user with an integrated environment for doing mathematics on acomputer. One of the most convenient features of MAPLE is that it can be op­erated by a user with minimal expertise with computers. Its very good "Help"system contains many examples that can be copied, modified and used imme­diately. On the other hand, more experienced users can take advantage of afull power of MAPLE, to write their own routines and sophisticated programsas well as to use the hundreds of already built-in procedures.

In this book we will use a number of MAPLE packages. The most use­ful for us is the stats package, which contains the routines that are mostcommonly used in statistics. In particular, we will be able to use built-indistributions, compute basic statistics, plot histograms and other statisticalplots. Perhaps most important is that MAPLE make its possible to performsimulations such as "rolling" a die as many times as we want, see page 1.Moreover, we can simulate games and more complicated processes includingMarkov chains, Wiener processes, and the solutions of stochastic differentialequations (SDEs) that arise as mathematical models of many real and quitecomplex situations. The generation and simulation of random and pseudo­random numbers will be considered in Chapter 6 of this book.

We start with simple MAPLE commands and procedures and finish withmuch more advanced procedures for solving, simulating and managing SOEs.While it is not essential, the reader may find it useful to consult some standardtextbooks on MAPLE. The MAPLE home page

http://www .maplesoft .com

lists over 200 MAPLE books.Below we present some basic features of the stats package and use it to

illustrate how to work with packages.

MAPLE ASSISTANCE 1

We load any package using with command.> with(stats);

[anova , describe, fit , importdata, random , statevalf , statplots , transform]

X Maple

We are given names of available procedures and/or subpackages in the pack­age. In this case all of them are subpackages. We load three of them to showcorresponding procedures.

> with(describe)j

[coefficientojvariation, count, countmissing, covariance, decile,geometricmean, harmonicmean, kurtosis, linearcorrelation , mean,meandeviation, median , mode, moment, percentile, quadraticmean,quantile, quartile, range, skewness, standarddeviation, sumdata ,variance]

> with(statplots)j

[boxplot, histogram, scatterplot, xscale, xshijt, xyexchange, xzexchange,

yscale, yshijt, yzexchange, zscale, zshijt]

> with(random)j

[,8, binomiald, cauchy, chisquare, discreteuniform, empirical, exponential,jratio, 7, laplaced, logistic, lognormal, negativebinomial , normald ,poisson, studentst, uniform, weibull]

Now we can use any of the procedures listed above. For example we can have30 observations from the normal distribution with mean = 20 and standarddeviation = 1.

> normald[20,l] (30)j

21.17583957, 19.43663587,20.23539400, 18.55744971, 18.92080377,19.97798535, 17.41472164, 19.55672872, 18.99671852,19.97213026, 21.52624486, 19.39487938, 20.16404125,20.65302474, 19.45894571, 22.13502584, 20.18442388,19.38337057,19.55130240,20.82382405,20.25213303,20.19183012, 20.82798388, 18.25773287, 21.12307709,19.83943807, 18.44407097, 19.21928084, 19.48133239,19.74173503

We can make an appropriate histogram.> histogram([%])j

Maple XI

0 .8

0 .6

0.4

c--0 .2 r--- r

1I I r I

o 7 18 19 20 21 22

We may also want to plot the corresponding density function. We will use pdfprocedure with parameter normald [20.1] from the statevalf subpackage.Still this subpackage has not been loaded. In such a case we call, for example,this procedure as statevalf [pdf, normald [20,1]] .

> plot(statevalf[pdf,normald[20,1]],16 . .24)j

0.4

/\0.3

0.2

~ ~0 .1

o 16 17 18 19 20 21 22 23 24

We can have the above plots at the same pictu re. An appropriate proceduredisplay is contained in the plots package.

> plots [display] (%,%%) i

0 .8

0 .6

0.4

0 .2

o 16 17 18 19 20 23 24

XII Maple

The same packages contains animate procedure.> plots [animate] (statevalf [pdf ,normald [20,sigma]] (x) ,

x = 15.. 25,sigma = 0.5 .. 2);

0.8

0.6

0.4

0.2

0 16 18 ~ 22 24

Click the plot with the mouse to see the context menu and look at the ani­mation.

Table of Contents

1 Probability Basics 11.1 The Definition of Probability 1

1.1.1 Tossing Two Dice 11.1.2 A Standard Approach. . . . . . . . . . .. . . . . . . . . . . . . . . . . . 41.1.3 Probability Space 4

1.2 The Classical Scheme and Its Extensions . . . . . . . . . . . . . . . . . . 61.2.1 Drawing with and Without Replacement . . . . . . . . . . . . 81.2.2 Applications of the Classical Scheme. . . . . . . . . . . . . . . . 91.2.3 Infinite Sequence of Events ..... . . . . . . . . . . . . . . . . . . . 12

1.3 Geometric Probability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141.3.1 Awkward Corners - Bertrand's Paradox. . .. . . . . . . . . . 15

1.4 Conditional and Total Probability. . . . . . . . . . . . . . . . . . . . . . .. 161.4.1 The Law of Total Probability . . . . . . . . . . . . . . . . . . . . . . 171.4.2 Bayes' Theorem. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

1.5 Independent Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221.5.1 Cartesian Product. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241.5.2 The Bernoulli Scheme. . . . . . . . . . . . . . . . . . . . . . . . . . . .. 25

1.6 MAPLE Session . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 271.7 Exercises.. .. . . . .. .. .. . .. .... ....... ... .. . . ... . .. .... .. 29

2 Measure and Integral. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 332.1 Measure . .. . . . . . .. . . . .. .. ... .......... .... . .. . ... . . . . . . 33

2.1.1 Formal Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 342.1.2 Geometric Probability Revisited . . . . . . . . . . . . . . . . . . . . 362.1.3 Prop erties of Measure . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 37

2.2 Integral. .... .. . . . ...... .... .. .. ... . .. ..... . ... .. . ..... 382.2.1 The Riemann Integral. . . . . . . . . . . . . . . . . . . . . . . . . . . .. 382.2.2 The Stieltjes Integral 412.2.3 Measurable Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 422.2.4 The Lebesgue Integral 44

2.3 Properties of the Integral . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 472.3.1 Integrals with Respect to Lebesgue Measure. . . . . . . . . 492.3.2 Riemann Integral Versus Lebesgue Integral . . . . . . . . .. 492.3.3 Integrals Versus Derivatives . . . . . . . . . . . . . . . . . . . . . . .. 50

2.4 Determining Integrals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 51

XIV Table of Contents

2.5 MAPLE Session . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 522.6 Exercises.. . . . . . ... ...... . .. . . . ... .. . .. . .. . ... . .. ..... . 59

3 Random Variables and Distributions. . . . . . . . . . . . . . . . . . . . .. 613.1 Probability Distributions . . . . . . .. . . . . . . . .. .. . . . . .. . . . . . .. 63

3.1.1 Discrete Distributions , 633.1.2 Continuous Distributions. . . . . . . . . . . . . . . . . . . . . . . . .. 653.1.3 Distribution FUnction. . . . . . . . . . . . . . . . . . . . . . . . . . . .. 66

3.2 Random Variables and Random Vectors . . . . . . . . . . . . . . . . . .. 693.2.1 A Problem of Measurability . . . . . . . . . . . . . . . . . . . . . .. 703.2.2 Distribution of a Random Variable 713.2.3 Random Vectors 72

3.3 Independence.. .. ... .. .... . ....... .. ... .... .. . ...... . . . 723.4 FUnctions of Random Variables and Vectors. .. . .. .. .. . . .. . . 74

3.4.1 Distributions of a Sum. . . . . . . . . . . . . . . . . . . . . . . . . . .. 773.5 MAPLE Session . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 783.6 Exercises . . . .. . . .. . ..... .. .. ....... . . ... ... . ... . . .... . . 82

4 Parameters of Probability Distributions 854.1 Mathematical Expectation . .. .. . . . . . . . .. . . . . .. . . .. . . . . . .. 854.2 Variance.... . .... . . . ... . . . . .. . ...... . . . . .. ... .. . . .... . 89

4.2.1 Moments . ..... .. . . . .... . .. .. .. . .. . . .. . .... ... . .. 904.3 Computation of Moments 92

4.3.1 Evaluation of the Mean and Variance. . . . . . . . . . . . . .. 934.4 Chebyshev's Inequality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 984.5 Law of Large Numbers 100

4.5.1 The Weak Law of Large Numbers 1014.5.2 Convergence of Random Variables 1024.5.3 The Strong Law of Large Numbers 106

4.6 Correlation 1074.6.1 Marginal Distributions 1084.6.2 Covariance and the Coefficient of Correlation 108

4.7 MAPLE Session 1124.8 Exercises ... . . ... .. . . . ... . .. . .. . .... .. . ..... ... ..... ... 117

5 A Tour of Important Distributions 1215.1 Counting 121

5.1.1 The Binomial Distribution 1215.1.2 The Multinomial Distribution 1235.1.3 The Poisson Distribution 1245.1.4 The Hypergeometr ic Distribution 127

5.2 Waiting Times 1285.2.1 The Geometric Distribution 1295.2.2 The Negative Binomial Distribution 1305.2.3 The Exponential Distribution 131

Tableof Contents XV

5.2.4 The Erlang Distribution 1345.2.5 The Poisson Process 135

5.3 The Normal Distribution 1365.4 Central Limit Theorem 140

5.4.1 Examples 1455.5 Multidimensional Normal Distribution 147

5.5.1 2-dimensional Normal Distribution 1485.6 MAPLE Session 1535.7 Exercises 158

6 Numerical Simulations and Statistical Inference 1616.1 Pseudo-Random Number Generation 1616.2 Basic Statistical Tests 165

6.2.1 p-value 1676.3 The Runs Test , 1686.4 Goodness of Fit Tests 1746.5 Independence Test 1776.6 Confidence Intervals 1796.7 Inference for Numerical Simulations 1826.8 MAPLE Session 1856.9 Exercises 190

7 Stochastic Processes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1937.1 Conditional Expectation 1937.2 Markov Chains " , 198

7.2.1 Random Walks 1997.2.2 Evolution of Probabilities 2027.2.3 Irreducible and Transient Chains 205

7.3 Special Classes of Stochastic Processes 2107.4 Continuous-Time Stochastic Processes 211

7.4.1 Wiener Process 2127.4.2 Markov Processes 2157.4.3 Diffusion Processes 217

7.5 Continuity and Convergence " 2187.6 MAPLE Session . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2207.7 Exercises . . .. ... . . . . . . . . .. . . . .. . .. ... . . .. . . ....... ... . . 226

8 Stochastic Calculus 2298.1 Introduction 2298.2 Ito Stochastic Integrals 2308.3 Stochastic Differential Equations 2338.4 Stochastic Chain Rule: the Ito Formula 2368.5 Stochastic Taylor Expansions 2388.6 Stratonovich Stochastic Calculus 2418.7 MAPLE Session . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244

XVI Table of Contents

8.8 Exercises.. . . .. .. . . . . . .... .. . ... . .. . . ..... . . . ... .. .. . . . 246

9 Stochastic Differential Equations 2499.1 Solving Scalar Str atonovich SDEs 2499.2 Linear Scalar SDEs " 253

9.2.1 Moment Equations " 2569.3 Scalar SDEs Reducible to Linear SDEs 2579.4 Vector SDES 260

9.4.1 Vector Ito Formula 2629.4.2 Fokker-Planck Equation 264

9.5 Vector Linear SDE 2659.5.1 Moment Equations 2679.5.2 Linearization 267

9.6 Vector Stratonovich SDEs 2689.7 MAPLE Session 2709.8 Exercises 275

10 Numerical Methods for SDEs 27710.1 Numerical Methods for ODEs 27710.2 The Stochastic Euler Scheme 280

10.2.1 Statistical Estimates and Confidence Intervals 28310.3 How to Derive Higher Order Schemes 284

10.3.1 Multiple Stochastic Integrals 28610.4 Higher Order Strong Schemes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28810.5 Higher Order Weak Schemes 29010.6 The Euler and Milstein Schemes for Vector SDEs 29110.7 MAPLE Session 29510.8 Exercises 301

Bibliographical Notes 303

References. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305

Index 307