Download as pdf or txt
Download as pdf or txt
You are on page 1of 66

Monte Carlo Simulation in Finance

Abdulhalim Misbaha Ahmed

ARBA MINCH UNIVERSITY


ARBA MINCH
August, 2018
Monte Carlo Simulation in finance

Abdulhalim Misbaha Ahmed

A THESIS SUBMITTED TO COLLEGE OF NATURAL


SCIENCE, DEPARTMENT OF MATHEMATICS FOR THE
AWARD OF THE DEGREE OF
MASTERS OF SCIENCE
IN
MATHEMATICS (Numerical)

COLLEGE OF NATURAL SCIENCE


DEPARTMENT OF MATHEMATICS
ARBA MINCH UNIVERSITY
August, 2018
ARBA MINCH UNIVERSITY
SCHOOL OF GRADUATE STUDIES
DEPARTMENT OF MATHEMATICS

Certificate
This is to certify that the thesis entitled “Monte Carlo Simulation in Finance”

in fulfillment of requirements for the award of the masters of science (MSc.)

in Mathematics (Numerical) submitted to the department of Mathematics,

Arbaminch university carried out by Abdulhalim Misbaha (I.D SMSc/111/07)

under my supervision. Therefore I recommend that the student’s Thesis can be

presented for review and open oral presentation.

ARBA MINCH UNIVERSITY Dr.Mergia Balcha


Advisor,
ARBA MINCH
Department of Mathematics
August, 2018 Arba Minch University.

i
ARBA MINCH UNIVERSITY
SCHOOL OF GRADUATE STUDIES
DEPARTMENT OF MATHEMATICS
APPROVAL

As member of Board of Examiners of the final MSc. Graduate thesis open


defense Examination, we certify that we have read and evaluate this graduate
thesis prepared by Abdulhalim Misbaha entitled by “ Monte Carlo Simulation
in Finance” and recommended that it can be accepted as fulfilling the thesis
requirement for the degree of MSc. In Mathematics (Numerical).

APPROVED BY
Advisor
Name ————————————– Signature ——————– Date—————-

Examiner
Name ————————————– Signature ——————– Date—————-

Chair person
Name ————————————– Signature ——————– Date—————-

Head of department
Name ————————————– Signature ——————– Date—————-

ii
ARBA MINCH UNIVERSITY
SCHOOL OF GRADUATE STUDIES
DEPARTMENT OF MATHEMATICS
APPROVAL OF REVISED THESIS

Name of the candidate —————————————————————————-


College/institute ———————————————————————————–
Department/School——————————————————————————–
Thesis Title:——————————————————————————————
Date of Review ———————————————————————————-
1. Comment on the Thesis and open presentation
———————————————————————————————————–
———————————————————————————————————–
2. Suggestions made by the reviewer/s
———————————————————————————————————–
———————————————————————————————————–
3. Modification(s) to be made
———————————————————————————————————–
———————————————————————————————————–
4. Final decision by the Reviewer/s
———————————————————————————————————–
———————————————————————————————————–
Name of the Reviewer/s —————————————————————————
Signature ————————– Date———————————————————
Department Head’s Name ———————————————————————–
Signature and Stamp ————————– Date——————————————–

iii
Acknowledgements
Fore most, I would like to express my sincere gratitude to my advisor Dr.Mergia

Balcha for his generous advice throughout the conduction of this thesis. I also

express my thanks to all staff members of the department of mathematics and to

all my friends for their unmentioned cooperation on my thesis.

iv
v
Abstract

The Monte Approach has proven to be valuable and flexible computational

tool in modern finance. The main aim of this thesis is to present and analyze

Monte Carlo Method for pricing European style derivatives . In this thesis the

mathematical description underlying this numerical method is presented .In

addition to the above tasks the result of Monte Carlo simulation is compared

with the result of finite difference method.

Key words

*European Option

*call option

*Put option

*Barrier Option

*Monte Carlo Simulation

vi
—————————————————————————————-

vii
Contents

Certificate i

Acknowledgements iv

Abstract vi

Contents vii

1 Introduction 1
1.1 Statement of the problem . . . . . . . . . . . . . . . . . . . . . . . 3
1.1.1 objective of the study . . . . . . . . . . . . . . . . . . . . . . 3
1.1.1.1 general objective . . . . . . . . . . . . . . . . . . . 3
1.1.1.2 Specific Objectives . . . . . . . . . . . . . . . . . . 4

2 Literature review 5
2.1 Research Methodology . . . . . . . . . . . . . . . . . . . . . . . . . 11

3 Results and Discussion 12


3.1 Generating uniform random numbers . . . . . . . . . . . . . . . . . 12
3.1.1 How do we make random numbers? . . . . . . . . . . . . . . 12
3.1.2 Pseudo-random numbers . . . . . . . . . . . . . . . . . . . . 13
3.1.3 Linear Congruential Generator . . . . . . . . . . . . . . . . . 13
3.1.3.1 Linear Congruential Generator Algorithm . . . . . 13
3.1.4 Non-uniform Random variable generation . . . . . . . . . . . 14
3.2 Descrete probability distribution . . . . . . . . . . . . . . . . . . . . 15
3.2.1 The Binomial Distribution . . . . . . . . . . . . . . . . . . . 15
3.2.2 Mean and variance . . . . . . . . . . . . . . . . . . . . . . . 15
3.2.3 The Poisson Distribution. . . . . . . . . . . . . . . . . . . . 16
3.3 The Black-Scholes equation . . . . . . . . . . . . . . . . . . . . . . 16
3.4 The Monte Carlo Method . . . . . . . . . . . . . . . . . . . . . . . 20
3.5 Finite Difference Method . . . . . . . . . . . . . . . . . . . . . . . 21
3.6 Analytical Solution . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

viii
3.7 Normally and Log-normally Distributed variables . . . . . . . . . . 26
3.8 Modeling asset price . . . . . . . . . . . . . . . . . . . . . . . . . . 27
3.9 Price process of underlying asset . . . . . . . . . . . . . . . . . . . . 28
3.9.1 One-period Binomial Model . . . . . . . . . . . . . . . . . . 29
3.9.2 Two- period Binomial Model . . . . . . . . . . . . . . . . . . 30
3.10 Derivatives and option in finance . . . . . . . . . . . . . . . . . . . 31
3.11 Pricing Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
3.11.1 Underlying stock price . . . . . . . . . . . . . . . . . . . . . 33
3.11.2 Time remaining expiration . . . . . . . . . . . . . . . . . . . 33
3.11.3 Volatility . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
3.11.4 Dividends . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
3.11.5 Interest Rates . . . . . . . . . . . . . . . . . . . . . . . . . . 34
3.12 Pricing European option . . . . . . . . . . . . . . . . . . . . . . . . 34
3.12.1 Solution for European call . . . . . . . . . . . . . . . . . . . 34
3.12.2 Boundary condition for European options . . . . . . . . . . 36
3.13 Brownian and Geometric Brownian Stochastic Process . . . . . . . 36
3.14 Generating Stock Paths . . . . . . . . . . . . . . . . . . . . . . . . 37
3.15 Simulating Barrier Option . . . . . . . . . . . . . . . . . . . . . . . 38
3.16 Antithetic Sampling . . . . . . . . . . . . . . . . . . . . . . . . . . 39
3.17 Results of Monte Carlo simulation . . . . . . . . . . . . . . . . . . 40

4 Conclusion And Recommendation 42


4.1 conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
4.2 Recommendation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44

Appendices 45

References 53

ix
CHAPTER 1

Introduction

Monte Carlo Simulation is named after the city of Monte Carlo in Monaco, which

is famous for gambling such as roulette, dice, and slot machine.

Since the simulation process involves generating chance variables and exhibits

random behaviors, it has been called Monte Carlo Simulation. Monte Carlo

Simulation is powerful statistical analysis tool and widely used in both

non-engineering fields and engineering fields. It was initially used to solve

neuron diffusion problem in atomic bomb work at Alamos Scientific Laboratory

in 1944.Monte Carlo Simulation has been applied to diverse problems ranging

from the simulation of complex physical phenomena such as atom collision to the

simulation of traffic flow and Dow Jones forecasting. Monte Carlo is also suitable

for solving complex engineering problems because it can deal with a large number

of random variables, various distribution types, and highly nonlinear engineering

models. Different from a physical experiment, Monte Carlo simulation performs

random sampling and conducts a large number of experiments on computer.

Then the statistical characteristic experiment(model output) are observed, and

1
conclusions on the model outputs are drawn based on the statistical experiment.

In each experiment, the possible values of the input random variables X =

(X1 , X2 , ..., Xn ) are sampled(generated)according to their distribution. Then the

values of the output variable Y are calculated through the performance function

Y = g(X) at the sample of input random variables. With a number of experiments

carried out in this manner a set of samples of output variable Y are available for

the statistical analysis which estimates the characteristic of the output variable

Y.Three steps are required in the simulation process.

Step 1 :sampling on random input variables X.

Step 2: Evaluating model output Y.

Step 3: statistical analysis on the model output.[1]

The Monte Carlo method is based on the generation of multiple trials to determine

the expected value of a random variable. There are a number of commercial

packages that run Monte Carlo simulation, however a basic spreadsheet program

can be used to run simulation. In this case the generation of multiple trials is

implemented by propagating a basic formula as many times as the number of

iteration required by the model. The Monte Carlo method provides an estimate of

the expected values of a random variables and also predicts the estimation error,

which is proportional to the number of iteration. Monte Carlo simulation exploit

randomness to arrive at their results. Figuratively speaking, the outcomes of coin

tosses repeatedly direct course of the simulation .These Monte Carlo simulation

comprise a case of special interest in the epistemology of simulation , that is , in the

study of the source of the knowledge supplied by simulation. Tossing coin, rolling

dice , spinning roulette wheel , drawing entries from tables of random numbers or

taking the outputs from computational pseudo-randomizers all seem quite remote

2
from the deliberate inferential step of an argument. Indeed, this reliance on

randomness this Monte Carlo simulation look more like real experiments. For

outcome of real experiment is learned only by doing the experiment. We cannot

know in advance whether a test group will fare better under the treatment ,

which particles will be produced at novel energies in an accelerator, or which

micro-organisms will be found to be thriving when we look through our microscope.

We need to do the experiments to discover the results. [2]

1.1 Statement of the problem

Finance is one of the most rapidly changing and fastest growing area in

the corporate business world.As this financial products continue to grow in

complexity,suitable technique have become increasingly important to analyze this

financial products.

1.1.1 objective of the study

1.1.1.1 general objective

The general objective of these study is to solve Financial problems using

Monte Carlo simulation,Finite difference method and analytical method and then

compare the result of the three.

3
1.1.1.2 Specific Objectives

1. To generate random variable using Monte Carlo simulation.

2. To find better approximate solution ;

3. To find solution for random variable.

4. To analyze error using results of finite difference method and Monte Carlo

result.

4
CHAPTER 2

Literature review

Joy Woller, spring 1996, Monte Carlo methods are stochastic techniques meaning

they are based on the use of random numbers and probability statistics to

investigate problems. Stanislaw Ulam 1946 had the idea of using random

experiments (Monte Carlo method). George Casella 2008, deterministic methods

can be much faster for smooth function. Sawilosky distinguishes between a

simulation, Monte Carlo method and Monte Carlo simulation.[E.Balangurusamy

2002], to indicate “a sequence of operations which yields the desired quantity

either exactly or to a specified accuracy”[3].

Stanislaw Ulam (polish-American Mathematician) who worked with John

Neumann and Nicholas Metropolis on the “Manhattan project” had been

recognized as the first scientist used the computers to transform non-random

problems in to random forms that would facilitate their solution via statistical

sampling. Monte Carlo method are a broad class of computation algorithms that

rely on repeated random sampling to obtain numerical results ; typically one runs

simulations many times over in order to obtain the distribution of an unknown

5
probabilistic entity. The name comes from the resemblance of the technique to

the act of playing and recording results in a real gambling casino. [Nicholas

Metropolis and Stanislaw Ulam] published first paper on the Monte Carlo method

in 1949.

Monte Carlo method: any technique of statistical sampling employed to

approximate solutions to quantitative problems[4].

Sailosky distinguishes between a simulation, a Monte Carlo method and a Monte

Carlo simulation:

A simulation is a fictitious representation of reality.

A Monte Carlo method is a technique that can be used to solve a mathematical

or statistical problem.

A Monte Carlo simulation uses repeated sampling to determine the properties of

some phenomena (behavior)[5].

Cary and Chapman(1988)used the Monte Carlo method to analyze the seismic

waveform inversion problem in Bayesian formulation. Waveforms travel times

from source to receiver were as data, and model parameters defined a horizontally

earth with depth as function of the seismic wave propagation velocity.

Simulation is the process of numerically generating “random” data set, usually

on computer, that can be analyzed analytically to the real data. A Monte Carlo

method needs a reliable way of generating random number. While it is difficulty

to compute perfectly random numbers, most generators compute pseudo-random

numbers(R.E. Calfish,1998)[6].

According to G.Daphquist(2003), pseudo-random numbers mimic the behavior

6
of random numbers and are generated in a deterministic and predictable way.

Since many millions of random numbers and are required in Monte Carlo

simulation,the pseudo-random numbers must be easily computed. Dietrich (1996)

argues that Monte Carlo simulation share the same basic structure as controlled

experiments and reports the view among geneticists who use them that they

were thought to be much the same as ordinary experiments. Even if Monte

Carlo simulation do not form experiment, they challenge our view that simulation

are merely arguments. Humphreys(1994) allows that Monte Carlo simulation

are not experiments properly speaking. However Kalos and Whitloch point

out that such distinctions are not always easy to maintain. For example,

the emission of radiation from atoms is a natural stochastic process. It can

be simulated directly or its average behavior can be described by stochastic

equations that can themselves be solved using Monte Carlo methods. “Indeed

the same computer code can be viewed simultaneously as ‘a natural simulation’

or as a solution of the equations by natural sampling.” PhilipJ. Davis Monte

Carlo methods are apply to multi-dimensional integrals and may yield greater

accuracy for the same number of function evaluations than repeated integrations

using one dimensional methods. Pseudo random number generators are central

in applications such as simulations (example Monte Carlo method), electronic

games (example for procedural generations) and cryptography. Cryptographic

applications require the output not to be applicable from earlier outputs, and more

elaborate algorithms which do not inherit the linearity of simpler pseudo random

generators are needed. Good statistical properties are central requirement for the

output of pseudo-random generators. Mathematical analysis is required to have

any confidence that a pseudo-random generators numbers that are sufficiently close

7
to random to suit the intended use.

John Neumann cautioned about the misinterpretation of a pseudo random

generators as a truly random generator. Monte Carlo methods can be thought

of statistical simulation methods that utilize a sequence of random numbers to

perform the simulation. Monte Carlo methods use sequence of random numbers

to solve problems in e.g. mathematics, physics and chemistry. The reason why

random numbers are involved are:

(1)simulation of stochastic process a variable that varies randomly in time,

(2) A very complicated process is simulated for which there is neither analytical

solutions nor analysis available,

(3) problem of high dimension such as integrals in multi-dimension.

A Monte Carlo method needs a reliable way of generating random numbers. While

it is difficult to compute perfectly random numbers, most generators compute

pseudo-random numbers. They mimic the behavior of true random numbers

and are generated in a deterministic and predictable way. Since many millions

of random numbers are required in Monte Carlo simulation, the pseudo-random

numbers must be easily computed. They should also pass a number of statistical

test of randomness. If the sequence of numbers is repeated after some period

that period should be long. In some application, it is important that the same

sequence can generated many times for parameter tests. Two pseudo-random

generators satisfying these requirements are the linear congruential generators and

the Fibonacci generator.

Monte Carlo methods thought statistical simulation methods that utilize sequences

of random numbers to perform the simulation. The name “Monte Carlo”

8
was coined by Nicholas Constantine Metropolis (1915-1999) and inspired by

StanslowUlam(1909-1986) because Monte Carlo is a center for gambling and games

of chance.Monte Carlo methods are used in mathematics to solve various problems

by generating suitable random numbers and observing that fraction of the numbers

that obeys some property or properties. The method is useful for obtaining

numerical solutions to problems too complicated to solve analytically. The most

common application of the Monte Carlo method is Monte Carlo integration. Monte

Carlo of methods is applying to three-dimensional integrals and yield greater

accuracy for the same number of function evaluations than repeated integrations

using one dimensional method. Deterministic numerical integrations algorithms

work well in a small number of dimensions, but encounter two problems when the

functions have many variables. Monte Carlo method (Monte Carlo simulation)

is used to describe any technique that approximate solutions to quantitative

problems through statistical sampling.[7]

Sailosky distinguishes between a simulation, a Monte Carlo method and a Monte

Carlo simulation: a simulation is a fictitious representation of reality, a Monte

Carlo method is a technique that can be used to solve a mathematical or

statistical problem, and a Monte Carlo simulation uses repeated sampling to

determine the properties of some phenomena (behavior). Simulation is drawing

one pseudo-random variable from the interval (0,1] can be used to simulate the

tossing of a coin: if value is less than or equal to 0.50 designate the outcome as

heads, but if the value is greater than 0.50 designate the outcome as tails. This is

simulation but not a Monte Carlo simulation. Monte Carlo method: pouring out

a box of coins on a table and then computing the ratio of coins that land heads

9
versus tails is a Monte Carlo method of determining the behavior of repeated coin

tosses, but it is not simulation. Monte Carlo simulation: drawing a large number

of pseudo-random uniform variables from the interval (0,1] and assigning values

less than or equal to 0.5 as heads and greater than 0.50 as tails is a Monte Carlo

simulation of the behavior of repeatedly tossing a coin. Randomness: assume that

some inputs are random variables-modeling randomness by generating random

variables from their probability distribution, since some inputs to the model are

random outputs from the model are random too.

In simulation modeling process we should pass through the processes:(1)develop

the basic model that “ behaves like” the real problem , with special consideration

of the random or probabilistic input variable,(2) Conduct a series of computer

runs (called trials) to learn the behavior of the simulation behavior,(3) compute

the summary (output)statistics and make inference about the real problem.

Simulation process is similar to statistical inference process; statistics start a

population, sampling from the population, and then based on sample information

to infer population. Simulation start with basic model to represent real problem,

replicating the basic model and then based on the replication result to help solve

real problem.[8]

A data generating process: describes how values of variable of interest are

producing the population. Most data generating of interest include a systematic

component and stochastic component Re sampling: like Monte Carlo simulation,

re sampling method use a computer to generate a large number of simulated sample

of data. Also like Monte Carlo simulation, patterns in these simulated samples

are then summarized, and result used to evaluate substantive theory or statistical

10
estimators. The difference between Monte Carlo simulation and re sampling is

that in sampling the simulated samples are generated by drawing new samples

(with replacement) from the sample of data we have. In re sampling method, the

researcher does not know or control the data generating process, but the goal of

learning about the data generating remains the same.[9,10]

2.1 Research Methodology

Generation of random numbers is the crucial point in Monte Carlo simulation.

There are different methods of generating random numbers. In this thesis the

following methods of generating random variable solution seeking methods will be

used:

1. Linear congruential generator method to generate random variable.

2. Finite difference method and Iteration method to solve the random variable

and compare the result with Monte Carlo simulation

3. Computer soft wares like MATLAB to reduce error

11
CHAPTER 3

Results and Discussion

3.1 Generating uniform random


numbers

3.1.1 How do we make random numbers?

A good method of generating a random number should have the following

properties:

1. The random numbers should have a U (0, 1) distribution.

2. The random numbers should be independent.

3. The method should be very fast and not require a large amount of computer

memory

12
3.1.2 Pseudo-random numbers

The best idea in practice is usually to use deterministic sequence of numbers

generated by a computer that “act like random numbers” .such numbers are called

pseudo-random numbers. What exactly is means to “act like random numbers” is

something philosophical question. However, people now more or less agree that it

is sufficient that the numbers fool as many statistical tests as possible into thinking

that

1. Each random number is U (0, 1)distributed

2. The random numbers are independent of one another

3.1.3 Linear Congruential Generator

3.1.3.1 Linear Congruential Generator Algorithm

Initialize: Set X1 = S0 .Set n = 2

1. Transition:Set Xn = (aXn−1 + c)modm

Xn
2. Output :Set Un = m

3. Repeat :Set n = n + 1 .Repeat from step 2

Here a is called the multiplier ,c is called the increment and m is called the modulus.

Eventually ,such a sequence will start to repeat .The length of the sequence before

it starts repeating is called the period.


13
Figure 3.1: Linear Congruential Generator graph

3.1.4 Non-uniform Random variable generation

The basic ingredient in all Monte Carlo simulation is a stream of iid U (0, 1)random

numbers. We need to transform this in to interesting random objects. The first

such object we will consider are random variables with non-uniform distribution .

Two generic methods exist for generating random variables. The inverse transform

and the acceptance-rejection method, but here I used only the transform method

to generate non-uniform random variables.

14
3.2 Descrete probability distribution

If x is a discrete random variable that can assume values x1 ,x2 ,x3 ,. . . ,xn with

respective probabilities p1 ,p2 ,p3 ,. . . ,pn , then the probability distribution will be

completely known if all p’s are known. These probabilities are easily computed

if we know what the “probability law” governing various of x. There are some

well-known probability laws for the value of x,these probability laws for the values

of x under different sets condition. These laws can classified into two categories,

discrete and continuous, depending upon whether the random variable is discrete

or continuous. The most basic discrete probability distribution are Binomial and

Poisson distribution.

3.2.1 The Binomial Distribution

Such distribution is useful in situation where there are only two events associated

with a phenomenon. Suppose we have a discrete random variable X with only two

outcomes, say, success(S) or failure(F ). Let the event of interest , say S, occur

with an unknown probability P . Naturally, the complementary event F occurs

with probability 1 − P .

3.2.2 Mean and variance

To provide solution to different kinds of probability questions in binomial

distribution , we should able to compute the probability at the values of X. There

15
are n + 1 possible values that X can assume, these are x = 0, 1, 2, . . . , n. The

mean and variance of the binomial distribution with probability P and a given

n,respectively ,are:

E(X) = npandvar(X) = np(1 − p) (3.2.1)

The probability of any one of the single x values is given by the point distribution

function ofX as:

n!
P (X = x) = C(n, x)P x (1 − P )n−x , whereC(n, x) = (3.2.2)
x!(n − x)

3.2.3 The Poisson Distribution.

The Poisson distribution is a natural model for the number of independent arrivals

in a period of time (among many other things). The pmf of a P oi(λ) random

variable is :
λi
P (X = i) = e−λ , i(0, 1, 3, ...) (3.2.3)
i!

3.3 The Black-Scholes equation

The very important point in solving the Black-Scholes equation is to get rid of the

terms S and S 2 from the equation:


∂V 2
∂t
+ 12 σ 2 S 2 ∂∂SV2 +rS ∂V
∂S
−rV = 0.In order to do this consider the change of variables,

τ
S = Kex , t = T − 1 2 , V = Kv(x, τ ) (3.3.1)
2
σ

16
Using the chain rule from calculus for transforming partial derivatives for function

of two variables we have:

∂V ∂V ∂x ∂V ∂τ
= + (3.3.2)
∂S ∂x ∂S ∂τ ∂S

∂V ∂V ∂x ∂V ∂τ
= + (3.3.3)
∂t ∂x ∂t ∂τ ∂t

Looking at equation(3.3.1) it can be shown that:


∂τ
∂t
= − 21 σ 2
∂x
∂t
=0
∂x 1
∂S
= S

∂τ
∂S
=0

Plugging this in to equation (3.3.2) and equation(3.3.3.) yields:

∂V K ∂V ∂V 1 ∂ 2V K ∂v 2 K ∂V
= , = − σ2K , 2
= 2 2
− 2 (3.3.4)
∂S S ∂x ∂t 2 ∂S S ∂x S ∂x

Substituting equation (3.3.4) in to Black-Scholes partial differential equation gives

the partial equation:

∂V ∂ 2v ∂V r
= 2
+ (k − 1) − kv , where k = 1 2 (3.3.5)
∂τ ∂x ∂x 2
σ

The initial condition C(S, T ) = max(S − K, 0) is transformed into v(x, 0) =

max(x, τ )

Now we apply another change of variable and let v = eαx+βτ u(x, τ ) ,then by simple

differentiation we have:

∂v ∂u
= βeαx+βτ u + eαx+βτ (3.3.6)
∂τ ∂τ

17
∂v ∂u
= αeαx+βτ u + eαx+βτ (3.3.7)
∂x ∂x
∂ 2v αx+βτ αx+βτ ∂u αx+βτ ∂u αx+βτ ∂u
2
αx+βτ ∂ u
= α(αe u + e + e ) + αe + e (3.3.8)
∂x2 ∂x ∂x ∂x ∂x2

Substituting this equation in to equation(3.3.5) yields:

∂u ∂u ∂ 2 u ∂u
βu + = α2 u + 2α + 2 + (k − 1)(αu + ) − ku (3.3.9)
∂τ ∂x ∂x ∂x

∂u
we can get rid the u and ∂x
by carefully choosing values of α and β such that

β = α2 + (k − 1)α − k and 2α + k − 1 = 0 we can rearrange these equations so

they can be written :

α = − 12 (k − 1) , β = − 21 (k + 1)2

We now have the transformation from v to u is:


1 1 2
v = e− 2 (k−1)x− 4 (k+1) τ u(x, τ )

resulting in the simple diffusion equation:

du d2 u
= 2 f or − ∞<x<∞ , τ >0 (3.3.10)
dτ dx

Our initial condition is now been changed as well to:

1 1
u0 (x) = u(x, 0) = max(e− 2 (k+1)x − e− 2 (k−1)x , 0) (3.3.11)

The solution to the simple diffusion equation obtained above is well-known to be:

Z ∞
1 (x−s)2
u(x, τ ) = √ u0 (s)e− 2τ ds (3.3.12)
2π −∞

18
In order to solve this integral it is very convenient to make a change of variables:
s−x
y= √

so that :
R∞ √ y2
u(x, τ ) = √12π −∞ u0 (y 2τ + x)e− 2 dy

substituting our initial condition into this equation results in:


R∞ 1 (k+1)(y√2τ +x) − y2 R∞ 1 (k−1)(y√2τ +x) − y2
u(x, τ ) = √12π e2 e 2 dy − √12π e2 e 2 dy.
− √x − √x
2τ 2τ
In order to solve this we will solve each integral separately.The first integral can

be solved by completing the square in the exponent.The exponent of the integral

is:

− 21 y 2 + 21 (k + 1)(x + y 2τ )

factoring out the − 21 gives us:



− 12 (y 2 − [k + 1]y 2τ − [k + 1]x) separating out the term that is not a function of

y ,and adding and subtracting terms to setup a perfect square yields:


1 1 2
√ √
[k+1] 2τ 2

[k+1] 2τ 2
2
(k + 1)x − 2
(y − [k + 1]y 2τ + ( 2
) − ( 2
))

simplifying this expression yields:



1 [k+1] 2τ 2 (k+1)2 τ
2
(k + 1)x − 12 (y − 2
) + 2

Thus the first integral reduces to:


1 (k+1)x R √
∞ 1 2 1 1 2
I1 = e 2√2π − √x e 4 (k+1) e− 2 (y− 2 [k+1] 2τ ) dy

now substituting:

z = (y − 21 [k + 1] 2τ )

results in:
1
e 2 (k+1)x + 14 (k+1)2 τ R∞ 1 2
I1 = √


− √x − 12 (k+1) 2τ
e− 2 z dz

1
e 2 (k+1)x + 14 (k+1)2 τ √
I1 = √ N (d1 ) ,where d1 = √x + 12 (k + 1) 2τ and N (x) =
2π 2τ
Rx 1 2
√ 1
2π −∞
e− 2 y dy.

is the cumulative distribution function for the normal distribution.

The calculation of the second integral I2 is identical to that of I1 except that (k−1)

19
replaces (k + 1) throughout.Finally, we work way backwards with:
1 1 2
v(x, τ ) = e− 2 (k−1)x− 4 (k+1) τ u(x, τ ).

and then substituting the inverse transformation:


S
x = log( K ) τ = 21 σ 2 (T − t)

C = Kv(x, τ )

We finally obtain the desired result :

C(S, t) = SN (d1 ) − Ke−r(T −t) N (d2 )


S
log( K )+(r+ 21 σ 2 )(T −t) S
log( K )+(r− 21 σ 2 )(T −t)
where d1 = √
σ T −t
and d2 = √
σ T −t

3.4 The Monte Carlo Method

Monte Carlo simulation provides a simple and flexible method for valuing financial

instrument whose analytical solution are impossible to get .It is especially useful

because it can deal with one or more random factors such as random process of

underlying asset price, stochastic volatility or random process of interest rate.

Also, with Monte Carlo Simulation one can consider realistic and complicated

market condition is relatively easy way. However, Monte Carlo Simulation has

critical flaw. It is computationally much inefficient in its basic form. So,

most of the techniques in Monte Carlo simulation are developed to improve this

inefficiency. In finance the Monte Carlo simulation is particularly useful because

of its ability integral. Considering the integral :

Z
f (x)g(x)dx = α (3.4.1)
A

20
where f (x) is an arbitrary function and g(x) is a probability function with
R
A
g(x)dx = 1.

If it is possible to sample values Xi from the density function g(x) by evaluating

the function f (x) at of this random points and averaging them it is possible to

produce the Monte Carlo estimate :

n
1X
ᾱ = f (xi ) (3.4.2)
n i=1

The standard deviation of the estimate is:


v
u n
u 1 X
sf = t (f (xi ) − αn )2 (3.4.3)
n − 1 i=1

3.5 Finite Difference Method

Finite difference Method value a derivative security by solving the differential

equation which are solved recursively. Consider an option price f that depends on

a single stochastic variable S which follow the specific stochastic process :

dS = µ ∗ Sdt + σ ∗ Sdz (3.5.1)

The differential equation that the option must satisfy is well-known Black and

Scholes(1973) differential equation :

∂f ∂f 1 ∂ 2f
+ rS + σ 2 S 2 2 = rf (3.5.2)
∂t ∂t 2 ∂S

21
.

To implement the explicit finite difference method we first define a small

time change and small change in stock price as ∆t and ∆S respectively.

Then a grid is constructed to estimate the value of f when the stock

price is 0,∆S,2∆S,...,∆Smax (M + 1 steps in total) and the time is equal to

0,∆t,2∆t,...,∆T (N + 1 steps in total).In the dimension the expiration date T

determines the maximum time allowed. In the stock price state ,limited liability

defines the lower absolute value as 0 and Smax is the upper bound generally defined

by derivative condition. The point (i, j) in the grid refers to time i∆t and stock

price j∆S or simply Sj . fij is the option price at the point (i, j). The partial

derivative of f at node (i − 1, j) can be approximated as follow:

∂f fi,j+1 − fi,j−1
= (3.5.3)
∂s 2∆s

∂ 2S fi,j+1 + fi,j−1 − 2fi,j


= (3.5.4)
∂S 2 ∆S 2
∂f fi,j − fi−1,j
= (3.5.5)
∂t ∆t

substituting equations (3.4.3),(3.4.4) and (3.4.5) into equation(3.4.2) gives:

fi−1,j = aj−1 fi,j−1 + aj+1 fi,j+1 (3.5.6)

where
1 rSj ∆t 1 Sj2 ∆t
aj−1 = ( + ) (3.5.7)
1 + r∆t 2∆S 2 ∆S 2
1 Sj2 ∆t
aj = (1 − ) (3.5.8)
1 + r∆t ∆S 2
1 rSj ∆t 1 Sj2 σ 2 ∆t
aj+1 = ( + ), (3.5.9)
1 + r∆t 2∆S 2 ∆S 2
22
Equation (3.4.6) is the core of explicit Finite difference method.It relates the

derivative price at ti−1 to three possible values of it at ti . The option value is

known with certainty at expiration time T. The price at time t can obtained by

using equation (3.4.6) recursively to work back ward from time T to time t. The

explicit Finite Difference method has several features in common with a trinomial

lattice.

For a call option the payoff at maturity is equal to [ST − K, 0]+ . Therefore:

fN,j = [Sj − K, 0]+ ,j = 0, . . . , M when the stock price is zero the call value is

zero ,hence f( i, 0) = 0, i = 0, . . . , N . On the other hand assuming that Sm ax has

been chosen to be high enough to have the option deep in the money we have

fi,M = [SM − K]+ ,i = 0, . . . , N .The three conditions defines the values of options

in the three border of the grid where S = 0

Stock price Barrier Strike No.of step FMD Exact Value Error
80 50 100 764 2.92058 2.91988 0.024
80 50 100 1570 2.92192 2.91988 0.070
80 50 100 2269 2.92168 2.91988 0.062
80 60 100 907 2.91925 2.91484 0.152
80 60 100 1906 2.91669 2.91484 0.064
80 60 100 2776 2.91571 2.91484 0.030
80 70 100 1052 2.66255 2.66087 0.063
80 70 100 2367 2.66191 2.66087 0.039
80 70 100 3408 2.91571 2.66087 0.027
100 70 100 1327 11.70378 11.70273 0.009
100 70 100 2726 11.70404 11.70273 0.011
100 70 100 3986 11.70336 11.70273 0.005

Table 3.1: table showing result of Finite Difference Method and Analytical
solution for the values(risk − f ree rate = 0.05 ,σ = 0.2 ,T ime T = 1)

23
3.6 Analytical Solution

To get the closed form solution, we have to solve heat equation reduced from

Black Scholes partial differential equation. The only thing different for the barrier

option is, as mentioned above, that the heat equation has a boundary (barrier

level) condition at which the value of solution function is usually equal to zero.

For some specific case, it can be solved using the solution without the boundary

condition. We have already seen the case of ‘knock-out’ option with barrier level

below the strike price(Paul Wilmot,the Mathematics of financial derivatives,1997).

S 2r B2
V (S, t, B) = C(S, t) − [( )− ( 2 ) ∗ C( , t)], whereB<K (3.6.1)
B σ S

In formula (3.5.1) above , C(S, t) represents the value function of vanilla option

whose strike is K.

The very complicated looking formula following is the closed form solution for

more general cases.

V (S, t, B)B>K = Se−q(T −t) (N (d1 )−b(1−N (d8 )))−Ke−q(T −t) (N (d2 )−b(1−N (d7 )))

(3.6.2)

where
S 2
ln( K ) + (r − q + σ2 )(T − t)
d1 = √ (3.6.3)
σ T −t
S 2
ln( K ) + (r − q − σ2 )(T − t)
d2 = √ (3.6.4)
σ T −t
2
ln( BS ) + (r − q − σ2 )(T − t)
d3 = √ (3.6.5)
σ T −t
24
2
ln( BS ) + (r − q + σ2 )(T − t)
d4 = √ (3.6.6)
σ T −t
2
ln( BS ) − (r − q + σ2 )(T − t)
d5 = √ (3.6.7)
σ T −t
2
ln( BS ) − (r − q − σ2 )(T − t)
d6 = √ (3.6.8)
σ T −t
2
ln( SK
B2
) − (r − q − σ2 )(T − t)
d7 = √ (3.6.9)
σ T −t
2
ln( SK
B2
) − (r − q + σ2 )(T − t)
d8 = √ (3.6.10)
σ T −t

Consider pricing of a down and out put option by applying the above algorithm

and compare the difference between the exact and the approximated values using

the underlying stock price So = 100, the risk free rate r = 0.015, time to maturity

T = 1, lower barrier B = 80, Strike price K = 110,volatility σ = 0.3 and number

of simulations is M = 1000000.

No.of iteration(M) No.of steps(N) Monte Carlo Solution Exact solution(V) Error
1000000 50 3.0021 2.3981 0.6039
1000000 100 2.8848 2.3981 0.4867
1000000 200 2.7502 2.3981 0.3521

Table 3.2: Table showing error of the results of Monte Carlo Simulation and
Exact value of So = 100, the risk free rate r = 0.015, time to maturity T = 1,
lower barrier B = 80, Strike price K = 110,volatility σ = 0.3 and number of
simulations is M = 1000000.

25
Figure 3.2: Option price versus stock price

3.7 Normally and Log-normally


Distributed variables

Definition 1. A random variable X with distribution function


Z x
1 −(t−µ)2
F (X) = P (X ≤ x) = √ e 2σ2 dt (3.7.1)
−∞ σ 2π

is said to have a normal distribution with E(X) = µ and V (X) = σ [Walter A.


Rosenkrantz,2003].

Definition 2. A random variable X is log-normally distributed if some normally


distributed variable Y ,X = eY that is lnX is normally distributed.(Mark
Gockenbatch,2002)

26
3.8 Modeling asset price

For the price to be found it should be modeled first. Efficient market hypothesis

(EMH)considers that asset price follow stochastic process. It basically say that

current price fully reflects past history, also it states that market responds

immediately to any new information about the asset. Because of these assumption,

asset price is said to have Markov properties i.e the probability distribution of the

price at any particular future is not dependent on particular path followed by the

price in the past. Furthermore, it usual to represent change in asset price using

return dS/S rather than the absolute change. All of this brings us to most common

model, geometric Brownian motion model for asset price movement.

dS
= µdt + σdX (3.8.1)
S

The parameterµis the expected rate of return on the asset and along with dt it

represents deterministic part of return ,also called drift. It depends on the riskiness

of the asset, as well as on level on interest rates in economy. The variable σ is

the volatility (σ 2 isvariance) , and it is the measure of uncertainty about returns

provided by the asset, dX contains the information about the randomness of the

asset price, dX is random variable which follows normal distribution, with mean

zero and variance dt, therefore dX can be written dX = ϕ dt . here ϕ is random

variable with standardized normal distribution. Its probability density function is

given by:
1 1 2
f (ϕ) = √ e 2 ϕ dϕ f or − ∞ < ϕ < ∞ (3.8.2)

27
with the definition of expectation operator ε given by:

Z ∞
1 1 2
ε[F (.)] = √ F (ϕ)e 2 ϕ dϕ (3.8.3)
2π −∞

For any function F ,we have :ε[ϕ] = 0, ε[ϕ2 ] = 1 [Wilmott].

If there is no uncertainty about the price (st.dev. = 0) we have :

dS
= µdt (3.8.4)
S

Integrating equation(3.6.1) between time0 and T we get:

ST = S0 e−µT (3.8.5)

3.9 Price process of underlying asset

In order to have a complete option pricing model ,we need to make additional

assumption about:

1. Price process of underlying asset(stock)

2. Other factors.

We will assume, in particular, that:

• Prices do not allow arbitrage.

• Prices are ”reasonable”

• A benchmark model-Prices follows a binomial process

28
3.9.1 One-period Binomial Model

For example:

Valuation of European call option on a stock Current stock price S0 = 50, there

is one period to go, stock price will go up to 75 or go down to 25,There are no

cash dividend, The strike price ,X = 50, one period borrowing and lending rate

is 0.1. The stock and bond present two investment opportunities : Sup = 75 and

Sdown = 25 bondup = bonddown = 1.1 The options payoff at expiration (C0 ) is

Cup = 25 and Cdown = 0

Consider a portfolio (a, b) where:

• a is the number of shares of the stock held

• b is the dollar amount invested in the risk less bond

We want to find (a, b) so that

75a + 1.1b = 25 (1)

25a + 1.1b = 0 (2)

Solving for a and b we get a = 0.5 and b = −11.36 that is :

• Buy half a share of a stock and sell 11.36 worth of bond .

• Payoff of this portfolio is identical to that of the call.

• Present value of the call must equal the current cost of this replicating

portfolio , which is: (50)(0.5) − 11.36 = 13.64

29
3.9.2 Two- period Binomial Model

Now we generalize the above example when there are two periods to go: period

1 and period 2: the stock price process is : Su = 75, Sd = 25, Suu = 112.5, Sud =

37.5, Sdu = 37.5, Sdd = 12.5

The call price follows the following process: Cu = 25, Cd = 0, Cuu = 62.5, Cud =

0, Cdu = 0, Cdd = 0 We drive current value of the call by working backward: first

compute its value next period, and then its current value.

step 1:start with period 1:

1.Suppose the stock price goes up to 75 in period 1:

• Construct the replicating portfolio a node (t = 1,up)

112.5a + 1.1b = 62.5

37.5a + 1.1b = 0

Solving for a and b ,we get a = 0.833 and b = −28.4 The cost of the portfolio is :

(75)(.833) − 28.4 = 34.075.. The exercise value of the option is :

75 − 50 = 25 < 34.075. Thus , Cu = 34.075

2.Suppose the stock price goes down to 25 in period 1. The replicating portfolio

is : a = 0 and b = 0 ⇒ Cd = 0. Since Cu = 34.075 and Cd = 0, we have:

75a + 1.1b = 34.075

25a + 1.1b = 0

Solving for a and b ,we get a = 0.6815 and b = −15.48

30
The cost of the portfolio is :(0.6815)(50) − 15.48 = 18.59. The present value of the

option must be C0 = 18.59.

When we summarize the above replicating strategy :

• In period 0:it tells us spend 18.59 and borrow 15.48 at 10

• In period 1:

(a) When the stock price goes up ,the portfolio value 34.075.Re-balance the

portfolio to include 0.833 stock shares, financed by borrowing 28.4 at 0.1

. (b)When the stock price goes down , the portfolio becomes worthless

3.10 Derivatives and option in finance

Derivatives are a contract that depends in some way on the price of one or more

underlying asset. For example, a forward contract is derivative when one party

promises to pay the other specified amount for underlying asset at some specific

time. An option is a derivative where the two parties have certain rights which

they are not obliged to enforce.

Definition 3. A call option is a contract between two parties in which the holder
of the option has the right (not the obligation) to buy an asset at a certain time
in the future for a specific price ,called the strike price.( James E. Gentle,2005)

Definition 4. A put option is a contract between two parties in which the holder
of the option has the right (not the obligation) to sell an asset at a certain time
in the future for a specific price ,called the strike price.( James E. Gentle,2005)

31
3.11 Pricing Options

There are several factors which contribute value to an option contract and thereby

influence the premium or price at which it is traded. The most important of

these factors are the price of underlying stock, time remaining until expiration,

the volatility of the underlying stock price, cash dividends, and interest rates.

Consider a simulating call option on stock whose current value is S0 = 1dollar and

the option expires in j days and the strike price K = 1dollar .We assume constant

spot(annual) interest rate r and the stock price follows a lognormal distribution

with annualvolatilityσ..

Figure 3.3: Graph of stock price versus time in year

MATLAB code for the above graph

function z=plotlog(r,sigms,T,K);

T=j/N; s=sigma/sqrt(N); mn = r/N − s2 /2;

y=exp(cumsum(normrnd(mn,s,j,1))); y=[1 y’]; x=(0:j)/N;

plot(x,y,’-’,x,K*ones(1,j+1),’y’); xlable(’time(in year)’) ylable(’value of stock’);

z=exp(-r*T)*max(y(j+1)-K,0);
32
3.11.1 Underlying stock price

The value of an option depends heavily upon the price of its underlying stock. If

the price of the stock is above a call option’s strike price the call option is said to

be in-the-money. Likewise, if the stock price is below the put option’s strike price

the put option is in-the-money. The difference an in-the-money option’s strike

price and the current market price of a share of its underlying security is referred

to as the option’s intrinsic value.

3.11.2 Time remaining expiration

Generally, the longer the time until an option’s expiration date ,the higher the

option premium because there is a greater possibility that the underlying share

price might move so as to make the option in-the-money. Time value drops rapidly

in the last several weeks of an option’s life.

3.11.3 Volatility

Volatility is the propensity of the underlying security’s market price to fluctuate

either up or down. Therefore, volatility of the underlying share price influences the

option premium. The higher the volatility of the stock, the higher the premium

because there is, again,a greater possibility that the option will move in-the-money.

33
3.11.4 Dividends

Regular cash dividends are paid to the stock owner. Therefore ,cash dividends

affect option premiums through their effect on the underlying share price .

Because, the stock price is expected to fall by the amount of the cash dividend,

higher cash dividends tend to imply lower call premium and higher put premiums.

3.11.5 Interest Rates

Historically, higher interest rates have tended to result in higher call premiums

and lower put premiums.

3.12 Pricing European option

The value of European option can be found by solving the equation of the

Black-Scholes.However the equation only has unique solution if the boundary

condition are defined.In this case,we know that the value of the option ,V (S, t)at

maturity,T (the date where it is dedicated whether the option is exercised or not

)and when the asset value is zero or is so big that it can be considered infinite.

3.12.1 Solution for European call

In order to solve the Black-Scholes equation we need to consider final and

boundary conditions,of else the partial differential equation does not have unique

34
solution.Consider the European call,C(S, t) with exercise price K and expiry date

T.The final condition at time t = T can be derived from the definition of the call

option.If at expiration S>K the call option will be worth S − K because the buyer

of the option can buy the stock for K and immediately sell it for S.If at expiration

S<K the option will not be exercised and it will expire worthless.At t = T the

value of the option is known for certain to be the payoff :

C(S, T ) = max(S − K, 0) (3.12.1)

This is the final condition for our differential equation.

In order to find boundary condition we consider the value of C when S = 0 and

as S → ∞.If S = 0 then it is easy to see from equation dS/S = µdt + σdB

that dS = 0 and therefore ,S will never change.If at expiry S = 0 ,from equation

(3.11.1)the payoff must be 0.Consequently ,when S = 0 we have:

C(0, T ) = 0 (3.12.2)

Now when S → ∞ it becomes more and more likely the option will be exercised

and the payoff will be S − K.The exercise price becomes less and less important

as S → ∞,so the value the option is equivalent to :

C(S, T ) u S as S → ∞ (3.12.3)

35
3.12.2 Boundary condition for European options

Call Option

V (S, T ) = max(S − K, 0)

V (0, t) = 0

lim V (S, t) = S
S→∞

Put Option

V (S, T ) = max(K − S, 0)

V (0, t) = Ke−r(T −t)

lim V (S, t) = 0
S→∞

3.13 Brownian and Geometric


Brownian Stochastic Process

Definition 5. A stochastic process ,Wt , for t > 0 is Brownian motion if W0 = 0


and for all t and s with s < t , Wt − Ws is continuous, has a normal distribution
with variance t-s ,and the distribution of Wt − Ws is independent of the behavior
Wr for r ≤ s [Klebaner,1998 ]

Definition 6. A stochastic process ,St is said to follow a Geometric Brownian


Motion if it satisfies the Stochastic Differential equation

dSt = µSt dt + σdWt (3.13.1)

with µ and σ constant and Wt Brownian motion.

36
3.14 Generating Stock Paths

Assume that the asset price follows a geometric Brownian motion with a constant

volatility and interest rate. Brownian motion process can be used if we assume

that the market is dominated by the normal events. This process can be written

as the following stochastic differential equation for the asset return.

dS = St µdt + St σdWt (3.14.1)

Where St is stock price at time t , µ is rate of return of the underlying stock

price, σ is constant volatility , Wt is Wiener process. Let us assume that the asset

returns follow a log normal distribution, that is ,G(t) = ln(St). Applying Ito’s

lemma we get:

dG dG 1 d2 dG dG 1 d2 −1
dG(t) = dSt + dt + dS 2 , where = 0, = , 2 = 2
St dt 2 dSt2 t dt St St dSt St
(3.14.2)
1 1 (−1) 2 2
d ln(St ) = (St rdt + St σdWt ) + 0 + S σ dt (3.14.3)
St 2 St2 t
1
d ln(St ) = (r − σ 2 )dt + σdWt (3.14.4)
2

Integrating both sides of equation(3.11.4) we get:

ln(St ) − ln(S0 ) = (r − 21 σ 2 )t + σWt

1 2 )t+σW
⇒ St = S0 er− 2 σ t
(3.14.5)

37
In order to generate stock path we, discretize (3.11.5) as follow:

1 2 )∆t+σ

St+1 = St e(r− 2 σ ∆tZt
(3.14.6)

where ∆t is the time step, and Zt is the standard normal random variable with

mean 0 and variance 1.

Figure 3.4: Graphs of generated stock prices generated using different number
of iterations

3.15 Simulating Barrier Option

A barrier option is similar to a vanilla put or call option, but its life either begins

or ends when the price of the underlying stock passes a predetermined barrier

value. There are four types of barrier options.

Up Knock-In :This option becomes effective when the price of the underlying

stock passes above a barrier that is above the initial stock price. Once the barrier

has knocked in, it will not knock out even if the price of the underlying instrument

moves below the barrier again.

Up Knock-Out :This option terminates when the price of the underlying stock

passes above a barrier that is above the initial stock price. Once the barrier has

knocked out, it will not knock in even if the price of the underlying instrument
38
moves below the barrier again.

Down Knock-In :This option becomes effective when the price of the underlying

stock passes below a barrier that is below the initial stock price. Once the barrier

has knocked in, it will not knock out even if the price of the underlying instrument

moves above the barrier again.

Down Knock-Out :This option terminates when the price of the underlying

stock passes below a barrier that is below the initial stock price. Once the barrier

has knocked out, it will not knock in even if the price of the underlying instrument

moves above the barrier again.

3.16 Antithetic Sampling

Simulation methods allow you to specify a popular variance reduction technique

called antithetic sampling. This technique attempts to replace one sequence

of random observations with another of the same expected value, but smaller

variance. In a typical Monte Carlo simulation, each sample path is independent

and represents an independent trial. However, antithetic sampling generates

sample paths in pairs. The first path of the pair is referred to as the primary

path, and the second as the antithetic path. Any given pair is independent of any

other pair, but the two paths within each pair are highly correlated. Antithetic

sampling literature often recommends averaging the discounted payoffs of each

pair, effectively halving the number of Monte Carlo trials. This technique attempts

to reduce variance by inducing negative dependence between paired input samples,

ideally resulting in negative dependence between paired output samples. The

39
greater the extent of negative dependence, the more effective antithetic sampling

is. The example below applies antithetic sampling to a path-dependent barrier

option. Consider a European up-and-in call option on a single underlying stock.

The evolution of this stock’s price is governed by a Geometric Brownian Motion

(GBM) model with constant parameters:

Figure 3.5: Graphs of Basic MC and Antithetic sampling of stock price

3.17 Results of Monte Carlo simulation

The following tables shows result of Monte Carlo simulation by taking three

different stock price values namely :80,100 and 120 with strike price K=100.

parameters

40
Stock price Barrier Strike No.of step MCS Exact Value Error
40 30 50 10,000 1.67263 1.71179 0.60593
40 30 50 20,000 1.61767 1.71179 0.30232
40 30 50 40,000 1.76289 1.71179 0.14037
40 30 50 100,000 1.7496 1.71179 0.14037
50 30 45 10,000 4.6346 4.11716 0.32330
50 30 45 20,000 4.24609 4.11716 0.1946
50 30 45 40,000 4.3014 4.11716 0.13862
50 30 45 50,000 4.2097 4.11716 0.08883
80 50 100 10,000 2.89206 2.91988 0.953
80 50 100 20,000 2.96751 2.91988 1.631
80 50 100 40,000 2.95696 2.91988 1.270
80 60 100 10,000 2.88766 2.91484 1.619
80 60 100 20,000 2.88803 2.91484 0.920
80 60 100 40,000 2.91986 2.91484 0.172
80 70 100 10,000 2.71119 2.66087 0.1.891
80 70 100 20,000 2.67315 2.66087 0.461
80 70 100 40,000 2.69583 2.66087 1.314
100 70 100 10,000 11.77419 11.70237 0.617
100 70 100 20,000 11.64066 11.70237 0.530
100 70 100 40,000 11.74976 11.70237 0.401
100 80 100 10,000 11.28537 11.32229 0.327
100 80 100 20,000 11.32218 11.32229 0.087
100 80 100 40,000 11.40166 11.32229 0.701

Table 3.3: Results of Monte Carlo simulation for risk − f reerater = 0.05
,dividendyield, q = 1 ,volatilityσ = 0.2 ,T = 1year

41
CHAPTER 4

Conclusion And Recommendation

4.1 conclusion

Monte Carlo simulation is, in essence, the generation of random


objects or processes by means of a computer. These objects
could arise “naturally” as part of the modeling of a real-life
(specifically the evolution of the stock market in this thesis).
Monte Carlo Method simply involves random sampling from certain
probability distributions. In either the natural or artificial setting
of Monte Carlo techniques the idea is to repeat the experiment
many times (or use a sufficiently long simulation run) to obtain
many quantities of interests. The inherent randomness of the
Monte Carlo Method is not only essential for the simulation of
real-life random systems, it is also of great benefit for deterministic
numerical computation. As financial products continue to grow in

42
complexity, surely Monte Carlo techniques will be very important
tools for analyzing them. The Monte Carlo Method is not only
used to price financial instruments, but also plays a critical role in
risk analysis. Monte Carlo techniques is a very useful instrument
in financial option pricing . These technique (the Monte Carlo
technique) particularly effective in solving problems involving a
number of different sources of uncertainty (for example, pricing
options, which are based on a portfolio of stocks).Recently, there
have been some significant advances in Monte Carlo techniques for
stochastic differential equations, which are used to model many
financial time series. The Monte Carlo Method has also proved
particularly useful in the analysis of the risk of large portfolios of
financial products . A great strength of Monte Carlo techniques for
risk analysis is that they can be easily used to run scenario analysis —
that is, they can be used to compute risk outcomes under a number of
different model assumptions. Generally when we compare analytical
simulation method and Monte Carlo simulation method, analytical
simulation method was gives exact results (given assumptions of the
model), once model is developed, output would generally rapidly
obtained and Monte Carlo simulation method was very flexible, there
is virtually no limit to the analysis, empirical distributions can be
handled as required, easily understood by non mathematicians.

43
4.2 Recommendation

On the above sections of this paper,I tried to discuss how to


valuate barrier options under European options applying Monte
Carlo Simulation.Here I was focused on the process in which there
is only a single process with only one barrier option.As researcher,
I would like to recommend for the future researcher to conduct a
research on valuing derivatives with double barrier in a single process
applying Monte Carlo simulation.

44
Appendices

45
Appendix A
MATLAB code for Linear Congruential Generators Algorithm
N = 100; a = 6; m = 11; c = 0;
S0 = 1; //X = zeros(N, 1); U = zeros(N, 1);
X(1) = S0 ; U (1) = X(1)/m
f ori = 2 : N//X(i) = mod(a ∗ X(i − 1) + c, m);
U (i) = X(i)/m;
End

Appendix B
MATLAB code for Analytical solution
k is Strike P rice
B is BarrierP rice
r is Risk F ree Interest Rate
sigma is V olatility
T is T ime to maturity
So is Initial stock prices
d1 = (log(So./k) + (r + 1/2 ∗ sigma2 ) ∗ (T ))/(sigma ∗ sqrt(T ));
d2 = (log(So./k) + (r − 1/2 ∗ sigma2 ) ∗ T )/(sigma ∗ sqrt(T ));
d3 = (log(So/B) + (r + 1/2 ∗ sigma2 ) ∗ T )/(sigma ∗ sqrt(T ));
d4 = (log(So/B) + (r − 1/2 ∗ sigma2 ) ∗ T )/(sigma ∗ sqrt(T ));
d5 = (log(So/B) − (r − 1/2 ∗ sigma2 ) ∗ T )/(sigma ∗ sqrt(T ));
d6 = (log(So/B) − (r + 1/2 ∗ sigma2 ) ∗ T )/(sigma ∗ sqrt(T ));
d7 = (log((So. ∗ k)./B 2 ) − (r − 1/2 ∗ sigma2 ) ∗ T )/(sigma ∗ sqrt(T ));
d8 = (log((So. ∗ k)./B 2 ) − (r + 1/2 ∗ sigma2 ) ∗ T )/(sigma ∗ sqrt(T ));
46
Exact f ormula uses to compute down and out European P ut option.
V = k∗exp(−r∗T )∗(normcdf (d4)−normcdf (d2)−(B./So).( −1+(2∗
r/sigma2 )).∗...(normcdf (d7)−normcdf (d5)))−(So.∗(normcdf (d3)−
normcdf (d1) − ...(B./So).( 1 + (2 ∗ r/sigma2 )). ∗ (normcdf (d8) −
normcdf (d6))));
plot(So, V,0 − − rs0 );
title(0 OptionP riceV sStockP rice0 )
legend(0 So0 ,0 V 0 )
xlabel(0 StockP rice0 )
ylabel(0 OptionP rice0 )
Appendix C
MATLAB code for Antithetic Sampling
Z = randn(1, N ); normally distributed random number
i=1:N
ST (i) = s ∗ exp((r − sigma2 /2) ∗ T + sigma ∗ sqrt(T ) ∗ Z);
ST a(i) = s ∗ exp((r − sigma2 /2) ∗ T − sigma ∗ sqrt(T ) ∗ Z);
V T = max(0, ST (i) − K);
V T a = max(0, ST a(i) − K);
imputs
N = 50; number of periods
K = 50; strike price
s = 60; initial stock price
sigma = 0.4; volatility
r = 0.01; riskless interest rate

47
dt = T./i; time in year
T = 1 duration
A = (exp(−r ∗T )∗V T ) Basic method of M onte Carlo Simulation
B = (exp(−r∗T )∗(V T +V T a)/2); Antithetic method of M onte Carlo
C = blsprice(s, T, K, r, sigma); exact value
plot(dt, ST, dt, ST a);
legend(0 BasicM Cmethod0 ,0 Antithetic method0 )
Appendix D
MATLAB code for Monte Carlo Simulation Result
f unctionM onteCarlo = M CS(K, S0, r, sigma, n, T )
imputs
n = number of path
m = number of steps
S0 = initial stock price
K = strike price
r = risk f ree interest ratesigma = volatile
T = expiry time
dt = T /m change in time
Z = randn(m, 1); random number generation
V = exact value
sum = 0;
f ori = 1 : n
S = S0
f orj = 1 : m

48
S = S. ∗ exp((r − 0.5 ∗ sigma2 ) ∗ dt + sigma ∗ sqrt(dt). ∗ Z(j))
sum = sum + exp(−r ∗ T ) ∗ max(S − K, 0);
call = max(S − K, 0);
sum = cumsum(call)
mcall = mean(call)
sum = exp(−r ∗ T ) ∗ sum
V = sum(end)/n;
end;
end
end
Appendix E
Matlab code to calculate option price using Finite Difference
method
f unction : V alue = F DM (K, S0 , r, q, T, σ, Sm in, Sm ax, M, N )
Imputs
K − strike price
S0 − inial stock price
r − risk f ree interest rate
T − the time of the option to expiry
σ − the volatility of the stock
Smin − M inimum value value of the stock considered
Smax − M aximum value value of the stock considered
M − the number of intervals of stock price considered
N − the number of intervals of time considered

49
dt = T /N
dS = (Smax − Smin )/M
Store boundary condition
f or j = 1 : M + 1
D(j, 1) = max(Smin + (j − 1) ∗ dS − K, 0)
end
else
Calculating Coef f icients
f or j = 1 : M + 1
D(j, 1) = max(K − Smin − (j − 1) ∗ dS − K, 0)
end
end
f or j = 1 : M + 1
A(j, 1) = 1/(1 + r ∗ dt)) ∗ (−0.5 ∗ (r − q) ∗ (j − 1) ∗ dt + 0.5 ∗ (σ 2 ) ∗
((j − 1)2 ) ∗ dt)
B(j, 1) = (1/(1 + r ∗ dt)) ∗ (1 − (σ 2 ) ∗ ((j − 1)2 ) ∗ dt)
C(j, 1) = 1/(1+r∗dt))∗(0.5∗(r−q)∗(j−1)∗dt+0.5∗(σ 2 )∗((j−1)2 )∗dt)
end
Shif tD = circshif t(D, [−11]);
Shif tD2 = circshif t(D, [11]);
Shif tD(M + 1, 1) = 0
Shif tD2 (1, 1) = 0
F (1 : M + 1, 1) = A(1 : M + 1, 1). ∗ Shif tD2 (1 : M + 1, 1) + B(1 :
M + 1, 1). ∗ D(1 : M + 1, 1) + C(1 : M + 1, 1). ∗ Shif tD(1 : M + 1, 1);

50
if F (1, 1) = 0;
F (M + 1, 1) = max(Smax − K, 0);
else
F (1, 1) = K ∗ exp(−r ∗ dt);
F (M + 1, 1) = 0;
end
f = zeros(M + 1, N );
f (1 : M + 1, N ) = F (1 : M + 1, 1);
f or i = 0 : N − 2;
D(1 : M + 1, 1)f (1 : M + 1, N − i);
Shif tD = circshif t(D, [−11]);
Shif tD2 = circshif t(D, [11]);
Shif tD(M + 1, 1) = 0
Shif tD2 (1, 1) = 0
F (1 : M + 1, 1) = A(1 : M + 1, 1). ∗ Shif tD2 (1 : M + 1, 1) + B(1 :
M + 1, 1). ∗ D(1 : M + 1, 1) + C(1 : M + 1, 1). ∗ Shif tD(1 : M + 1, 1);
if F (1, 1) = 0;
F (M + 1, 1) = max(Smax − K, 0);
else
F (1, 1) = K ∗ exp(−r ∗ dt);
F (M + 1, 1) = 0;
end
F = max(0, F );
f (1 : M + 1, N − 1 − i) = F (1 : M + 1, 1); end

51
52
References

[1] Roberto Casarin Monte Carlo method using MATLAB,2013.

[2] Masayuki,Jemes Douglas Penn,George Konidari Maths,Numerics


and programming for Mechanical engineers,2012.

[3] N.Zegreb , Monte Carlo Simulation of random variables, sequence


and process, 2009.

[4] J. S. Dagpuna Simulation and Monte Carlo with applications


in finance and MCMC, School of Mathematics University of
Edinburgh, UK,2007

[5] Kahl C.and Jackel P.,Fast Strong approximation Monte Carlo


scheme for Stochastic volatility model,2006.

[6] Granino A. Korn Advanced Dynamic-system Simulation


Model-replication Techniques and Monte Carlo Simulation
University of Arizona Tucson, Arizona,2005

[7] Don L.McLeish,Monte Carlo Simulation and Finance,2004

[8] K. Ming Leung Monte Carlo Simulation ,2004.

53
[9] D.Tavella,Quantitative Methods in derivatives pricing:An
introduction to Computational Finance,J.Wiley ,N.Y.,2002.

[10] R.SeydelTools for computational


Finance,Springer-Verlag,Berlin 2002

[11] W.Shaw,Modeling Financial Derivatives with


Mathematica,Cambridge Univ.Press,1999.

[12] R.E.Caflish, Monte Carlo and Quasi-Monte Carlo,Acta


Numerica,1998

[13] Hoffman P ,the man who loved only number: The story of Paul
Erdo and the search for Mathematical Truth. New York,1998

[14] H.Guold and J.Tobochnik ,An introduction to computer


simulation Method:Application to physical systems, Second
Edition Addis Wesley, New York, 1996.

[15] Ilya M.Sobol ,A primer for the Monte Carlo Method CRC
Press,1994.

[16] Hull J.Options,Futures,and other Derivative Securities,Prentice


Hall,1993.

[17] R.Menyi Pricing of the American option Ann.Prob.2(1992)

[18] P.Brately B.L.Fox and E.L.Schrage,A Guide to


Simulation,(Springer – Verlag,New York , 1983)

54
[19] Atkinson A.C. The computer generation of Poisson random
variables. Applied Statistics, 1979

[20] Black F.and Scholes,Pricing of Options and Corporate


Liabilities,Journal of political economy,1973

55

You might also like