<<

Lecture 4

Monte Carlo

Lecture Notes by Jan Palczewski with additions by Andrzej Palczewski

Computational Finance – p. 1 We know from Discrete Time Finance that one can compute a fair price for an by taking an expectation

rT EQ e− X   Therefore, it is important to have to compute the expectation of a random with a given distribution. In general, we cannot do it precisely – there is only an ap- proximation on our disposal. In previous lectures we studied methods to generate inde- pendent realizations of a . We can use this knowledge to generate a sample from a distribution of X. Main theoretical ingredients that allow to compute approxi- mations of expectation from a sample of a given distribution are provided by the and the .

Computational Finance – p. 2 Let X1,X2,... be a sequence of independent identically dis- tributed random variables with µ and vari- ance σ2. Define the sequence of

X + X + + X Y = 1 2 · · · n , n = 1, 2,.... n n

(Law of Large Numbers) Yn converges to µ almost surely as n . →∞ Let (X µ)+(X µ) + +(X µ) Z = 1 − 2 − · · · n − . n √n

(Central Limit Theorem) The distribution of Zn converges to N(0,σ2).

Computational Finance – p. 3 Assume we have a random variable X with unknown expec- tation and

a = EX, b2 = VarX.

We are interested in computing an approximation to a and possibly b.

Suppose we are able to take independent samples of X using a pseudo-random number generator.

We know from the strong law of large number, that the aver- age of a large number of samples can give a good approxi- mation to the expected value.

Computational Finance – p. 4 Therefore, if we let X1,X2,...,XM denote a sample from a distribution of X, one might expect that

M 1 a = X M M i Xi=1 is a good approximation to a.

To estimate variance we use the following formula (notice that we divide by M 1 and not by M) − M (X a )2 b2 = i=1 i − M . M M 1 P −

Computational Finance – p. 5 Assessment of the precision of estimation of a and b2

M By the central limit theorem we know that i=1 Xi behaves approximately like a (Ma,Mb2) distributed random vari- able. N P Therefore

b2 a a is approximately (0, ). M − N M In other words b aM a Z, − ∼ √M where Z (0, 1). ∼N b Therefore aM converges to a with speed . O √M Computational Finance – p. 6   More quantitative

1.96b 1.96b P a aM a + = 0.95. − √M ≤ ≤ √M   This is equivalent to

1.96b 1.96b P aM a aM + = 0.95. − √M ≤ ≤ √M  

Replacing the unknown b by the approximation bM we see that the unknown expected value a lies in the interval

1.96 bM 1.96 bM aM , aM + − √M √M   approximately with 0.95. The interval above is called a 95 percent confidence inter- val. Computational Finance – p. 7 Confidence intervals explained

If Z N(µ,σ2) then ∼ P(µ 1.96σ

P(µ Aσ

Computational Finance – p. 9 1.96 bM 1.96 bM aM , aM + − √M √M  

1. The size of the confidence interval shrinks like the in- verse root of the number of samples. This is one of the main disadvantages of . 2. The size of the confidence interval is directly propor- tional to the standard of X. This indicates that Monte Carlo method works the better, the smaller the variance of X is. This leads to the idea of variance reduction, which we shall discuss later.

Computational Finance – p. 10 Monte Carlo in a nutshell

To compute a = EX we generate M independent samples for X and compute aM .

In order to monitor the error we also approximate the vari- 2 ance by bM .

1.96 bM 1.96 bM aM , aM + − √M √M   Important! People often use confidence intervals with other confidence levels, e.g. 99% or even 99.9%. Then instead of 1.96 we have a different number. Computational Finance – p. 11 Monte Carlo put into action

We can now apply Monte Carlo simulation for the computa- tion of option prices.

We consider a European-style option ψ(ST ) with the payoff function ψ depending on the terminal stock price.

We assume that under a -neutral measure the stock price S at t 0 is given by t ≥ 1 S = S exp r σ2 t + σW . t 0 − 2 t    Here Wt is a Brownian motion.

Computational Finance – p. 12 We know that W √tZ with Z (0, 1). t ∼ ∼N We can therefore write the stock price at expiry T as

1 S = S exp r σ2 T + σ√T Z . T 0 − 2    We can compute a fair price for ψ(ST ) taking the discounted expectation

rT (r 1 σ2)T +σ√T Z E e− ψ S0e − 2 h  i This expectation can be computed via Monte Carlo method with the following

Computational Finance – p. 13 ✬for i = 1 to M ✩ compute an (0, 1) sample ξ N i set S = S exp r 1σ2 T + σ√T ξ i 0 − 2 i set rT Vi = e− ψ(Si)   end 1 M set aM = M i=1 Vi P ✫ ✪ The output aM provides an approximation of the option price. To assess the quality of our computation, we com- pute an approximation to the variance

1 b2 = (V a )2 M M 1 i − M − Xi to construct a confidence interval.

Computational Finance – p. 14 Confidence intervals v. sample size

Computational Finance – p. 15 Variance Reduction Techniques

Antithetic Variates

Control Variate

Importance (not discussed here)

Stratified Sampling (not discussed here)

Computational Finance – p. 16 We have seen before that the size of the confidence interval is determined by the value of

Var(X) , p √M where M is the sample size. We would like to find a method to decrease the width of the confidence interval by other than increasing the sample size M. A simple idea is to replace X with a random variable Y which has the same expectation, but a lower variance. In this case we can compute the expectation of X via Monte Carlo method using Y instead of X. Since the variance of Y is lower than the variance of X the results are better.

Computational Finance – p. 17 The question is how we can find such a random variable Y with a smaller variance that X and the same expectation.

There are two main methods to find Y :

a method of antithetic variates

a method of control variates

Computational Finance – p. 18 Antithetic Variates The idea is as follows. Next to X consider a random variable Z which has the same expectation and variance as X but is negative correlated with X, i.e. cov(X,Z) 0. ≤ Now take as Y the random variable X + Z Y = . 2 Obviously E(Y )= E(X). On the other hand

X + Z X + Z Var(Y )= cov , 2 2   1 1 = Var(X) + 2 cov(X,Z) + Var(Z) Var(X). 4 ≤ 2 ≤0 =Var(X) | {z } | {z } With this we can reduce the variance by a factor of 2. Computational Finance – p. 19 On the way to find Z...

In the extreme case, if we would know that E(X) = 0, we could just take Z = X. Then Y = 0 would give the right result, even deterministically.− The equality above would then trivially hold

cov(X, X) = Var(X). − − But in general we don’t know the expectation. The expectation is what we want to compute, so this naive idea is not applicable. But it puts us on the right track!

Computational Finance – p. 20 The following Lemma is a step further to identify a suitable candidate for Z and hence for Y . Lemma. Let X be an arbitrary random variable and f a monotonically increasing or monotonically decreasing func- tion, then cov(f(X),f( X)) 0. − ≤

Let us now consider the case of a random variable which is of the form f(U), where U is a standard normal distributed random variable, i.e. U (0, 1). ∼N The standard is symmetric, and hence also U (0, 1). − ∼N It then follows obviously that f(U) f( U). ∼ − In particular they have the same expectation !

Computational Finance – p. 21 Therefore, in order to compute the expectation of X = f(U), we can take Z = f( U) and define − f(U) + f( U) Y = − . 2 If we now assume that the map f is monotonically increas- ing, then we conclude from the previous Lemma that

cov f(U),f( U) 0 − ≤ and we finally obtain 

f(U) + f( U) E − = E(f(U)), 2   f(U) + f( U) 1 Var − < Var(f(U)). 2 2  

Computational Finance – p. 22 Implementation

✬for i = 1 to M ✩ compute an (0, 1) sample ξ N i + 1 2 √ set Si = S0 exp r 2σ T + σ T ξi − 1 2 set S− = S exp r σ T σ√T ξ i 0 − 2  − i set V + = e rT ψ(S+) i − i   rT set Vi− = e− ψ(Si−) + set Vi =(Vi + Vi−)/2 end 1 M set aM = M i=1 Vi P ✫ ✪ The output aM provides an approximation of the option price.

Computational Finance – p. 23 Example: European put: (K S )+ with − T S0 = 4, K = 5, σ = 0.3, r = 0.04, T = 1.

✬Plain Monte Carlo ✩ [1] "" "1.02421105149" [1] "Variance" "0.700745604547" [1] "" "0.837105491887" [1] "Confidence interval" "1.00780378385" "1.04061831913"

✫ ✪ ✬Antithetic Variates ✩ [1] "Mean" "1.01995595996" [1] "Variance" "0.019493094166" [1] "Standard deviation" "0.139617671396" [1] "Confidence interval" "1.01721945360" "1.02269246632"

✫ Computational Finance – p. 24 ✪ Control Variates

Given that we wish to estimate E(X), suppose that we can somehow find another random variable Y which is close to X in some sense and has known expectation E(Y ). Then the random variable Z defined by

Z = X + E(Y ) Y − obviously satisfies E(Z) = E(X). We can therefore obtain the desired value E(X) by running Monte Carlo simulation on Z. In this context Y is called the control variate.

Computational Finance – p. 25 Since adding a constant to a random variable does not change its variance, we see that

Var(Z) = Var(X Y ). − Therefore, in order to get some benefit from this approach we would like X Y to have a small variance. − This is what we mean by ”close in some sense” from the previous slide.

There is in general no clear candidate for a control variate, this depends on the particular problem. Intuition is needed !

Computational Finance – p. 26 Fine-tuning the Control Variate

Given that we have a candidate Y for a control variate, we can define for any θ R ∈ Z = X + θ(E(Y ) Y ). θ − We still have E(Z) = E(X), so we may apply Monte Carlo to Zθ in order to compute E(X). We have

Var(Z ) = Var(X θY ) = Var(X) 2θ cov(X, Y ) + θ2Var(Y ) θ − − We can consider this as a function of θ and look for the minimizer.

Computational Finance – p. 27 It is easy to see that the minimizer is given by

cov(X, Y ) θ = min Var(Y )

One can furthermore show that Var(Zθ) < Var(X) if and only if θ (0, 2 θ ). ∈ min In general, however, the expression cov(X, Y ) which is used to compute θmin is not known. The idea is to run Monte Carlo, where in a first step cov(X, Y ) is computed via Monte Carlo method with lower accuracy and the approximation is then used in a second step in order to compute E(Zθ) = E(X) by Monte Carlo method as indicated above.

Computational Finance – p. 28 Underlying asset as control variate

If S(t) is an asset price then exp( rt)S(t) is a martingale and − E[exp( rT )S(T )] = S(0). − Suppose we are pricing an option on S with discounting pay- off Y . From independent replications Si, i = 1,...,M, we can form the control variate

M 1 Y S erT S(0) . M i − i − i=1 X 

Computational Finance – p. 29 Hedge control variates

Because the payoff of a hedged portfolio has a lower - dard deviation than the payoff of an unhedged one, using hedges can reduce the volatility of the value of the portfolio.

A delta hedge consists of holding ∆ = ∂C/∂S shares in the underlying asset, which is rebalanced at the discrete time intervals. At time T , the hedge consists of the savings account and the asset, which closely replicates the payoff of the option. This gives

n r(T t0) ∂C(ti) ∂C(ti 1) r(T ti) C(t )e − − S e − = C(T ), 0 − ∂S − ∂S ti Xi=0   where ∂C(t 1/∂S = ∂C(tn)/∂S = 0. − Computational Finance – p. 30 After rearranging terms we get

n 1 − r(T t0) ∂C(ti) r(ti+1 ti) r(T ti+1) C(t )e − + S S e − e − = C(T ). 0 ∂S ti+1 − ti i=0 X  Because the term

n 1 − ∂C(ti) r(ti+1 ti) r(T ti+1) CV = S S e − e − ∂S ti+1 − ti i=0 X  is a martingale due to the known property that option price is a value of the hedging portfolio, the mean of CV is zero.

Computational Finance – p. 31 We can use than CV as a control variate. When we are pricing a call option on S with discounting pay- + off C(T )=(ST K) , then from independent replications j j − ST , CV , j = 1,...,M, we can form the control variate esti- mator M r(T t0) 1 j j C(t )e − = C (T ) CV . 0 M − Xj=1 

Computational Finance – p. 32 Example:

Asian options are options where payoff depends on the av- erage price of the underlying asset during at least some part of the life of the option. The payoff from the average call is

max(S K, 0)=(S K)+ ave − ave − and that from the average put is

max(K S , 0)=(K S )+, − ave − ave where Save is the average value of the underlying asset cal- culated over a predetermined averaging period.

Computational Finance – p. 33 Asian Options and Control Variates The average call option traded on the market has a payoff of the form n + 1 Sti K n − ! Xi=1 Even in the most elementary Black-Scholes model, there is no analytic expression for this price.

On the other hand, for the corresponding geometric average Asian option 1 + n n

Sti K − !  Yi=1  there is an analytic formula similar to Black-Scholes formula.

Computational Finance – p. 34 Asian Options cont. Intuition tells us that prices of the above options are similar. One can therefore use the geometric average Asian option price as a control variate to improve efficiency of compu- tation of the price for the arithmetic average Asian option.

The price of geometric (continuous) average call option in the Black-Scholes model is given by the formula

2 1 r+ σ T − 2 6 rT e S0Φ(b1) e− KΦ(b2),   − where

2 S0 1 σ log K + 2 r + 6 T b1 = , σ √T  √3

σ Computational Finance – p. 35 b2 = b1 √T. − √3 Algorithm Let P be the price of the geometric average option in B-S model (where an analytic formula is available). For k = 1, 2,...,M simulate sample paths (k) (k) (k) and calculate (St0 , St1 ,...,Stn )

1 + n + n n rT 1 (k) rT (k) Ak = e− Sti K ,Gk = e− Sti K n − − !  Xi=1   Yi=1 

Then calculate Xk = Ak (Gk P ). Price is estimated by − −

M 1 a = X M M k Xk=1 and the confidence interval ... Computational Finance – p. 36 Asian option improved

It appears that the formula for the geometric (continuous) average call option gives the price which differs by almost 1% from the price obtained by MC simulations. This price discrepancy can be explained by the fact that in the MC sim- ulation we use discrete geometric averaging and not contin- uous. Fortunately we can also derive in the Black-Scholes model an analytic formula for the geometric discrete aver- age call option.

Computational Finance – p. 37 The price is given by the formula

rT +(r σ2/2)T N+1 +σ2T (N+1)(2N+1) rT e− − 2N 12N2 S Φ(b ) e− KΦ(b ), 0 1 − 2 where

S0 2 N+1 2 (N+1)(2N+1) log K +(r σ /2)T 2N + σ T 6N 2 b1 = − , σ T (N+1)(2N+1) N 6

S0 2q N+1 log K +(r σ /2)T 2N b2 = − σ T (N+1)(2N+1) N 6 q and N is the number of sample points.

Computational Finance – p. 38 Other applications of the control variate technique:

valuation of options with "strange" payoffs,

American options,

various path-dependent options.

Computational Finance – p. 39 Random walk construction

We focus on simulating values (W (t1),...,W (tn)) at a fixed set of points 0

W (t ) = W (t ) + t t Z , i = 0,...,n 1. i+1 i i+1 − i i+1 − For log-normal stock pricesp and equidistributed time points t t = δt, for i = 0,...,n 1, we have i+1 − i − 1 S = S exp r σ2 δt + σ√δtξ , ti+1 ti − 2 i    where ξi is a sample from (0, 1). N Computational Finance – p. 40 Computing the Greeks Finite Differences

∂ψ For fixed h > 0, we estimate ∆ = ∂x by forward finite differ- ences 1 E ψ(Sx+h) E ψ(Sx ) h T − T or by centered finite  differences  

1 x+h x h E ψ(S ) E ψ(S − ) , 2h T − T   x     where ST denotes the value of ST under the condition S0 = x. The both terms of these differences can be estimated by Monte Carlo methods.

Computational Finance – p. 41 For instance, for the Black-Scholes model

Sx = x exp (r σ2/2)t + σW , t − t   Delta can be estimated by

M 2 2 1 (r σ /2)T +σ√Tξi (r σ /2)T +σ√Tξi ψ (x+h)e − ψ (x h)e − , 2hM − − i=1   X   where the ξi are standard normal variables.

Computational Finance – p. 42 General setting Let a contingent claim have the form

Y (θ) = ψ X1(θ),...,Xn(θ) , where θ is a on which the instrument depends. The derivative with respect to θ is the Greek parameter we are interested in. The payoff of this instrument is α(θ) = E[Y (θ)]. The forward and centered differences by which we calculate Greeks are Aˆ = h 1 α(θ+h) α(θ) , Aˆ = (2h) 1 α(θ+h) α(θ h) . F − − C − − − In addition we have two methods of Monte Carlo simula- tions for the two values of α which appear in these differ- ences. We can simulate each value of α by an independent sequence of random numbers (this will be denoted by an ad- ditional subscript i) or use common random numbers (this will be denoted by a subscript ii).

Computational Finance – p. 43 Hence in fact we have four : AˆF,i, AˆF,ii, AˆC,i and AˆC,ii. To assess the accuracy of these estimators let us consider their bias and variance. Then we can combine these two values into a error (MSE) which is given by MSE(Aˆ) = Bias2(Aˆ) + Var(Aˆ). For bias we have an approximation Bias(Aˆ) bhβ, ≈ where β = 1 for forward differences and β = 2 for centered differences (possibly with different positive b). For variance we have Var(Aˆ) σ2/Mhη, ≈ where M is the number of simulations, η = 1 for common random numbers and η = 2 for independent random num- bers in simulating the difference of α’s (possibly with differ- ent values of ). σ Computational Finance – p. 44 Assuming the following step size dependence on M

γ h M − , ≈ we find optimal γ γ = 1/(2β + η). Then the rate of convergence for our estimators is

β M − 2β+η . O   As follows from these approximations, it is advised to use rather centered differences and common random numbers, i.e. the estimator AˆC,ii, as it produces smaller error and higher order of convergence.

Computational Finance – p. 45 Pathwise differentiation of the payoff

In cases where ψ is regular and we know how to differentiate x ST with respect to x, Delta can be computed as x ∂ x ∂ x x ∂ST ∆ = E[ψ(S )] = E ψ(S ) = E ψ′(S ) ∂x T ∂x T T ∂x

   x x  ∂ST ST For instance, in the Black-Scholes model, ∂x = x and x x ST ∆ = E ψ′(S ) T x   provided the derivative ψ′ exists.

Computational Finance – p. 46 General setting

The differentiation of the payoff as a method of calculating Greeks is based on the following equality

d dY α′(θ) = E[Y (θ)] = E . dθ dθ h i The interchange of differentiation and integration holds un- der the assumption that the differential quotient

1 h− Y (θ + h) Y (θ) − is uniformly integrable. 

Computational Finance – p. 47 The uniform integrability mentioned on the previous slide holds when A1. X (θ) exists with probability 1 for every θ Θ and i = i′ ∈ 1,...,n, where Θ is a domain of θ, A2. P(X (θ) D ) = 1 for θ Θ and i = 1,...,n, where D i ∈ ψ ∈ ψ is a domain on which ψ is differentiable, A3. ψ is Lipschitz continuous,

A4. for all assets Xi we have

X (θ ) X (θ ) κ θ θ , | i 1 − i 2 |≤ i| 1 − 2| where κ is a random variable with E[κ ] < . i i ∞

Computational Finance – p. 48 Black-Scholes delta

x rT x + ψ(S ) = e− (S K) T T − with

Sx = x exp (r σ2/2)T + σ√T Z and Z (0, 1). T − ∼N Then  x dψ dψ dST = x . dx dST × dx For the first derivative we clearly have

x d x + 0 if ST < K, x (ST K) = x dST − (1 if ST > K.

This derivative fails to exists at ST = K but the event ST = K has probability 0.

Computational Finance – p. 49 Finally x dψ rT ST = e− 11Sx >K. dx x T This is already the expression which is easy for Monte Carlo simulations. But Gamma cannot be computed by this approach since even for vanilla options the payoff function in not twicely differen- tiable.

Computational Finance – p. 50 Likelihood ratio x We have to compute a derivative of E[ψ(ST )]. Assume that we know the transition density

x x g(ST ) = g(x, ST ). Then

x x x x E[ψ(ST )] = ψ(ST )g(ST )dST = ψ(S)g(x, S)dS Z Z To calculate ∆ we get

∂ ∂ ∆ = E[ψ(Sx )] = ψ(S) g(x, S)dS = ∂x T ∂x Z ∂ log g ∂ log g = ψ(S) g(x, S)dS = E ψ(S) . ∂x ∂x Z  

Computational Finance – p. 51 Black-Scholes gamma

When the transition function g(x, ST ) which is the probabil- ity density function is smooth, all derivatives can be easily computed. For the gamma we have

∂2 ∂2 log g ∂ log g ∂g Γ = E[ψ(Sx )] = ψ(S) g(x, S) + dS = ∂x2 T ∂x2 ∂x ∂x Z   ∂2 log g ∂ log g 2 = ψ(S) + g(x, S)dS = ∂x2 ∂x Z     ∂2 log g ∂ log g 2 =E ψ(S) + . ∂x2 ∂x     

Computational Finance – p. 52 For the log-normal distributions, we have

1 g(x, ST ) = 2 √2πσ T ST × 2 2 log ST log x (r σ /2)T exp − − − , − 2σ2T    ∂ log g(x, S ) log S log x (r σ2/2)T T = T − − − , ∂x xσ2T ∂2 log g(x, S ) 1 + log S log x (r σ2/2)T T = T − − − . ∂x2 − x2σ2T

Putting this all together, we have the likelihood ratio method for the gamma of options in the Black-Scholes model.

Computational Finance – p. 53 A very nice survey of applications of Monte Carlo to pricing of financial derivatives may be found in

Boyle, Brodie, Glasserman (1997) ”Monte Carlo methods for security pricing”, Journal of Economic Dynamics and Control 21.

There is also a fundamental monograph

Paul Glasserman Monte Carlo Methods in Financial Engi- neering, Springer 2004.

Computational Finance – p. 54