numerical methods book crepey
TRANSCRIPT
-
8/4/2019 Numerical Methods Book Crepey
1/244
Numerical Methods in Finance
Stphane CRPEY, vry [email protected]
CIMPAJordanie, September 2005
Figure 1: Local volatility on the DAX index
-
8/4/2019 Numerical Methods Book Crepey
2/244
CIMPAJordanie September 2005
Contents
1 Random numbers 2
2 Pseudo random generators 3
2.1 Definition . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.2 Properties required for a good pseudo-random numbersgenerator . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.3 Constructing pseudo-random number generators . . . . . . 6
3 Low-discrepancy sequences 8
3.1 Definition . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3.2 General remarks on low discrepancy sequences . . . . . . 10
3.3 Sobol sequences . . . . . . . . . . . . . . . . . . . . . . . 11
S. Crpey Page 2
-
8/4/2019 Numerical Methods Book Crepey
3/244
CIMPAJordanie September 2005
4 Simulation ofnon-uniform random variables or vectors 14
4.1 Inverse method . . . . . . . . . . . . . . . . . . . . . . . 14
4.2 Simulation of Gaussian standard variables . . . . . . . . . 14
4.3 Simulation of Gaussian vectors . . . . . . . . . . . . . . . 17
5 Principle of the Monte Carlo Simulation 19
5.1 Limit theorems . . . . . . . . . . . . . . . . . . . . . . . 195.2 Estimation principle . . . . . . . . . . . . . . . . . . . . . 20
5.3 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . 22
6 Variance Reduction Techniques 246.1 Antithetic Variables . . . . . . . . . . . . . . . . . . . . . 24
6.2 Control Variables . . . . . . . . . . . . . . . . . . . . . . 26
6.3 Importance Sampling . . . . . . . . . . . . . . . . . . . . 27
S. Crpey Page 3
-
8/4/2019 Numerical Methods Book Crepey
4/244
CIMPAJordanie September 2005
6.4 Efficiency of the Monte Carlo methods . . . . . . . . . . . 29
7 Quasi Monte Carlo Simulation 317.1 General principle . . . . . . . . . . . . . . . . . . . . . . 31
7.2 Koksma-Hlawka inequality . . . . . . . . . . . . . . . . . 31
7.3 Remarks . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
8 Computing the Greeks by (Quasi) Monte Carlo 35
8.1 Finite Differences . . . . . . . . . . . . . . . . . . . . . . 35
8.2 Derivation of the payoff . . . . . . . . . . . . . . . . . . . 36
8.3 Payoff regularization . . . . . . . . . . . . . . . . . . . . 37
9 (Quasi) Monte Carlo algorithms for vanilla options 40
9.1 (Q)MC BS1D . . . . . . . . . . . . . . . . . . . . . . . . 40
S. Crpey Page 4
-
8/4/2019 Numerical Methods Book Crepey
5/244
CIMPAJordanie September 2005
9.2 (Q)MC BS2D . . . . . . . . . . . . . . . . . . . . . . . . 57
10 Simulation of processes 8010.1 Brownian Motion . . . . . . . . . . . . . . . . . . . . . . 80
10.2 BlackScholes model . . . . . . . . . . . . . . . . . . . . 83
10.3 General diffusions: Euler and Milshtein scheme . . . . . . 85
10.4 Heston model . . . . . . . . . . . . . . . . . . . . . . . . 87
10.5 Monte Carlo Simulation for Processes . . . . . . . . . . . 89
11 (Quasi) Monte Carlo methods for Exotic Options 91
11.1 Lookback options . . . . . . . . . . . . . . . . . . . . . . 9111.2 Andersen and Brotherton-Ratcliffe Algorithm for Look-
back Options . . . . . . . . . . . . . . . . . . . . . . . . 94
11.3 Barrier options . . . . . . . . . . . . . . . . . . . . . . . 104
S. Crpey Page 5
-
8/4/2019 Numerical Methods Book Crepey
6/244
CIMPAJordanie September 2005
11.4 Asian options . . . . . . . . . . . . . . . . . . . . . . . . 107
12 Trees for vanilla options 11012.1 Cox-Ross-Rubinstein as an approximation to Black-Scholes 110
12.2 Algorithm (CRR) . . . . . . . . . . . . . . . . . . . . . . 116
12.3 Variants of the CRR tree . . . . . . . . . . . . . . . . . . 123
12.4 Trinomial trees . . . . . . . . . . . . . . . . . . . . . . . 126
12.5 Algorithm (Kamrad-Ritchken) . . . . . . . . . . . . . . . 131
12.6 Miscellaneous remarks . . . . . . . . . . . . . . . . . . . 138
13 Trees for exotic options 14413.1 Inaccuracy of the direct method for barrier options . . . . 144
13.2 The Ritchken algorithm for barrier options . . . . . . . . . 145
13.3 Customization of trees . . . . . . . . . . . . . . . . . . . 145
S. Crpey Page 6
-
8/4/2019 Numerical Methods Book Crepey
7/244
CIMPAJordanie September 2005
14 Finite Differences for European Vanilla Options 149
14.1 Localization and Discretization . . . . . . . . . . . . . . . 149
14.2 The -scheme . . . . . . . . . . . . . . . . . . . . . . . 158
14.3 Explicit Method . . . . . . . . . . . . . . . . . . . . . . . 160
14.4 Implicit Methods . . . . . . . . . . . . . . . . . . . . . . 161
15 Finite Differences for American Vanilla Options 167
15.1 Variational inequality in finite dimension . . . . . . . . . . 167
15.2 Linear complementarity problem . . . . . . . . . . . . . . 168
15.3 Splitt ing methods . . . . . . . . . . . . . . . . . . . . . . 173
16 Finite Difference -scheme Algorithm for Vanilla Options 176
17 Finite Differences for 2D Vanilla Options 189
S. Crpey Page 7
-
8/4/2019 Numerical Methods Book Crepey
8/244
CIMPAJordanie September 2005
17.1 Numerical integration by an A.D.I. Method . . . . . . . . 192
17.2 American Options . . . . . . . . . . . . . . . . . . . . . . 193
17.3 Algorithm (A.D.I. BS2D) . . . . . . . . . . . . . . . . . . 194
18 Finite Differences for Exotic Options 208
18.1 Lookback Options . . . . . . . . . . . . . . . . . . . . . . 208
18.2 Barrier Options . . . . . . . . . . . . . . . . . . . . . . . 20918.3 Asian Options . . . . . . . . . . . . . . . . . . . . . . . . 211
19 Dynamic tests 215
19.1 Delta-hedging . . . . . . . . . . . . . . . . . . . . . . . . 21519.2 Dynamic tests using Brownian Bridge in the BlackScholes
model . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218
20 Conclusion 224
S. Crpey Page 8
-
8/4/2019 Numerical Methods Book Crepey
9/244
CIMPAJordanie September 2005
This lecture is largely based on the public releases of the option pricing
software and documentation system PREMIA developed since 1999 by
the MATHFI project at INRIA www.inria.fr and CERMICScermics.enpc.fr
In particular all code samples, written in the C programming language,
are extracted from PREMIA (except for minor modifications).
The aim of the Premia project is threefold: first, to assist the R&D
professional teams in their day-to-day duty, second, to help the academics
who wish to perform tests of a new algorithm or pricing method without
starting from scratch, and finally, to provide the graduate students in the
field of numerical methods for finance with open-source examples of
implementation of many of the algorithms found in the literature
www-rocq.inria.fr/mathfi/Premia/index.html
S. Crpey Page 1
-
8/4/2019 Numerical Methods Book Crepey
10/244
CIMPAJordanie September 2005
1 Random numbers
Sample random variables or vectors in Rd, d 1First get sequences of uniform random variables or vectors un over
[0, 1]d. Then transform the un into xn with specific distributions
Sample iid random variables over [0, 1] and group them in buckets of size
d
Or use quasi random generators (low-discrepancy sequences) over [0, 1]d
A bad generator can lead to false results for a considered simulation
S. Crpey Page 2
-
8/4/2019 Numerical Methods Book Crepey
11/244
CIMPAJordanie September 2005
2 Pseudo random generators
Simulation of pseudo-uniform variables over [0, 1] [31, 30, 29, 36, 34, 23]
2.1 Definition
A pseudo-random number generatoris a structure G = (S, s0, T , U , G)
where S is a finite set of states, s0 S is the initial state, the mappingT : S S is the transition function, U is a finite set ofoutputs symbols,and G : S U is the output function.This definition was introduced by LEcuyer in [31] or [30] for instance.
Since S is finite, the sequence of states is ultimately periodic. The period
is the smallest positive integer such that for some integer 0 and forall n , s+n = sn. The smallest with this property is called thetranscient. When = 0, the sequence is said to be purely periodic.
The resolution of a generator is the largest number x such that all output
S. Crpey Page 3
-
8/4/2019 Numerical Methods Book Crepey
12/244
CIMPAJordanie September 2005
values are multiples ofx. It determines the maximal number of different
values we can obtain with the generator.
2.2 Properties required for a good pseudo-randomnumbers generator
Large period length, at least 260
Good equidistribution properties and statistical independence ofsuccessive pseudorandom numbers
The generator should pass statistical tests for uniformity and
independence [23, 30]: general tests like chi-square or
Kolmogorov-Smirnov tests; specific tests like equidistribution test,
serial test, gap test, partition test, etc.. Note that since generated
sequences are deterministic, we can always find a test the sequence
will fail.
S. Crpey Page 4
-
8/4/2019 Numerical Methods Book Crepey
13/244
CIMPAJordanie September 2005
Little intrinsic structureSuccessive values produced by some of the described generators have
a lattice structure in any given dimension. Efficiency, fast generation algorithm, requiring not too much memory
space
Especially if we use many generators together or in parallel
Repeatability (fixing a given seed)Very useful for practical applications. Otherwise we can use thecurrent time (computer clock) to initialize the generators
PortabilityIt means that the generator will produce exactly the same sequence
on different computers or with different compilers
UnpredictabilityIt means that we can not predict the next generated value by thealgorithm from the previous ones (though this is less important for
S. Crpey Page 5
-
8/4/2019 Numerical Methods Book Crepey
14/244
CIMPAJordanie September 2005
finance than for other applications, cryptography in particular)
2.3 Constructing pseudo-random number generators
The simplest methods to construct random number generators are linear
methods. Linear methods use a linear recurrence relation to compute the
next value from the previous onesLinear Congruential Generators (LCG):
The nth random number is given by
un =Un
m [0, 1]
where
Un = (aUn1 + c) mod m
where m > 0, a > 0 and c are fixed integers
S. Crpey Page 6
-
8/4/2019 Numerical Methods Book Crepey
15/244
CIMPAJordanie September 2005
Such generators produce a lot of regularity in sequences and an
unfavorable lattice structure
Random numbers generator of LEcuyer with Bayes & Durhamshuffling procedure : Combination of two short periods LCG to obtain alonger period generator
S. Crpey Page 7
-
8/4/2019 Numerical Methods Book Crepey
16/244
CIMPAJordanie September 2005
3 Low-discrepancy sequences
Such sequences neither are random nor pseudo-random but deterministicand successive values are not independent [37, 36, 35, 32]
However they satisfy good properties of equidistribution on [0, 1]d and we
have that 1NNi=1 f(i) [0,1]
d f(u)du
3.1 Definition
Notations:
We note [|0, x|] = {y = (y1, . . . , yd) [0, 1]d, y x} ; we consider thaty
x if and only if for all j = 1, . . . , d : yj
xj .
(x) denotes the volume of[|0, x|]. (x) = x1 xd.We note Id = [0, 1]d the closed d-dimensional unit cube.
S. Crpey Page 8
-
8/4/2019 Numerical Methods Book Crepey
17/244
CIMPAJordanie September 2005
For = (n)n1 a sequence in Id and x Id, we note :
Dn(, x) =1
n
ni=1
1[|0,x|](i) (x)
Definitions:
A sequence (n)n 1 is said to be equidistributedon [0, 1]d if
x [0, 1]d, limn+
1
n
ni=1
1[|0,x|](i) = (x)
The value Dn() defined as:
Dn() = supxId |Dn(, x)|is called the star discrepancy for the first n terms of the sequence.
The discrepancy is a very important notion for Quasi-Monte Carlo
simulation. It measures how a given set of points is distributed in
S. Crpey Page 9
-
8/4/2019 Numerical Methods Book Crepey
18/244
CIMPAJordanie September 2005
Id = [0, 1]d. It can be viewed as a quantitative measure for thedeviation from the uniform distribution.
A sequence () is said to be a low-discrepancy sequence if itsdiscrepancy satisfies DN = O(
(logN)d
N ) or if it is asymptoticallybetter than the one of a random sequence obtained from the law ofiterated logarithm as O(( log logNN )
12 ).
3.2 General remarks on low discrepancy sequences
Quasi-random numbers combine the advantage of a random sequence thatpoints can be added incrementally, with the advantage of a lattice.
For large dimension d, the theoretical bound (log N)d/N may only bemeaningful for extremely large values ofN.
Low discrepancy sequences are very useful for low dimension. In highdimension d, a lattice can only be refined by increasing the number of
S. Crpey Page 10
-
8/4/2019 Numerical Methods Book Crepey
19/244
CIMPAJordanie September 2005
points by a factor 2d.
Orthogonal projections: if a d-dimensional sequence is uniformlydistributed in Id, then two-dimensional sequences formed by pairing
coordinates should also be uniformly distributed. The appearance of
non-uniformity in these projections is an indication of potential problems
in using a quasi-random sequence for integration [32].
3.3 Sobol sequences
The Sobol sequence [42] is one of the most used sequences for
Quasi-Monte Carlo simulation and one of the most successful for
financial applications. Its construction is based on primitive polynomials
in the field Z2 and bitwise XOR (Exclusive Or) operations
S. Crpey Page 11
-
8/4/2019 Numerical Methods Book Crepey
20/244
CIMPAJordanie September 2005
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Sobol dim 1 and 2
Figure 2: Orthogonal projection on the first two coordinates of the first
10000 points of the Sobol sequence in dimension 160
S. Crpey Page 12
-
8/4/2019 Numerical Methods Book Crepey
21/244
CIMPAJordanie September 2005
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Sobol dim 159 and 160
Figure 3: Orthogonal projection on the last two coordinates of the first
10000 points of the Sobol sequence in dimension 160
S. Crpey Page 13
-
8/4/2019 Numerical Methods Book Crepey
22/244
CIMPAJordanie September 2005
4 Simulation of non-uniform random
variables or vectors4.1 Inverse method
Simulation of a variable with known (or computable) inverse cumulative
distribution function F- First, simulate a variable u uniformly distributed on [0, 1], that is a
random number from one of the pseudo-random numbers generators or
one of the quasi-random number generators
- Then take x = F1(u)
Example: To simulate an exponential random variable with parameter ,
take 1 ln(1 U).4.2 Simulation of Gaussian standard variables
S. Crpey Page 14
-
8/4/2019 Numerical Methods Book Crepey
23/244
CIMPAJordanie September 2005
One direct method to generate standard Gaussian variables: Box-Mller
transformation
Box-Mller transformation:If(u, v) is uniformly distributed on [0, 1]2 then x and y defined by
x =2log u sin(2v)
y =
2log u cos(2v)
are distributed as independent standard gaussians.
Proof: Let be uniform over [0, 2] and 2 be exponential with
parameter 1/2, independent from . Then the pair
(X, Y) = ( cos , sin ) is standard Gaussian. Indeed, for every
S. Crpey Page 15
-
8/4/2019 Numerical Methods Book Crepey
24/244
CIMPAJordanie September 2005
measurable and bounded function f
Ef(X, Y) = +
0 2
0 f( cos , sin )
1
2 e
2
2
d(2
)
d
2
=
+0
20
f( cos , sin )de2
2d
2
= R R f(x, y)e x2+y22 dxdy
2
2
Remarks: This method requires two independent random values toobtain two gaussian variables
- It must not be used when random numbers u and v are generated fromtwo successive values of a one-dimensional low-discrepancy sequence,
because they are not independent in this case. To apply one of these
algorithms with Quasi Monte Carlo simulation, you should generate u
S. Crpey Page 16
-
8/4/2019 Numerical Methods Book Crepey
25/244
CIMPAJordanie September 2005
and v independently, that is necessarily from two different
one-dimensional sequences or from one two-dimensional sequence.
Simulating gaussian variable with the inverse method: The inversecumulative distribution 1 has not an explicit form. Thus to use theinverse method to simulate gaussian variable we need an approximation of
1. A very good and quick approximation is given by Moros algorithm.
4.3 Simulation of Gaussian vectors
Simulate of a N-dimensional Gaussian vector V with zero mean and a
covariance matrix is done by the following way:
- First we compute the lower triangulary matrix obtained with the
Cholesky decomposition of, that is such that = t. We have :
ii =
ii i1
k=1(ik)2
ji =ij
Pi1k=1 ikjkii
for j = i + 1, . . . , N
S. Crpey Page 17
C S
-
8/4/2019 Numerical Methods Book Crepey
26/244
CIMPAJordanie September 2005
- We generate N independent gaussian standard variables gi. We noteG = (g1, . . . , gN).
- We compute V = G.Then V is distributed asN(0, ).Two-dimensional case:
Assume that the covariance matrix is expressed by:
21 1212 22 Then is given by the following matrix:
11 1221 22 = 1 02 1 22 This will be used in case of simulation of correlated two-dimensionalbrownian motions, for instance to price options in a BS2D model
S. Crpey Page 18
CIMPA J d i S b 2005
-
8/4/2019 Numerical Methods Book Crepey
27/244
CIMPAJordanie September 2005
5 Principle of the Monte Carlo Simulation
A general method for evaluating an integral as an expected value, basedon the Strong Law of Large Numbers (LLN) and the Central LimitTheorem
It provides an unbiased estimator and the error on the estimate iscontrolled within a confidence interval
5.1 Limit theorems
Strong Law of Large Numbers:
1
N
N
i=1
(xi)
a.s.
E[(X)]ifxi are i.i.d to X and E[|(X)|] < +.
Central Limit Theorem: The estimator converges in law to a gaussian
S. Crpey Page 19
CIMPA J d i S t b 2005
-
8/4/2019 Numerical Methods Book Crepey
28/244
CIMPAJordanie September 2005
standard distribution.
N
1NN
i=1
(xi) E[(X)] L N(0, 1)where 2 = Var[(X)] and 2 < +.5.2 Estimation principle
We want to estimate the following parameter I:
I = E[(X)]
where is some function on D Rn over R and X = (X1, . . . , X n) isa n-dimensional vector of random variables with law .
I can be expressed as an integral
I =
D
(x)d(x)
An unbiased estimator ofI for N trials with the Standard Monte Carlo
S. Crpey Page 20
CIMPA J d i S t b 2005
-
8/4/2019 Numerical Methods Book Crepey
29/244
CIMPAJordanie September 2005
method is defined by:
N =1
N
N
i=1 (xi)with xi i.i.d to .
Variance of the estimator is given as:
2N =
2
N
with unbiased estimator:
2N =
1
N
1
1
N
N
i=12(xi) 2N
Variance decreases to 0 when N +. It means that the greater N is,the more accurate the estimator is. The speed of convergence ofN to I isN
. It is independant of the dimension n.
S. Crpey Page 21
CIMPA J d i S t b 2005
-
8/4/2019 Numerical Methods Book Crepey
30/244
CIMPAJordanie September 2005
A confidence interval IC = [A, B] for the threshold (confidence level)1 2 is such that P(A < I < B) = 1 2 and it is built as follows:
IC = [N zN; N + zN]where z = 1(1 ) and 1 is the inverse cumulative distributionfunction of the standard gaussian law.For instance, if the threshold is chosen to 95% then = 2, 5% and
z 1.96.5.3 Properties
We briefly summarize some advantages and disadvantages of theStandard Monte Carlo method.
Advantages:- This method does not require regularity or differentiabilityproperties for the function . Thus we can implement this methodvery easily if we are able to generate the variable X according to .
S. Crpey Page 22
CIMPA Jordanie September 2005
-
8/4/2019 Numerical Methods Book Crepey
31/244
CIMPAJordanie September 2005
- The estimator is unbiased.
- The error on the estimate can be controlled by the Central Limit
Theorem, and we can build a confidence interval. Disadvantages:
- We have to realize a lot of simulations to obtain an accurate
estimator. Therefore computing time can be very high.
S. Crpey Page 23
CIMPA Jordanie September 2005
-
8/4/2019 Numerical Methods Book Crepey
32/244
CIMPAJordanie September 2005
6 Variance Reduction Techniques
We saw that a disadvantage of the standard Monte Carlo Simulation is itsrequired computing time. Thus we are now interested in AcceleratedMonte Carlo Simulation.To reduce computing time, we can use variance reduction techniques[38]. The principle is to rewrite the parameter I in order to express it in
function of a new random variable with smaller variance 2. Then weneed a smallest number of iterations to obtain the same accuracy on theestimate.
6.1 Antithetic Variables
Principle of antithetic variables is to introduce some correlation betweenthe terms of the estimate.When simulation is done by the inverse cumulative distribution function,we use uniform numbers ui on [0, 1]. For this method, we use each ui
S. Crpey Page 24
CIMPA Jordanie September 2005
-
8/4/2019 Numerical Methods Book Crepey
33/244
CIMPAJordanie September 2005
twice, as ui and 1 ui. These both variables have same law but are notindependant. We note xi and xi the variables generated from ui and
1 ui respectively.An unbiased estimator ofI with N trials is defined by:
N =1
2N
Ni=1
((xi) + (xi))
with xi i.i.d to .Variance of the estimator is given as:
2N =1
2N(V ar[(X)] + Cov((X), (X)))
The following theorem give sufficient conditions to obtain a variance
reduction with this method.Theorem: If is a monotone, continuous, derivable function then
(antN )2 1
2(stdN )
2
S. Crpey Page 25
CIMPA Jordanie September 2005
-
8/4/2019 Numerical Methods Book Crepey
34/244
CIMPAJordanie September 2005
Factor 1/2 is due to the sample size for the antithetic method: in fact, theestimator contains 2N terms.
6.2 Control Variables
Principle of this method is to introduce an other model for which we havean explicit solution and to estimate the difference between our firstparameter I and the new one.
I = E[(X)]
= E[(X) (X)] + E[(X)]where is a function such that E[(X)] = m is known.
An unbiased estimator ofI with N trials is defined by:
N =1
N
Ni=1
((xi) (xi)) + m
S. Crpey Page 26
CIMPA Jordanie September 2005
-
8/4/2019 Numerical Methods Book Crepey
35/244
CIMPAJordanie September 2005
with xi i.i.d to .
Variance of the estimator is given as:
2N =1NV ar[(X) (X)]
= 1N (V ar[(X)] + V ar[(X)] 2Cov((X), (X)))Variance reduction with regard to standard Monte Carlo simulation is not
guaranteed by this method. To decrease the variance, functions and
must have a large positive correlation. It implies a specific choice for the
control variate .
6.3 Importance Sampling
The basic idea of importance sampling consists in concentrating thedistribution of the sample points in the most contributive parts of the
space. For that, we introduce an new density which changes the initial
S. Crpey Page 27
CIMPA Jordanie September 2005
-
8/4/2019 Numerical Methods Book Crepey
36/244
CIMPAJordanie September 2005
density ofX.
I =
D(x)(x)(x)d(x)
= E (X)(X)(X)We obtain the following estimator:
N =1
N
N
i=1(xi)
(xi)
(xi)
with xi i.i.d to .Variance of the estimator is expressed as:
2N =1
NV ar
(X)
(X)
(X)
is named the importance function. It must verify that (x) > 0, x Esuch that (x)(x) > 0.
Variance reduction with regard to standard Monte Carlo simulation is not
S. Crpey Page 28
CIMPAJordanie September 2005
-
8/4/2019 Numerical Methods Book Crepey
37/244
CIMPAJordanie September 2005
guaranteed by this method. It depends on the choice of, which is not an
easy step. However, the minimum of the variance is reached for the
following importance density called the optimal density.
=|(x)|(x)|(y)|(y)dy
Usually this density is unknown and it contains the term I as soon as
> 0.6.4 Efficiency of the Monte Carlo methods
We introduce a criterion to compare the efficiency of the various
simulation methods, standard simulation or with variance reduction
techniques. This criterion takes into account the computing time requiredby the simulation for each method. It is independent on the sample size.
S. Crpey Page 29
CIMPAJordanie September 2005
-
8/4/2019 Numerical Methods Book Crepey
38/244
CIMPA Jordanie September 2005
Efficiency of the method j with regard to the method i is defined by:
(i, j) = limNi,Nj+Ni(i)
Nj (j)tNi(i)tNj (j)The method j is considered to be more efficient than the method i if
(i, j) 1If we assume that the computing time is proportional to the sample size,
that is tNi(i) = kiNi then:
(i, j) =ij
kikj
where k is a factor, which exprimes the complexity of the algorithm for
the considered method. For instance, if(i, j) = 3, it means that method i
requires 9 times more time to obtain the same accuracy than method j. In
other words, with the same computing time, standard error for method j is
3 times smaller than the one of method i.
S. Crpey Page 30
CIMPAJordanie September 2005
-
8/4/2019 Numerical Methods Book Crepey
39/244
CIMPA Jordanie September 2005
7 Quasi Monte Carlo Simulation
7.1 General principle
Estimate
E[f(U)] [0,1]d
f(u)du
byNi=1 f(i) where is a d-dimensional low-discrepancy sequenceSpecial case: f F1X . Then (X)
(law)= f(U), so
E[f(U)] = E[(X)].
7.2 Koksma-Hlawka inequalityDefinitions:
S. Crpey Page 31
CIMPAJordanie September 2005
-
8/4/2019 Numerical Methods Book Crepey
40/244
CIMPA Jordanie September 2005
The variation of a function f on Id = [0, 1]d in the sens ofVitali isdefined by :
Vd
(f) = suppP(Id)Ap |(f, A)|where P(Id) is the set of all partitions ofId into subintervals,
p P(Id) denotes a partition and A p a subinterval.(f, A) is the alternative sum of the values off at the vertices ofA.
Vd(f) =[0,1]d
dfu1 . . . ud du1 . . . d udif the partial derivatives exist and are continuous on Id.
The variation off on Id in the sense ofHardy and Krause is defined
by :
V(f) =dr=1
1i1
-
8/4/2019 Numerical Methods Book Crepey
41/244
CIMPA Jordanie September 2005
restriction off to the r dimensional face
{(x1, . . . , xd) Id/xk = 1 if k {i1, . . . , ir}}
Theorem: Iff has bounded variation V(f) on Id in the sense ofHardy-Krause, then for any 1, . . . , n [0, 1]d, we have:
n 1,
1
n
n
i=1f(i)
[0,1]d
f(x)dx
V(f)Dn()
7.3 Remarks
Through the Koksma-Hlawka inequality, we understand the need to have
sequences with discrepancy DN as small as possibleThe Koksma-Hlawka inequality gives an a priori deterministic bound for
the error in the approximation of[0,1]d
f(x)dx by the sum 1nn
i=1 f(i).
This error is expressed in term of the discrepancy of the sequence and the
S. Crpey Page 33
CIMPAJordanie September 2005
-
8/4/2019 Numerical Methods Book Crepey
42/244
CIMPA Jordanie September 2005
variation of the function f. Nevertheless it is often difficult to calculate or
even to estimate the variation off. Moreover, since for large dimension d,
the asymptotic bound (log N)d
/N of low-discrepancy sequences mayonly be meaningful for extremely large values ofN, and because
(log N)d/N increases exponentially with d, then the bound in
Koksma-Hlawka inequality gives no relevant information until a very
large number of points is used
In opposition to Monte Carlo simulation, Quasi-Monte Carlo doesnt
provide an confidence interval for the estimator. We cannot compute
empirical variance of the sample because successive terms are not
independent. This is due to the construction of the low-discrepancy
sequenceAnother difference in comparison with Monte Carlo is that the
convergence rate for QMC simulation depends on the dimension d of the
considered model through discrepancy Dd
S. Crpey Page 34
CIMPAJordanie September 2005
http://slidesfinumscrepey.pdf/ -
8/4/2019 Numerical Methods Book Crepey
43/244
CIMPA Jordanie September 2005
8 Computing the Greeks by (Quasi) Monte
Carlo
In risk-neutral diffusion models, the option price is given by:
P(x) = ERN[(SxT)]
where Sxt
is the unique solution of
dSt = b(St)dt + (St)dWt , Sx0 = x.
Option theory states that the option seller must hold at every date t
=
x
E[(SxT)]
units of stock in his portfolio in order to hedge the option. The goal of thissection is to propose various (Q)MC methods to compute [13, 6, 14].
8.1 Finite Differences
S. Crpey Page 35
CIMPAJordanie September 2005
-
8/4/2019 Numerical Methods Book Crepey
44/244
C Jo da e Septe be 005
For fixed h > 0, we approach by decentered finite differences
1
h E[(Sx+hT )] E[(SxT)]or, preferably, by centered finite differences
1
2h
E[(Sx+hT )] E[(SxhT )]
The two terms of these differences can be estimated by (Q)MC methods.
In so doing, it is better to use common random numbers to estimate thetwo terms. For instance, in the special case of the BlackScholes modelSxt = x exp((r
2
2 )t + Wt), can be estimated by
1
2hM
M
i=1 ((x + h)e(r2
2 )T+Tgi)
((x
h)e(r
2
2 )T+Tgi)
where the gi are standard Gaussian (Q)MC draws.
8.2 Derivation of the payoff
S. Crpey Page 36
CIMPAJordanie September 2005
-
8/4/2019 Numerical Methods Book Crepey
45/244
p
In cases where is regular and where we know how to derive SxT with
respect to x, can be formally computed as
= x
E(SxT) = E
x(SxT) = E
(SxT)SxTx
For instance, in the BlackScholes model, SxT
x =SxTx , so
=1
xE[(Sx
T)Sx
T]
provided the derivative of exists, for instance in the sense of
distributions.
8.3 Payoff regularization
In the BlackScholes model, we have
E[(SxT)] =
R
(y)pT(x, y) dy
S. Crpey Page 37
CIMPAJordanie September 2005
-
8/4/2019 Numerical Methods Book Crepey
46/244
p
with
pT(x, y) =1
y
22Te 1
22T
log( y
x)(r22 )T
2
So, formally
=
R
(y)
xpT(x, y) dy
= R (y)xpT(x, y)
pT(x, y)pT(x, y) dy
= E
(SxT)
xlog(pT(x, S
xT))
.
Straightforward computation gives
x log(pT(x, SxT)) =
WT
xT
Thus
= E
(SxT)
WTxT
S. Crpey Page 38
CIMPAJordanie September 2005
-
8/4/2019 Numerical Methods Book Crepey
47/244
p
which can be easily computed by (Q)MC.
The following result extends this methodology to more general diffusions.
Theorem: Assuming b and in class C1b with positive, let S be thesolution of
dSt = b(St)dt + (St)dWt , Sx0 = x.
Defining
Yxt =
Sxtx
then Y is the unique solution of
dYtYt
= bx(St)dt + x(St)dWt , Yx0 = 1
Moreover, for every function in class C0b
= E
(SxT)
1
T
T0
Yt(St)
dWt
.
S. Crpey Page 39
CIMPAJordanie September 2005
-
8/4/2019 Numerical Methods Book Crepey
48/244
p
9 (Quasi) Monte Carlo algorithms for vanilla
options
9.1 (Q)MC BS1D
Description: Computation, for a Call - Put - CallSpread or DigitEuropean Option, of its Price and its Delta with the Standard Monte Carlosimulation. In the case of Monte Carlo simulation, the program providesestimations for price and delta with a confidence interval. In the case ofQuasi-Monte Carlo simulation, the program just provides estimations forprice and delta. For a Call, the implementation is based on the Call-PutParity relationship.
Input parameters:
StepNumber N Generator_Type
S. Crpey Page 40
CIMPAJordanie September 2005
-
8/4/2019 Numerical Methods Book Crepey
49/244
Increment inc
Confidence Value
Output parameters:
Price P Error Price P
Delta Error delta Price Confidence Interval: ICP =[Inf Price, Sup Price]
Delta Confidence Interval: IC =[Inf Delta, Sup Delta]
The underlying asset price evolves according to the Black and Scholes
model, that is:
dSu = Su((r d)du + dBu), STt = s
S. Crpey Page 41
CIMPAJordanie September 2005
-
8/4/2019 Numerical Methods Book Crepey
50/244
then
ST = s exp((r d 2
2)t) exp(Bt)
where ST denotes the spot at maturity T, s is the initial spot, t is the time
to maturity.
The Price of an option at T t is:
P = E[exp(
rt)f(K, ST, R)]
where f denotes the payoff of the option, K the strike and R the rebate
(for Digit option only).
The Delta is given by:
= s
E[exp(rt)f(K, ST, R)]
S. Crpey Page 42
CIMPAJordanie September 2005
-
8/4/2019 Numerical Methods Book Crepey
51/244
The estimators are expressed as:
P = 1N exp(rt)N
i=1
P(i)
where P(i) = f(K, ST(i), K)
=
1
Nexp(rt)
N
i=1
sP(i) =
1
Nexp(rt)
N
i=1(i)
The values for P(i) and (i) are detailed for each option.
Put: The payoff is (K ST)+. We have:P(i) = (K ST(i))+
(i) =
ST(i)s = ST(i)s if P(i) 0
0 otherwise
Call: The payoff is (ST K)+.
S. Crpey Page 43
CIMPAJordanie September 2005
-
8/4/2019 Numerical Methods Book Crepey
52/244
The Call-Put Parity relations for price and delta are expressed by:
C = P + s exp(
dt)
Kexp(
rt)
C = P + exp(dt)where C and P respectively denotes the Call and the Put prices. They
will be used for the Call simulation (in order to limit variance).
CallSpread: The payoff is (ST
K1)
+
(ST
K2)
+.
We have:
P(i) =
(ST(i) K1)+ (ST(i) K2)+
(i) =8>>>:
ST(i)s
= ST(i)s
if ST(i) K1 and ST(i) K2
S
T
(i)s =
ST
(i)s if ST(i) K2 and ST(i) K1
0 otherwise
Digit: The payoff is R1{STK0}.
S. Crpey Page 44
CIMPAJordanie September 2005
-
8/4/2019 Numerical Methods Book Crepey
53/244
We have:P(i) = R1{ST(i)K0}
To have an estimation of the Delta in the case of a Digit option, weneed to use the increment value inc at each iteration i as:
i =1
2s.inc[P (ST(i)(s(1 + inc)), K , R) P (ST(i)(s(1 inc)), K , R)]
Code Sample:static int MCStandard(...)
{
...
/*Value to construct the confidence interval*/
alpha= (1.- confidence)/2.;z_alpha= Inverse_erf(1.- alpha);
/*Initialisation*/
flag= 0;
S. Crpey Page 45
CIMPAJordanie September 2005
-
8/4/2019 Numerical Methods Book Crepey
54/244
s_plus= s*(1.+inc);
s_minus= s*(1.-inc);
mean_price= 0.0;
mean_delta= 0.0;
var_price= 0.0;
var_delta= 0.0;
/* CallSpread */
K1= p->Par[0].Val.V_PDOUBLE;
K2= p->Par[1].Val.V_PDOUBLE;
/*Median forward stock and delta values*/
sigma_sqrt=sigma*sqrt(t);
forward= exp(((r-divid)-SQR(sigma)/2.0)*t);forward_stock= s*forward;
forward_delta= exp(-SQR(sigma)/2.0*t);
/* Change a Call into a Put to apply the Call-
S. Crpey Page 46
CIMPAJordanie September 2005
-
8/4/2019 Numerical Methods Book Crepey
55/244
Put parity */
if((p->Compute) == &Call)
{
(p->Compute) = &Put;
flag= 1;
}
/*MC sampling*/
init_mc= InitGenerator(generator,simulation_dim
,N);
/* Test after initialization for the generator
*/
if(init_mc == OK){
mc_or_qmc= Rand_Or_Quasi(generator);
/* Begin N iterations */
S. Crpey Page 47
CIMPAJordanie September 2005
-
8/4/2019 Numerical Methods Book Crepey
56/244
for(i=1 ; iCompute)(p->Par,S_T);
/*Delta*/
/*Digit*/
if ((p->Compute) == &Digit)
S. Crpey Page 48
CIMPAJordanie September 2005
-
8/4/2019 Numerical Methods Book Crepey
57/244
{
price_sample_plus= (p->Compute)(p->
Par, U_T*s_plus);
price_sample_minus= (p->Compute)(p->
Par, U_T*s_minus);
delta_sample= (price_sample_plus-price
_sample_minus)/(2.*s*inc);
}
/* CallSpread */
else
if ((p->Compute) == &CallSpread )
{
delta_sample= 0;
if(S_T > K1)delta_sample += U_T;
if(S_T > K2)
delta_sample -= U_T;
}
S. Crpey Page 49
CIMPAJordanie September 2005
-
8/4/2019 Numerical Methods Book Crepey
58/244
/*Call-Put*/
else
if ((p->Compute) == &Put)
{
if (price_sample>0.)
delta_sample= -U_T;
else
delta_sample= 0.0;
}
/*Sum*/
mean_price+= price_sample;
mean_delta+= delta_sample;
/*Sum of squares*/
var_price+= SQR(price_sample);
var_delta+= SQR(delta_sample);
}
S. Crpey Page 50
CIMPAJordanie September 2005
-
8/4/2019 Numerical Methods Book Crepey
59/244
/* End N iterations */
/* Price */
*ptprice= exp(-r*t)*(mean_price/(double) N);
*pterror_price= sqrt(exp(-2.0*r*t)*var_pri
ce/(double)N - SQR(*ptprice))/sqrt(N-1);
/*Delta*/
*ptdelta= exp(-r*t)*mean_delta/(double) N;
*pterror_delta= sqrt(exp(-2.0*r*t)*(var_de
lta/(double)N-SQR(*ptdelta)))/sqrt((double)N-1);
/* Call Price and Delta with the Call Put
Parity */if(flag == 1)
{
*ptprice+= s*exp(-divid*t)- p->Par[0].Val
.V_DOUBLE*exp(-r*t);
S. Crpey Page 51
CIMPAJordanie September 2005
-
8/4/2019 Numerical Methods Book Crepey
60/244
*ptdelta+= exp(-divid*t);
(p->Compute)= &Call;
flag = 0;
}
/* Price Confidence Interval */
*inf_price= *ptprice - z_alpha*(*pterror_p
rice);
*sup_price= *ptprice + z_alpha*(*pterror_p
rice);
/* Delta Confidence Interval */
*inf_delta= *ptdelta - z_alpha*(*pterror_d
elta);*sup_delta= *ptdelta + z_alpha*(*pterror_d
elta);
}
return init_mc;
S. Crpey Page 52
CIMPAJordanie September 2005
-
8/4/2019 Numerical Methods Book Crepey
61/244
}
Further Comments:/* Value to construct the confidence interval */
For example if the confidence value is equal to 95% then the value zused to construct the confidence interval is 1.96.
/*Initialization*/
/*Median forward stock and delta values*/Computation of intermediate values we use several times in the program.
/* Change a Call into a Put to apply the Call-Put parity */We modify the parameters of the option; they will be reinitialized at the
end of the simulation program.
/*MC sampling*//* Begin N iterations */
/*Price*/
S. Crpey Page 53
CIMPAJordanie September 2005
-
8/4/2019 Numerical Methods Book Crepey
62/244
At the iteration i, we obtain
ST(i) = s exp r d 2
2 t exp(Bt(i))P(i) = Payoff(ST(i), K)
from a simulation ofBt(i) with the selected generator as
tgi where gi is
a standard gaussian variable.
/*Delta*/Calculation of Delta i with formula previously detailed for each option.
/*Digit*//*CallSpread*/
/*Call-Put*/
/*Sum*/Computation of the sums
Pi and
i for the mean price and the mean
delta.
/*Sum of squares*/
S. Crpey Page 54
CIMPAJordanie September 2005
-
8/4/2019 Numerical Methods Book Crepey
63/244
Computation of the sums
P2i and
2i necessary for the variance
price and the variance delta estimations.
/* End N iterations */
/*Price*/
The price estimator is:
P = 1N exp(rt)Ni=1
P(i)
The error estimator is P with :
2
P=
1
N 1 1N exp(2rt)N
i=1 P(i)2 P2
S. Crpey Page 55
CIMPAJordanie September 2005
-
8/4/2019 Numerical Methods Book Crepey
64/244
/*Delta*/
=1
Nexp(
rt)
N
i=1 (i)The error estimator is with:
2 =1
N
1
1
Nexp(2rt)
N
i=1(i)2 2
/* Call Price and Delta with the Call Put Parity */
We now compute the price and the delta for a call.Parameters of the option are reinitialized.
/* Price Confidence Interval */
The confidence interval is given as:ICP = [P zP; P + zP]
with z computed from the confidence value./* Delta Confidence Interval */
S. Crpey Page 56
CIMPAJordanie September 2005
-
8/4/2019 Numerical Methods Book Crepey
65/244
The confidence interval is given as:
IC = [
z; + z]
with z computed from the confidence value.
9.2 (Q)MC BS2D
Description: Computation, for a Call on Maximum, Put on Minimum,Exchange or Bestof European Option, of its Price and its Delta with theStandard Monte Carlo or Quasi-Monte Carlo simulation. In the case ofMonte Carlo simulation, this method also provides an estimation for theintegration error and a confidence interval.
Input parameters:
StepNumber N Generator_Type
S. Crpey Page 57
CIMPAJordanie September 2005
-
8/4/2019 Numerical Methods Book Crepey
66/244
Increment inc Confidence Value
Output parameters:
Price P Error Price P
Deltas 1, 2 Errors delta 1 , 2 Price Confidence Interval: ICP =[Inf Price, Sup Price]
Delta Confidence Intervals: ICj =[Inf Delta, Sup Delta]
The underlying asset prices evolve according to the two-dimensional
S. Crpey Page 58
CIMPAJordanie September 2005
-
8/4/2019 Numerical Methods Book Crepey
67/244
BlackScholes risk-neutral dynamics, that is:
dS1u = S
1u((r
d1)du + 1dB
1u), S
1Tt = s
1
dS2u = S2u((r d2)du + 2dB2u), S2Tt = s2.
where SjT denotes the spot at maturity T, sj is the initial spot and
(B1u, u
0) and (B2u, u
0) denote two real-valued Brownian motions
with instantaneous correlation .
Then we have:
S1T = s1 exp((r d1
21
2 )t)exp(11B1t )
S2T = s2 exp((r
d2
22
2
)t)exp(21B1t + 22B
2t )
where the parameters 11, 12, 21, 22 are given in the following matrix
S. Crpey Page 59
CIMPAJordanie September 2005
-
8/4/2019 Numerical Methods Book Crepey
68/244
:
1,1 1,2
2,1 2,2 = 1 0
2 1 22 such that t = where is the covariance matrix expressed by:
21 12
1
2
22
The price of an option is
P = E
exp(rt)f(K, S1T, S2T)
where f denotes the payoff of the option. K denotes the strike. t time tomaturity.
S. Crpey Page 60
CIMPAJordanie September 2005
-
8/4/2019 Numerical Methods Book Crepey
69/244
The Deltas are given by:
1 =s1 E[exp(
rt)f(K, S1T, S
2T)]
2 =s2 E[exp(rt)f(K, S1T, S2T)]
The estimators are expressed as:
P =1N exp(
rt)
Ni=1 P(i)j = 1N exp(rt)Ni=1 sj P(i) = 1N exp(rt)Ni=1 j(i)
The values for P(i) and j(i) are detailed for each option.
Put on the Minimum: The payoff is (K min(S1, S2))+.
P(i) =`
Kmin(S1T(i), S
2T(i))
+
S. Crpey Page 61
CIMPAJordanie September 2005
-
8/4/2019 Numerical Methods Book Crepey
70/244
IfP(i) 0 then:
1(i) =8
-
8/4/2019 Numerical Methods Book Crepey
71/244
IfP(i) 0 then:
1(i) = 8
-
8/4/2019 Numerical Methods Book Crepey
72/244
BestOf Option: The payoff is [max(S1 K1, S2 K2)]+.
P(i) = max(S1T K1, S
2T K2)
+
IfP(i) 0 then:
1(i) =
8Par[0].Val.V_PDOUBLE);
K2= (p->Par[1].Val.V_PDOUBLE);
}
S. Crpey Page 66
CIMPAJordanie September 2005
-
8/4/2019 Numerical Methods Book Crepey
75/244
if ( (p->Compute) == &Exchange)
ratio= (p->Par[0].Val.V_PDOUBLE);
/* MC sampling */
init_mc= InitGenerator(generator, simulation_
dim,N);
/* Test after initialization for the generator*/
if(init_mc == OK)
{
mc_or_qmc= Rand_Or_Quasi(generator);
/* Begin N iterations */
for(i=1 ; i
-
8/4/2019 Numerical Methods Book Crepey
76/244
g_1= Gaussians[mc_or_qmc](simulation_dim, CR
EATE, 0, generator);
g_2= Gaussians[mc_or_qmc](simulation_dim, RE
TRIEVE, 1, generator);
exp_sigmaxwt1= exp(sigma11_sqrt*g_1);
S_T1= forward_stock1*exp_sigmaxwt1;
U_T1= forward1*exp_sigmaxwt1;
exp_sigmaxwt2= exp(sigma21_sqrt*g_1 + sigma22_sqrt*g_2);
S_T2= forward_stock2*exp_sigmaxwt2;
U_T2= forward2*exp_sigmaxwt2;
/*Price*/
price_sample=(p->Compute) (p->Par,S_T1, S_T2
);
/*Delta*/
S. Crpey Page 68
CIMPAJordanie September 2005
-
8/4/2019 Numerical Methods Book Crepey
77/244
if ( price_sample > 0)
{
/*Call on on the Maximum*/
if ( p->Compute == &CallMax)
{
if (S_T1 > S_T2)
{
delta2_sample= 0.;
delta1_sample= U_T1;}
else
{
delta1_sample= 0.0;
delta2_sample= U_T2;
}
}
/*Put on on the Minimum*/
if ( (p->Compute) == &PutMin)
S. Crpey Page 69
CIMPAJordanie September 2005
-
8/4/2019 Numerical Methods Book Crepey
78/244
{
if (S_T1 < S_T2)
{
delta2_sample= 0.;
delta1_sample= -U_T1;
}
else
{
delta1_sample= 0.0;delta2_sample= -U_T2;
}
}
/*Best of*/
if ( (p->Compute) == &BestOf)
{
if (S_T1- K1 > S_T2 - K2 )
{
delta2_sample= 0.;
S. Crpey Page 70
CIMPAJordanie September 2005
-
8/4/2019 Numerical Methods Book Crepey
79/244
delta1_sample= U_T1;
}
else
{
delta1_sample=0.0;
delta2_sample= U_T2;
}
}
/*Exchange*/if ( (p->Compute) == &Exchange)
{
delta1_sample= U_T1;
delta2_sample= -ratio*U_T2;
}
}
else
{
delta1_sample= 0.0;
S. Crpey Page 71
CIMPAJordanie September 2005
-
8/4/2019 Numerical Methods Book Crepey
80/244
delta2_sample= 0.0;
}
/*Sum*/
mean_price+= price_sample;
mean_delta1+= delta1_sample;
mean_delta2+= delta2_sample;
/*Sum of squares*/var_price+= SQR(price_sample);
var_delta1+= SQR(delta1_sample);
var_delta2+= SQR(delta2_sample);
}
/* End N iterations */
/* Price estimator */
*ptprice= exp(-r*t)*(mean_price/(double) N)
S. Crpey Page 72
CIMPAJordanie September 2005
-
8/4/2019 Numerical Methods Book Crepey
81/244
;
*pterror_price= sqrt(exp(-2.0*r*t)*var_pri
ce/(double)N - SQR(*ptprice))/sqrt(N-1);
*inf_price= *ptprice - z_alpha*(*pterror_p
rice);
*sup_price= *ptprice + z_alpha*(*pterror_p
rice);
/* Delta1 estimator */
*ptdelta1= exp(-r*t)*mean_delta1/(double)
N;
*pterror_delta1= sqrt(exp(-2.0*r*t)*var_de
lta1/(double)N-SQR(*ptdelta1))/sqrt((double)N-1);
*inf_delta1= *ptdelta1 - z_alpha*(*pt
error_delta1);
*sup_delta1= *ptdelta1 + z_alpha*(*pt
error_delta1);
S. Crpey Page 73
CIMPAJordanie September 2005
-
8/4/2019 Numerical Methods Book Crepey
82/244
/* Delta2 estimator */
*ptdelta2= exp(-r*t)*mean_delta2/(double)
N;*pterror_delta2= sqrt(exp(-2.0*r*t)*var_de
lta2/(double)N-SQR(*ptdelta2))/sqrt((double)N-1);
*inf_delta2= *ptdelta2 - z_alpha*(*pt
error_delta2);
*sup_delta2= *ptdelta2 + z_alpha*(*pt
error_delta2);
}
return init_mc;
}
Further Comments:/* Value to construct the confidence interval */
For example if the confidence value is equal to 95% then the value zused to construct the confidence interval is 1, 96.
S. Crpey Page 74
CIMPAJordanie September 2005
-
8/4/2019 Numerical Methods Book Crepey
83/244
/*Initialization*//* Covariance Matrix */
/* Coefficients of the matrix such that t = *//*Median forward stock and delta values*/
Computation of intermediate values we use several times in the program.
/*MC sampling*/
/* Begin N iterations *//*Gaussian Random Variables*/Generation of 2 gaussian variables g1 and g2 used for the Brownian
motions
tgj .
/*Price*/
At the iteration i, we obtain
P(i) = payoff(K, S1T(i), S2T(i))
/*Delta*/
S. Crpey Page 75
CIMPAJordanie September 2005
-
8/4/2019 Numerical Methods Book Crepey
84/244
Calculation of Delta 1(i) and 2(i) for the different cases with formula
given previously.
/*Call on the Maximum*//*Put on the Minimum*/
/*Best of*/
/*Exchange*//*Sum*/
Computation of the sumsP(i) and j(i) for the mean price and themeans delta.
/*Sum of squares*/
Computation of the sums
P(i)2 and
(j(i))2 necessary for the
variance price and the variances delta estimations.
/* End N iterations */
/*Price*/
S. Crpey Page 76
CIMPAJordanie September 2005
-
8/4/2019 Numerical Methods Book Crepey
85/244
The price estimator is:
P =
1
N exp(rt)N
i=1 P(i)The error estimator is P with :
2P =1
N
1 1
Nexp(2rt)
N
i=1 P(i)2 P2
The confidence interval is
ICP = [P zP; P + zP]
with z computed from the confidence value.
/*Delta*/
/* Delta1 estimator */
S. Crpey Page 77
CIMPAJordanie September 2005
-
8/4/2019 Numerical Methods Book Crepey
86/244
The delta estimator is:
1 =1
N
exp(
rt)
N
i=1 1(i)The error estimator is 1 with:
21 =1
N 1
1
Nexp(2rt)
N
i=121(i) 21
The confidence interval is given as:
IC1 = [1 z1 ; 1 + z1 ]with z computed from the confidence value.
/* Delta2 estimator */The delta estimator is:
2 =1
Nexp(rt)
Ni=1
2(i)
S. Crpey Page 78
CIMPAJordanie September 2005
-
8/4/2019 Numerical Methods Book Crepey
87/244
The error estimator is 2 with:
2
2 =
1
N 1 1N exp(2rt)N
i=1 22(i) 22The confidence interval is given as:
IC2 = [2 z2 ; 2 + z2 ]
with z computed from the confidence value.
S. Crpey Page 79
CIMPAJordanie September 2005
-
8/4/2019 Numerical Methods Book Crepey
88/244
10 Simulation of processes
10.1 Brownian MotionDefinitions: A Brownian motion is a continuous adapted processB = Bt, Ft; 0 t < , defined on some probability space (, F , P ),with the properties that B0 = 0 a.s and for 0 s < t, the incrementBt Bs is independent ofFs and is normally distributed with mean zeroand variance t s.Simulation ofBt: Simulation ofBt is an easy step because we have thatL(Bt) = N(0, t)- first generate a gaussian standard variable g
- and then compute Bt as
tg
Simulation (discretization) of a Brownian trajectory, 0 t T: Wenow detail two approaches for simulating a Brownian path: the Forward
S. Crpey Page 80
CIMPAJordanie September 2005
-
8/4/2019 Numerical Methods Book Crepey
89/244
one and the Backward one. Typically, for path-dependent options we have
to simulate B over = {tk; k = 0,...,M,t0 = 0, tM = T}.
Forward Simulation ofBt over is given by:
B(0) = 0
B(tk+1) = B(tk) +
tk+1 tkgkwhere (g1,...,gM) are independent gaussian standard variables. If we use
a discretization with evenly spaced intervals of size h = Tm , we have:
B(0) = 0
B(tk+1) = B(tk) +
hgk
Backward simulation with Brownian Bridge:
This other method is based on the following property for Brownian
S. Crpey Page 81
CIMPAJordanie September 2005
-
8/4/2019 Numerical Methods Book Crepey
90/244
bridge:
L(Bu, s < u < t
|Bs = x, Bt = y) =
N( tutsx +
ust
s y,
(tu)(us)t
s )
and particularly
L(B t+s2
|Bs = x, Bt = y) = N(x+y2 , ts4 )
This scheme consists in simulating B as
B(0) = 0
B(T) =
T g1
B(T2 ) =B(0)+B(T)
2 +T4 g2
B( 3T4 ) = B(0)+B(T
2 )2 +T8 g3B(T4 ) =
B(T2 )+B(T)
2 +
T8 g4
S. Crpey Page 82
CIMPAJordanie September 2005
-
8/4/2019 Numerical Methods Book Crepey
91/244
where (g1,...,gM) are independent gaussian standard variables.
For this algorithm, we have to choose M as a power of 2. The first step is
directly for 0 to T. Intermediates steps are filled by taking successive sub-divisions of the time intervals into halves. It can be adapted with
subdivisions of different length by considering the conditional law of
brownian bridge between s and t.
Remark on these two schemes for MC and QMC simulations: Weneed a vector of size M of independent gaussian variables. For MC, these
M variables can be simulated from the same pseudo random numbers
generator. However, for a QMC simulation we need to use a
M-dimensional low-discrepancy sequence to keep independence
property.10.2 BlackScholes model
In the Black and Scholes model [3], the underlying asset price St follows
S. Crpey Page 83
CIMPAJordanie September 2005
-
8/4/2019 Numerical Methods Book Crepey
92/244
the diffusion:
dSt = Stdt + StdBt
and then the price is a geometric Brownian process:
St = S0 exp(( 22 )t + Bt)In this particular case for which we have an explicit solution of the
diffusion process, simulation of price paths is based on simulation of
Brownian motion described in the last section. As for Brownian pathsimulation, we present the forward and backward approaches.
Forward simulation: We have:
S(tk+1) = S(tk) exp((
2
2 )(tk+1
tk) + (B(tk+1)
B(tk)))
and for a discretization with evenly spaced intervals of size h, we simply
have:
S(tk+1) = S(tk) exp(( 22 )h +
hgk)
S. Crpey Page 84
CIMPAJordanie September 2005
-
8/4/2019 Numerical Methods Book Crepey
93/244
Backward simulation: To construct this scheme, we use Backwardsimulation for Brownian path described int the previous point. To express
this scheme, we note yt = log(St), that is yt = y0 + (
2
2
)t + Bt
yT = y0 + ( 22 )t +
T g1
yT2
= y0+yT2 +
T4 g2
y 3T4
=y0+yT
2
2 +T8 g3
yT4
= yT2 +yT2 +T8 g4
We endly take Stk = exp(ytk)
10.3 General diffusions: Euler and Milshtein schemeWe consider the general diffusion process:
dXt = b(Xt)dt + (Xt)dBt
S. Crpey Page 85
CIMPAJordanie September 2005
-
8/4/2019 Numerical Methods Book Crepey
94/244
If we dont have any explicit solution for Xt (like for Black and Scholes
model), we have to use approximation schemes with a discretization of
the process. The both most known schemes are Euler and Milshtein. They
both take into account a time discretization of step h.
The Euler approximation scheme for this diffusion is expressed as
Xtk+1 = Xtk + b(Xtk)h + (Xtk)(Btk+1 Btk)
Simulation is obtained with a forward algorithm by:
Xtk+1 = Xtk + b(Xtk)h + (Xtk)
hgk
for k = 0,...,M 1.
The Milshtein approximation scheme for this diffusion is given by
S. Crpey Page 86
CIMPAJordanie September 2005
-
8/4/2019 Numerical Methods Book Crepey
95/244
(space dimension = 1)
Xtk+1 = Xtk + (b(Xtk)
1
2
(Xtk)(Xtk))h+
+(Xtk)(Btk+1 Btk) +1
2(Xtk)(Xtk)(Btk+1 Btk)2
Simulation is obtained with a forward algorithm by:
Xtk+1 = Xtk + (b(Xtk)
1
2
(Xtk)(Xtk))h+
+(Xtk)
hgk +1
2(Xtk)(Xtk)hg
2k
for k = 0,...,M 1.10.4 Heston model
The best known Stochastic Volatility model is the Heston model [16],which postulates, for the instantaneous variance vt, a CIR Bessel process(square root process) correlated with the driver ofS, namely, in
S. Crpey Page 87
CIMPAJordanie September 2005
-
8/4/2019 Numerical Methods Book Crepey
96/244
risk-neutral form
dSt = St(rdt +
vtdWt)
dvt = (vt v)dt + vtdZt(1)
where- dW, Z = dt- is the speed of mean-reversion of the instantaneous variance
- v is the long-term variance mean- 2v
is the volatility of the instantaneous volatility VolOfVol.
The Heston model is complete if we have a vanilla option in thereplication portfolio.
If the Bessel process vt eventually reaches 0 (which is possible under
some sets of parameter values, and will typically be the case for values ofthe model parameters calibrated on realistic equity index skews [18]) thenthe embedded drift pushes it back to the positive side. So vt is alwaysnonnegative, as it should be. Mean reversion ofvt is intended to lead to
S. Crpey Page 88
CIMPAJordanie September 2005
-
8/4/2019 Numerical Methods Book Crepey
97/244
realistic properties for the term structure of the implied volatility. Vanilla
option prices and Greeks are available in this model by Fourier transform.
A classic discretization for process 1 on page 87 consists in discretizingln(S) by the Euler scheme and v by the Milshtein scheme, as
ln(S) = (r v
2)h +
vh(G +
1 2G)
v = ((vt v) + 2
4 )h +
vhG + h2G2
4
where (G, G) is a standard Gaussian pair. The interest of using theMilshtein scheme for the v component is to benefit from the increased
rate of trajectorial convergence of the Milshtein scheme with respect to
the Euler scheme. So the Milshtein scheme is better suited to reproduce
the trajectorial properties ofvt (like nonnegativity).
10.5 Monte Carlo Simulation for Processes
S. Crpey Page 89
CIMPAJordanie September 2005
-
8/4/2019 Numerical Methods Book Crepey
98/244
In the case of Monte Carlo simulation for processes, we have
E[(X)] 1
N
N
Xi=1
(xi) =
(E[(X)] E[(Xh)]) + (E[(Xh)] 1
N
NXi=1
(xhi ))
So the error is the sum of two terms: the discretization error and the
Monte Carlo error. For usual discretization schemes such as the Euler orthe Milshtein scheme, the weak convergence rate is linear in h so that the
discretization error is as O(h) the strong convergence rate of the
Milshtein scheme is quadratic in h, but this is irrelevant here. As for the
Monte Carlo error, after scaling by 1/
N, it is asymptotically distributed
asN(0, Var[(Xh)]). Therefore in order to balance the two terms in theerror a natural choice is to take N of the order ofM2.
S. Crpey Page 90
CIMPAJordanie September 2005
-
8/4/2019 Numerical Methods Book Crepey
99/244
11 (Quasi) Monte Carlo methods for Exotic
Options
11.1 Lookback options
We consider an option with payoff(ST, mT) where (St, t 0) is thesolution of the following diffusion equation
dSt = b(St)dt + (St)dWt
and mt = sup0st Ss. The idea to (Q)MC estimate this option is toevaluate the maximum along the trajectory of the continuous Eulerscheme given by
mt = max0stSs
where for kh t (k + 1)hSt = Skh + b(Skh)(t kh) + (Skh)(Wt Wkh)
S. Crpey Page 91
CIMPAJordanie September 2005
i h W di i d b h d f h i i l i
-
8/4/2019 Numerical Methods Book Crepey
100/244
with Wt conditioned on both ends of each time interval (Brownian
Bridges). The following result gives a way of simulating the law ofmtconditionally on (Skh, 0
k
M).
Theorem: The law ofmk+1 = maxkht(k+1)h St conditionally on Skhand S(k+1)h can be simulated by
1
2 Skh + S(k+1)h +
(Skh S(k+1)h)2 22(Skh)h log(Uk)
where (Uk, k 0) is a sequence of iid uniform random variables on [0, 1].Proof: Let mt = sup0stWs. Il is well known [21] that the law of thepair (Wt, mt) has density
p(x, y) = 1y01yx2(2y x)
2t3exp
(2y x)2
2t
.
Denoting Wt = Wt + bt, one can show by the CameronMartin formula
S. Crpey Page 92
CIMPAJordanie September 2005
-
8/4/2019 Numerical Methods Book Crepey
101/244
that the law of the pair (Wt, sup0stWs) has density
p(x, y) = p(x, y) exp(bx
b2
2t).
So the law ofsup0stWs conditional on Wt = x does not depend on b.By change of variables z = (2y x)2 x2, one then shows that thevariable
(2 sup0st
Ws
Wt)
2
W
2
t
is, conditionally on Wt, 12t -exponentially distributed.Therefore, conditionally on Snh and S(k+1)h
supkht(k+1)h
St(law)
=1
2
Skh + S(k+1)h +q
(S(k+1)h Skh)2 + (Skh)2Y
where Y is an 12h -exponential variable. 2
So each simulation run consists in generating by the Euler scheme atrajectory Skh, 1 k M and a trajectory mkh, 1 k M, by using
S. Crpey Page 93
CIMPAJordanie September 2005
2M d d N h if QMC d h ld
-
8/4/2019 Numerical Methods Book Crepey
102/244
2M random draws. Note that if QMC was used, one should use a
2M-dimensional low-discrepancy sequence. Except for special cases such
as BlackScholes (see below), this would lead to use high-dimensional
low-discrepancy sequence, which is not recommended in general.
In the case of the BlackScholes model, the Euler discretization is exact,
provided one works in returns variable y = ln(S). So one can take M
equal to one and use a 2-dimensional low-discrepancy sequence.
11.2 Andersen and Brotherton-Ratcliffe Algorithm forLookback Options
Description : Computation, for a Lookback Option on Maximum, ofits Price and its Delta with the Standard Monte Carlo Simulation [1]. This
method also provides an estimation for the integration error and a
confidence interval.
Input parameters:
S. Crpey Page 94
CIMPAJordanie September 2005
N b f it ti N
http://slidesfinumscrepey.pdf/http://slidesfinumscrepey.pdf/ -
8/4/2019 Numerical Methods Book Crepey
103/244
Number of iterations N Generator_Type Confidence Value
Output parameters:
Price P
Error Price P Delta Error delta
Confidence Interval: [Inf Price, Sup Price]
Confidence Interval: [Inf Delta, Sup Delta]The underlying asset price evolves according to the Black and Scholes
S. Crpey Page 95
CIMPAJordanie September 2005
d l th t i
-
8/4/2019 Numerical Methods Book Crepey
104/244
model, that is:
dSu = Su((r d)du + dBu), STt = sthen
ST = s exp
(r d
2
2)t
exp(Bt)
ST denotes the spot at maturity T, s is the initial spot, t the time to
maturity.
We note mT = max[Tt,T](Su) the maximum reached before maturity.The Price of an option is:
P = E[exp(rt)f(K, ST, mT)]
where f denotes the payoff of the option and K the strike.The Delta is given by:
=
sE[exp(rt)f(K, ST, mT)]
S. Crpey Page 96
CIMPAJordanie September 2005
Th ti t d
-
8/4/2019 Numerical Methods Book Crepey
105/244
The estimators are expressed as:
P = 1N exp(rt)
Ni=1 P(i) = 1N exp(rt)Ni=1 sP(i) = 1N exp(rt)Ni=1 (i)
The values for P(i) and (i) are detailed for each option.
Call Fixed Euro: The payoff is (max[Tt,T](Su) K)+
P(i) = (mT(i) K)+
i =
mT(i)s =
mT(i)s if P(i) 0
0 otherwise
Put Floating Euro: The payoff is (max[T
t,T](Su)
ST)
P(i) = (mT(i) ST(i))
i =mT(i)
s ST(i)
s=
mT(i) ST(i)s
=P(i)
s
S. Crpey Page 97
CIMPAJordanie September 2005
Simulation of the maximum : The conditional la ind ced b
-
8/4/2019 Numerical Methods Book Crepey
106/244
Simulation of the maximum mT: The conditional law induced by mT,given the observation ST, has a very simple form, so that we can easilysimulate the maximum ofS over the time interval [t, T].
Setting Wu = ln Su, then obviously mT is the exponential of themaximum ofW, and the conditional probability distribution function ofthe maximum ofW, given WTt = w1 and WT = w2, is:
Gmax(w; w1, w2) =1 exp 22t (w w1)(w w2) if w max(w1, w2)0 otherwise
In the Monte Carlo algorithm, the associated inverse function G1max is
used in order to simulate values for mT. We have the followingexpression:
G1max(y; w1, w2) =1
2
w1 + w2 +
(w1 w2)2 22t ln(1 y)
S. Crpey Page 98
CIMPAJordanie September 2005
h i if [0 1]
-
8/4/2019 Numerical Methods Book Crepey
107/244
where y is uniform on [0, 1].
Then, at step i, mT(i) is simulated as follows:
- ST(i) is generated as s exp(r d 22 )t exp(Bt(i)) withBt(i) =
tgi and gi is a standard gaussian variable;
- y(i) is generated as a uniform variable on [0, 1];- wTt = ln s and wT(i) = ln ST(i);
- WT(i) is computed as G1
max(y(i); wTt, wT(i));- Finally, mT(i) = exp(WT(i)).
Code Sample
static double inverse_max(double s1, double s2,
double h,double sigma,double un)
{
return ((s1+s2)+sqrt(SQR(s1-s2)-2*SQR(sigma)*h*
log(1.-un)))/2.;
S. Crpey Page 99
CIMPAJordanie September 2005
}
-
8/4/2019 Numerical Methods Book Crepey
108/244
}
static int LookBackSup_AndersenMontecarlo(...)
{
...
/* Monte Carlo sampling */
init_mc= InitGenerator(generator, simulation_
dim,N);/* Test after initialization for the generator
*/
if(init_mc == OK)
{
/* Initialization of the model just allows
to use Monte Carlo method */
mc_or_qmc= Rand_Or_Quasi(generator);
for(i=1; i
-
8/4/2019 Numerical Methods Book Crepey
109/244
/* Begin N iterations */
{
/* Simulation of a gaussian variable accor
ding to the generator type */
gs= Gaussians[mc_or_qmc](1, CREATE, 0, gen
erator);
/* Simulation of the maximum */
un= Uniform(generator);exp_sigmaxwt= exp(sigma_sqrt*gs);
S_T= forward_stock*exp_sigmaxwt;
max_log_norm=inverse_max(log_s, log(S_T), t,
sigma, un);
S_max= exp(max_log_norm);
/* Price and Delta */
/* CallFixedEuro */
S. Crpey Page 101
CIMPAJordanie September 2005
if (p->Compute == &Call OverSpot2)
-
8/4/2019 Numerical Methods Book Crepey
110/244
if (p >Compute == &Call_OverSpot2)
{
price_sample= (p->Compute)(p->Par, strik
e, S_max);
delta_sample= 0;
if(log_strike>max_log_norm)
delta_sample=0.;
else delta_sample=S_max/s;
}else
/* PutFloatingEuro */
if (p->Compute == &Put_StrikeSpot2)
{
price_sample= (p->Compute)(p->Par, S_T, S_
max);
delta_sample=S_T/s;
}
S. Crpey Page 102
CIMPAJordanie September 2005
/*Sum*/
-
8/4/2019 Numerical Methods Book Crepey
111/244
/ Sum /
mean_price+= price_sample;
mean_delta+= delta_sample;
/*Sum of squares*/
var_price+= SQR(price_sample);
var_delta+= SQR(delta_sample);
}
/* End N iterations */...
}
return init_mc;
}
Further Comments
/* Test after initialization for the generator */Test if the dimension of the simulation is compatible with the selected
S. Crpey Page 103
CIMPAJordanie September 2005
generator In this implementation initialization of the model just allows
-
8/4/2019 Numerical Methods Book Crepey
112/244
generator. In this implementation, initialization of the model just allowsto use Monte Carlo method. Note that if QMC was used, one should use a
2D low-discrepancy sequence.
/* Begin N iterations *//* Simulation of a gaussian variable according to the generator type,
that is Monte Carlo or Quasi Monte Carlo. */Call to the appropriate function to generate a standard gaussian variable.
/* Simulation of the maximum */Computation ofST(s) and max[Tt,T] Su(s) from the initial spot value s.
The maximum value is simulated according to the conditional lawinduced by s and ST.
/* End N iterations */
11.3 Barrier options
Barrier options are a special case of lookback options in which the
S. Crpey Page 104
CIMPAJordanie September 2005
quantity
-
8/4/2019 Numerical Methods Book Crepey
113/244
quantity
E
f(ST, mT)|Skh, 0 k M
can be computed explicitely.A barrier option is defined by the following payoff
f(ST)1{mTL}.
An approximation of the option price is given by
E
f(ST)1{mTL}
where
mT = max0
k
M
mk with mk = supkh
t
(k+1)h
St
S. Crpey Page 105
CIMPAJordanie September 2005
Then
-
8/4/2019 Numerical Methods Book Crepey
114/244
Then
E
f(ST)1{mTL}|Slh, 0 l M
= f(ST)M1k=0
E(1{mkL}|Slh, 0 l M)
= f(ST)
M1
k=0E(1{mkL}|Skh, S(k+1)h)
= f(ST)
M1k=0
h(Skh, S(k+1)h)
where
h(x, y) = 1 exp( 2(x)2h (L x)(L y))1L>xy
S. Crpey Page 106
CIMPAJordanie September 2005
So
-
8/4/2019 Numerical Methods Book Crepey
115/244
So
Ef(ST)1{mTL} = Ef(ST)M1
k=0 h(Skh, S(k+1)h) .Note that, in this case, no random draws are needed other than those usedfor simulating ST, namely M random draws by simulation run whereM can be taken equal to one, in the special case of the BlackScholesmodel.
11.4 Asian options
Asian options have payoffs of the following kind
ST, 1T T
0 Su du .A standard example is given by (x, y) = (y x)+. PuttingAt =
t0
Su du, the pair (St, At) is Markovian.
S. Crpey Page 107
CIMPAJordanie September 2005
Straightforward application of the Euler scheme suggests to approximate
http://slidesfinumscrepey.pdf/ -
8/4/2019 Numerical Methods Book Crepey
116/244
Straightforward application of the Euler scheme suggests to approximate
AT by AhT = h(S0 + S1 + . . . + S(M1)h), which corresponds to aRiemann sum for the integral AT. Nevertheless, this discretization works
poorly in practice. There do exist better discretizations of the integral, inparticular in the BlackScholes model, by using the law of the Brownian
Bridge between 0 and h:
Wu =u
h
Wh + Zu
where Zu is a centered Gaussian variable with variance uh (h u). Thesediscretizations can be used in association with appropriate variance
reduction techniques [28]. For instance, in the BlackScholes model and
for (x, y) = (y K)+, an idea by Kemna and Vorst [22] is thefollowing one: ifr and are small, then
1
T
T0
St dt is close to exp
1
T
T0
log(St) dt
.
S. Crpey Page 108
CIMPAJordanie September 2005
This suggests to choose
-
8/4/2019 Numerical Methods Book Crepey
117/244
This suggests to choose
erT(exp(Z) K)+
where Z = 1TT0 log(St) dt, as a control variable. Z is Gaussian, so one
knows EerT(exp(Z) K)+ explicitely.
S. Crpey Page 109
CIMPAJordanie September 2005
12 Trees for vanilla options
-
8/4/2019 Numerical Methods Book Crepey
118/244
12 Trees for vanilla options
12.1 Cox-Ross-Rubinstein as an approximation toBlack-Scholes
The Cox-Ross-Rubinstein model is the Markov chain obtained by
replacing the Black-Scholes dynamics under the risk-neutral probability
by the CRR dynamics
Sn+1 (h) =
u Sn (h) with proba p
d Sn (h) with proba 1 p
with h = TN
, where T is the time to maturity of an option (ie the current
date is taken to be zero), N is the number of time steps in the tree, and
u = eh, d = e
h, p =
eh du d
S. Crpey Page 110
CIMPAJordanie September 2005
with r . Note that p is the risk-neutral probability in the
-
8/4/2019 Numerical Methods Book Crepey
119/244
w p p y
generalized CRR scheme.
Convergence of the marginal law at maturityWithout loss of generality assume S0 = 1. For R
EP
[exp(i ln SN (h))]
= EP
exp
i lnN1n=0
Sn+1 (h)
Sn (h)
=
EP
exp
i ln
S1 (h)
S0
N= p expih+ (1 p)expihN
S. Crpey Page 111
CIMPAJordanie September 2005
h d 1
22
-
8/4/2019 Numerical Methods Book Crepey
120/244
and since p = ehdud 12 +
2
2
h + O (h)
EP
[exp(i ln SN (h))] 1 + i 22 2 22 TNN
exp
i
2
2
2
2
2
T
= Eexpi
2
2 T + BT= EP
BS [exp(i ln ST)]
where PBS is the risk-neutral Black-Scholes probability. Therefore underthe risk neutral measure
SN (h) SBST (2)in law as N .This grants the convergence of the price of standard european options
S. Crpey Page 112
CIMPAJordanie September 2005
with payoffs continuous and bounded, e.g. Put options. The convergence
-
8/4/2019 Numerical Methods Book Crepey
121/244
p y , g p g
of the Call prices follows by Call-Put parity, since the CRR scheme
satisfies the Call-Put parity relationship.
Some remarks about the limit N The limiting law depends only on pei ln(u) + (1 p) ei ln(d) throughits Taylor expansion up to o (h) . Thus u, d or/and p could be altered aslong as the involved terms of the development are not modified.
The upper and lower value of the spot at maturity are uN = eTN and
dN = eTN whereas the ratio of 2 successive points is
ud = e
2h = e2
TN . Thus at the same time, the scan of the law of
SN (h) goes to R+ and the grid gets more and more dense. It is easy to
show that the points visited by the process S(h) will eventually becomedense in [0, t] R+.
S. Crpey Page 113
CIMPAJordanie September 2005
Convergence of the delta
-
8/4/2019 Numerical Methods Book Crepey
122/244
g
Observe that
0S0 = Pu,N1 Pd,N1(u d)
= er(N1)hEP [ (uS0X)] EP [ (dS0X)]
u dwhere X is a random variable independent from S0 so that
0S0 = er(N1)hEP
(uS0X) (dS0X)
u d
Assume now that is a C1 function. Then
(uS0X) (dS0X) = ud
S0X (aS0X) da
S. Crpey Page 114
CIMPAJordanie September 2005
so
-
8/4/2019 Numerical Methods Book Crepey
123/244
0S0 = er(N1)h 1
(u
d)
u
d
EP [S0X (aS0X)] da
= er(N1)hEP [S0X (a (h) S0X)]
for some point a (h) in [d, u] by the mean value property. Assuming nowthat (y) y (y) is a Lipschitz function, we know that so is the CRRprice associated to the payoff, with the same Lipschitz constant which
doesnt depend on h. Therefore since [d, u] [1, 1] as h 0limh0
EP [S0X (a (h) S0X)] = lim
h0EP [ (S0X)] (3)
Now by the standard convergence result, assuming that y(y) is bounded
limh0 EP
[ (S0X)] = EPBS
[ (St)]
= erTS0BS0
Therefore the delta does converge towards the Black-Scholes delta, at
S. Crpey Page 115
CIMPAJordanie September 2005
least for sufficiently smooth payoffs. For a Call (or Put) option the
-
8/4/2019 Numerical Methods Book Crepey
124/244
argument to get ( 3) must be slightly modified, but it works.
12.2 Algorithm (CRR)Description: This is the archetype of a Tree routine. It is described in[9]. The dynamics of the underlying under the risk-neutral probability inthe BS1D model:
St
= S0
e(r)t+Wt
is replaced by the following: for i = 0, 1, . . . , N 1S(i+1) = Sie
h
where h = TN, T is the maturity of the option, = 1 with probability p,
= 1 with probability 1 p where the (conditional) risk-neutralprobability p is chosen so that
E
e(r)hS(i+1)|Si
= Si (4)
S. Crpey Page 116
CIMPAJordanie September 2005
where is the dividend rate.
-
8/4/2019 Numerical Methods Book Crepey
125/244
Input parameters:
StepNumber NOutput parameters:
Price Delta
The price of the european option P satisfies
E
erhP(i+1)|Pi
= Pi (5)
whereas the price of the american option is given in any state j at time iby
Pi = max , EerhPi+1|Pi (6)where is the payoff of the option.The algorithm is a backward computation of the option price, based on
S. Crpey Page 117
CIMPAJordanie September 2005
the Dynamic Programming equations ( 5) or ( 6), after a forward
-
8/4/2019 Numerical Methods Book Crepey
126/244
computation of the possible values of the underlying at maturity SjN for
j = 0, 1, . . . , N . Since the tree is a flat tree, it is easily seen that the value
of the underlying at time i and level j (starting from below) is the same asthat at time i + 2 and level j + 1. In particular there are only 2N + 1
possible values of the underlying between time 0 and time N. For
computational purpose it is clever in the american case to compute only
once the corresponding value of the intrinsic value of the option, at the
beginning of the algorithm.
Code Sample:
static int CoxRossRubinstein_79(...)
{
...
/*Price, intrisic value arrays*/
P=(double *)malloc((N+1)*sizeof(double));
S. Crpey Page 118
CIMPAJordanie September 2005
iv=(double *)malloc((2*N+1)*sizeof(double)
http://slidesfinumscrepey.pdf/ -
8/4/2019 Numerical Methods Book Crepey
127/244
/*Up and Down factors*/
h=t/(double)N;a1= exp(h*(r-divid));
u = exp(sigma*sqrt(h));
d= 1./u;
/*Risk-Neutral Probability*/
pu=(a1-d)/(u-d);
pd=1.-pu;
if ((pd>=1.) || (pd
-
8/4/2019 Numerical Methods Book Crepey
128/244
for (i=0;iPar,stock);
stock*=d;
}
/*Terminal Values*/
for (j=0;j
-
8/4/2019 Numerical Methods Book Crepey
129/244
P[j]=pu*P[j]+pd*P[j+1];
if (am)
P[j]=MAX(iv[i+2*j],P[j]);}
/*Delta*/
*ptdelta=(P[0]-P[1])/(s*u-s*d);
/*First time step*/
P[0]=pu*P[0]+pd*P[1];
if (am)
P[0]=mAX(iv[N],P[0]);
/*Price*/
*ptprice=P[0];
...
S. Crpey Page 121
CIMPAJordanie September 2005
return OK;
-
8/4/2019 Numerical Methods Book Crepey
130/244
}
Further Comments:
/*Up and Down factors*/Here u = e
h,d = e
h.
/*Risk-Neutral Probability*/
Computation ofp = e(r)hdud
(the value computed from ( 4 on
page 116)).
/*Intrinsic Value computation*/Storage of the 2N + 1 possible values of the intrinsic value.
/*Price initialization*/The price of the option at maturity. It involves only the values iv [2 j].
/*Backward Resolution*/
S. Crpey Page 122
CIMPAJordanie September 2005
Note that we dont re-compute the intrinsic value.
-
8/4/2019 Numerical Methods Book Crepey
131/244
/*Delta*/The delta here is the right hedging delta in the binomial model, namely
n =Pn+1 (uSn) Pn+1 (dSn)
uSn dSn .
There may be a more clever way to approximate the continuous-time
Black&Scholes delta./*First time step*/
/*Price*/
12.3 Variants of the CRR tree
To achieve the convergence in law ( 2 on page 112), many other choicesofu and d and q (denoting the probability inside the tree) may be done,
S. Crpey Page 123
CIMPAJordanie September 2005
regardless of any arbitrage or financial consideration: the tree algorithm
-
8/4/2019 Numerical Methods Book Crepey
132/244
becomes a numerical approximation algorithm among other ones, the only
purpose is to get a good convergence to the limiting price and delta [26]
All the following trees will remain recombining trees since this is true as
soon as u and d remain constant within the tree. Only the choice ofu, d
and the probability is at hand here.
The Random Walk scheme As long as
ST = S0 exp 22 T + BT a very natural choice is toapproximate the Brownian motion B by the standard Random Walk. This
leads to
u = e
22
h+
h
, d = e
22
hh
and q = 12 .
The algorithm to get the option price is the straightforward discretized
S. Crpey Page 124
CIMPAJordanie September 2005
version of the risk-neutral expectation:
-
8/4/2019 Numerical Methods Book Crepey
133/244
Pn = erh
1
2Pu,n+1 +
1
2Pd,n+1
The convergence may be proved in the same way as before.
Notice that the discretized process is not a martingale.
The matching-3-moments scheme
An alternative route to convergence is the Central Limit Theorem. Thisleads to the idea of matching the mean and variance of the conditional
laws of the approximating chain with those of the continuous process.
These are denoted the local consistency conditions [24, 25]. The
equations that u,d,q should satisfy are
qu + (1 q) d = eh
qu2 + (1 q) d2 e2h = e2h
e2h 1
S. Crpey Page 125
CIMPAJordanie September 2005
Since one degree of freedom remains, a natural idea is to match also the
-
8/4/2019 Numerical Methods Book Crepey
134/244
third moment, which gives the equation
qu3
+ (1 q) d3
= e3h
e32h
The solution of this system is
u =ehQ
2 1 + Q +
Q2 + 2Q 3
d = ehQ21 + Q Q2 + 2Q 3
q =eh d
u dwith Q = e
2h.
Notice that ud = e2hQ2 > 1 : this tree is not symmetric.
12.4 Trinomial trees
S. Crpey Page 126
CIMPAJordanie September 2005
Along this line there is no need any longer to remain stucked with the
-
8/4/2019 Numerical Methods Book Crepey
135/244
discrete-time no-arbitrage constraint one node-two sons. We may wellchoose a 3-points scheme or p-points scheme or even a number of points
depending on N (this is useful for other kinds of limiting continuous-timedynamics, like Lvy processes for instance [8]). From the previouscalculation its easy to see that the points and probabilities of the chosenscheme should be constrained by:
pj exp(i ln uj) = 1 +
i
22
2 22
h + o (h)
in the sense that these conditions ensure the convergence ( 2 onpage 112). Well see later that these conditions are