# Monte Carlo Simulation

(1)

## Monte Carlo Simulation

### by Jan Palczewski

(2)

We know from Discrete Time Finance that one can compute a fair price for an option by taking an expectation

EQe−rT X

Therefore, it is important to have algorithms to compute the expectation of a random variable 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 random variable. 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 Law of Large Numbers and the Central Limit Theorem.

(3)

Let X1, X2, . . . be a sequence of independent identically dis-tributed random variables with expected value µ and vari-ance σ2. Define the sequence of averages

Yn = X1 + X2 + · · · + Xn

n , n = 1, 2, . . . .

(Law of Large Numbers) Yn converges to µ almost surely as n → ∞.

Let

Zn = (X1 − µ) + (X2 −µ) + · · · + (Xn − µ)

n .

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

(4)

Assume we have a random variable X with unknown expec-tation and variance

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.

(5)

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

aM = 1 M M X i=1 Xi 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)

b2M =

PM

i=1(Xi − aM)2

(6)

### 2

By the central limit theorem we know that PMi=1 Xi behaves approximately like a N (M a, M b2) distributed random vari-able. Therefore aM a is approximately N (0, b 2 M ). In other words aM a b M Z, where Z ∼ N(0, 1).

(7)

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

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

aM 1.96 bM M , aM + 1.96 bM √ M

approximately with probability 0.95.

(8)

### inter-Confidence intervals explained

If Z N(µ, σ2) then

P(µ 1.96σ < Z < µ + 1.96σ) = 0.95

because

Φ(1.96) = 0.975

To construct a confidence interval with a confidence level α

different from 0.95, we have to find a number A such that

φ(A) = 1 1 − α 2 .

Then the α-confidence interval

(9)

The width of the confidence interval is a measure of the accuracy of our estimate.

In 95% of cases the true value lies in the confidence interval.

Beware! In 5% of cases it is outside the interval!

The width of the confidence interval depends on two factors:

Number of simulations M Variance of the variable X

(10)

aM 1.96 bM M , aM + 1.96 bM √ M

1. The size of the confidence interval shrinks like the in-verse square root of the number of samples. This is one of the main disadvantages of Monte Carlo method.

2. The size of the confidence interval is directly propor-tional to the standard deviation 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.

(11)

### 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-ance by b2M. aM 1.96 bM M , aM + 1.96 bM √ M

Important! People often use confidence intervals with other confidence levels, e.g. 99% or even 99.9%. Then instead of

(12)

### Monte Carlo put into action

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

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

We assume that under a risk-neutral measure the stock price St at t 0 is given by St = S0 exp r 1 2σ 2t + σW t .

(13)

We know that Wt √tZ with Z ∼ N(0, 1).

We can therefore write the stock price at expiry T as

ST = S0 exp r 1 2σ 2T + σT Z .

We can compute a fair price for ψ(ST) taking the discounted expectation

Ehe−rT ψS0e(r−12σ

2)T+σT Zi

This expectation can be computed via Monte Carlo method with the following algorithm

(14)

✬ ✫ ✩ ✪ for i = 1 to M compute an N (0, 1) sample ξi set Si = S0 exp r 21σ2T + σ√T ξi set Vi = e−rT ψ(S i) end set aM = M1 PMi=1 Vi

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

b2M = 1

M 1

X

i

(Vi aM)2

(15)
(16)

### Variance Reduction Techniques

Antithetic Variates

Control Variate

Importance Sampling (not discussed here)

(17)

We have seen before that the size of the confidence interval is determined by the value of

p

Var(X)

M ,

where M is the sample size.

We would like to find a method to decrease the width of the confidence interval by other means 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.

(18)

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

(19)

### 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

Y = X + Z 2 .

Obviously E(Y ) = E(X). On the other hand Var(Y ) = cov X + Z 2 , X + Z 2 = 1 4 Var(X) + 2| cov{z(X, Z}) ≤0 + Var(Z) | {z } =Var(X) ≤ 1 2Var(X).

(20)

### ...

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.

(21)

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 ∼ N(0, 1).

The standard normal distribution is symmetric, and hence also U ∼ N(0, 1).

It then follows obviously that f(U) f(U). In particular they have the same expectation !

(22)

Therefore, in order to compute the expectation of X = f(U), we can take Z = f(U) and define

Y = f(U) + f(−U)

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

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

(23)

### Implementation

✬ ✫ ✩ ✪ for i = 1 to M compute an N (0, 1) sample ξi set Si+ = S0 exp r 21σ2T + σ√T ξi set Si− = S0 exp r 21σ2T σ√T ξi set Vi+ = e−rT ψ(S+ i ) set Vi− = e−rT ψ(S− i ) set Vi = (Vi+ + Vi−)/2 end set aM = M1 PMi=1 Vi

The output aM provides an approximation of the option price.

(24)

Example: European put: (K ST )+ with S0 = 4, K = 5, σ = 0.3, r = 0.04, T = 1. ✬ ✫ ✩ ✪

Plain Monte Carlo

 "Mean" "1.02421105149"  "Variance" "0.700745604547"  "Standard deviation" "0.837105491887"  "Confidence interval" "1.00780378385" "1.04061831913" ✬ ✫ ✩ ✪ Antithetic Variates  "Mean" "1.01995595996"  "Variance" "0.019493094166"  "Standard deviation" "0.139617671396"  "Confidence interval" "1.01721945360" "1.02269246632"

(25)

### 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.

(26)

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 !

(27)

### 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.

(28)

It is easy to see that the minimizer is given by

θmin = cov(X, Y )

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.

(29)

### 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 estimator

1 M M X i=1 Yi Si erT S(0).

(30)

### Hedge control variates

Because the payoff of a hedged portfolio has a lower stan-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

C(t0)er(T−t0) − n X i=0 ∂C(t i) ∂S − ∂C(ti1) ∂S Stier(T−ti) = C(T ), where ∂C(t /∂S = ∂C(t )/∂S = 0.

(31)

After rearranging terms we get C(t0)er(T−t0)+ n1 X i=0 ∂C(ti) ∂S Sti+1−Stie r(ti+1−ti)er(T−ti+1) = C(T).

Because the term

CV = n1 X i=0 ∂C(ti) ∂S Sti+1 − Stie r(ti+1−ti)er(T−ti+1)

is a martingale due to the known property that option price is a value of the hedging portfolio, the mean of CV is zero.

(32)

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

STj , CV j, j = 1, . . . , M, we can form the control variate esti-mator C(t0)er(T−t0) = 1 M M X j=1 Cj(T) CV j.

(33)

### Example: Average Asian option

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(Save K, 0) = (Save K)+

and that from the average put is

max(K Save, 0) = (K Save)+,

where Save is the average value of the underlying asset cal-culated over a predetermined averaging period.

(34)

### Asian Options and Control Variates

The average call option traded on the market has a payoff of the form 1 n n X i=1 Sti K !+

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 n Y i=1 Sti n1 − K !+

(35)

### 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

e− 1 2 r+σ62 T S0Φ(b1) e−rT KΦ(b2), where b1 = log S0 K + 12 r + σ62T σ √ 3 √ T , b2 = b1 σ √T . Computational Finance – p. 35

(36)

### 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

(St(0k), St(1k), . . . , St(nk)) and calculate Ak = e−rT 1 n n X i=1 St(ik)K + , Gk = e−rT n Y i=1 St(ik) n1 −K !+ Then calculate Xk = Ak (Gk P ). Price is estimated by aM = 1 M M X k=1 Xk

(37)

### 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.

(38)

The price is given by the formula e−rT+(r−σ2/2)T N2+1N +σ 2T (N+1)(2N+1) 12N2 S0Φ(b1) − e−rT KΦ(b2), where b1 = log S0 K + (r − σ2/2)T N2N+1 + σ2T (N+1)(2N+1) 6N2 σ N q T(N+1)(2N+1) 6 , b2 = log S0 K + (r − σ2/2)T N2N+1 σ N q T(N+1)(2N+1) 6

(39)

Other applications of the control variate technique:

valuation of options with "strange" payoffs, American options,

(40)

### Random walk construction

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

Let Z1, . . . , Zn be independent standard normal random vari-ables.

For a standard Brownian motion W (0) = 0 and subsequent values are generated as follows

W(ti+1) = W(ti) + pti+1 tiZi+1, i = 0, . . . , n 1.

For log-normal stock prices and equidistributed time points

ti+1 ti = δt, for i = 0, . . . , n 1, we have Sti+1 = Sti exp r 1 2σ 2δt + σδtξ i ,

(41)

### Computing the Greeks

Finite Differences

For fixed h > 0, we estimate ∆ = ∂ψ∂x by forward finite differ-ences

1

h

Eψ(STx+h) Eψ(STx)

or by centered finite differences

1 2h

Eψ(STx+h) Eψ(STx−h),

where STx denotes the value of ST under the condition S0 =

x.

The both terms of these differences can be estimated by Monte Carlo methods.

(42)

For instance, for the Black-Scholes model

Stx = x exp(r σ2/2)t + σWt,

Delta can be estimated by

1 2hM M X i=1 ψ (x+h)e(r−σ2/2)T+σ√T ξi −ψ (xh)e(r−σ2/2)T+σ√T ξi ,

(43)

General setting

Let a contingent claim have the form

Y (θ) = ψ X1(θ), . . . , Xn(θ),

where θ is a parameter 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 ˆ AF = h−1 α(θ+h)α(θ), Aˆ C = (2h)−1 α(θ+h)−α(θ−h) .

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).

(44)

Hence in fact we have four estimators: AˆF,i, AˆF,ii, AˆC,i and

ˆ

AC,ii.

To assess the accuracy of these estimators let us consider their bias and variance. Then we can combine these two values into a mean square 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/M hη,

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

(45)

differ-Assuming the following step size dependence on M h M−γ,

we find optimal γ

γ = 1/(2β + η).

Then the rate of convergence for our estimators is

OM−2ββ+η

.

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.

(46)

Pathwise differentiation of the payoff

In cases where ψ is regular and we know how to differentiate

STx with respect to x, Delta can be computed as

∆ = ∂ ∂xE[ψ(S x T )] = E ∂ ∂xψ(S x T ) = Eψ(STx)∂S x T ∂x

For instance, in the Black-Scholes model, ∂STx

∂x = STx x and ∆ = Eψ′(STx)S x T x

(47)

General setting

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

α′(θ) = d dθE[Y (θ)] = E hdY dθ i .

The interchange of differentiation and integration holds un-der the assumption that the differential quotient

h−1 Y (θ + h) Y (θ)

(48)

The uniform integrability mentioned on the previous slide holds when

A1. X′

i(θ) exists with probability 1 for every θ ∈ Θ and i = 1, . . . , n, where Θ is a domain of θ,

A2. P(Xi(θ) Dψ) = 1 for θ Θ and i = 1, . . . , n, where Dψ

is a domain on which ψ is differentiable,

A3. ψ is Lipschitz continuous,

A4. for all assets Xi we have

|Xi1) Xi2)| ≤ κi|θ1 θ2|,

(49)

Black-Scholes delta ψ(STx) = e−rT (STx K)+ with STx = x exp (r σ2/2)T + σ√T Z and Z ∼ N(0, 1). Then dψ dx = dψ dSTx × dSTx dx .

For the first derivative we clearly have

d dSTx (S x T − K)+ = ( 0 if STx < K, 1 if STx > K.

This derivative fails to exists at ST = K but the event ST = K

(50)

Finally dψ dx = e −rT S x T x 11STx>K.

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.

(51)

Likelihood ratio

We have to compute a derivative of E[ψ(STx)]. Assume that we know the transition density

g(STx) = g(x, STx). Then E[ψ(STx)] = Z ψ(STx)g(STx)dSTx = Z ψ(S)g(x, S)dS To calculate ∆ we get ∆ = ∂ ∂xE[ψ(S x T)] = Z ψ(S) ∂ ∂xg(x, S)dS = = Z ψ(S)∂ log g ∂x g(x, S)dS = E ψ(S)∂ log g ∂x .

(52)

Black-Scholes gamma

When the transition function g(x, ST) which is the probabil-ity densprobabil-ity function is smooth, all derivatives can be easily computed.

For the gamma we have

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

(53)

For the log-normal distributions, we have g(x, ST ) = 1 2πσ2T ST × exp − log ST − log x − (r − σ 2/2)T 2 2σ2T , ∂ log g(x, ST) ∂x = log ST log x (r σ2/2)T xσ2T , ∂2 log g(x, ST) ∂x2 = − 1 + log ST log x (r σ2/2)T x2σ2T .

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

(54)

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.

Updating...

Updating...