Professional Documents
Culture Documents
Monte Carlo Simulation in Finance: Abdulhalim Misbaha Ahmed
Monte Carlo Simulation in Finance: Abdulhalim Misbaha Ahmed
Certificate
This is to certify that the thesis entitled “Monte Carlo Simulation in Finance”
i
ARBA MINCH UNIVERSITY
SCHOOL OF GRADUATE STUDIES
DEPARTMENT OF MATHEMATICS
APPROVAL
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
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
iv
v
Abstract
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
addition to the above tasks the result of Monte Carlo simulation is compared
Key words
*European Option
*call option
*Put option
*Barrier Option
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
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
Appendices 45
References 53
ix
CHAPTER 1
Introduction
Monte Carlo Simulation is named after the city of Monte Carlo in Monaco, which
Since the simulation process involves generating chance variables and exhibits
random behaviors, it has been called Monte Carlo Simulation. Monte Carlo
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
1
conclusions on the model outputs are drawn based on the statistical experiment.
values of the output variable Y are calculated through the performance function
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
The Monte Carlo method is based on the generation of multiple trials to determine
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
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,
tosses repeatedly direct course of the simulation .These Monte Carlo simulation
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
know in advance whether a test group will fare better under the treatment ,
Finance is one of the most rapidly changing and fastest growing area in
financial products.
Monte Carlo simulation,Finite difference method and analytical method and then
3
1.1.1.2 Specific Objectives
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
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
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.
Carlo simulation:
or statistical problem.
Cary and Chapman(1988)used the Monte Carlo method to analyze the seismic
from source to receiver were as data, and model parameters defined a horizontally
on computer, that can be analyzed analytically to the real data. A Monte Carlo
numbers(R.E. Calfish,1998)[6].
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
argues that Monte Carlo simulation share the same basic structure as controlled
experiments and reports the view among geneticists who use them that they
Carlo simulation do not form experiment, they challenge our view that simulation
are not experiments properly speaking. However Kalos and Whitloch point
out that such distinctions are not always easy to maintain. For example,
equations that can themselves be solved using Monte Carlo methods. “Indeed
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
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
any confidence that a pseudo-random generators numbers that are sufficiently close
7
to random to suit the intended use.
perform the simulation. Monte Carlo methods use sequence of random numbers
to solve problems in e.g. mathematics, physics and chemistry. The reason why
(2) A very complicated process is simulated for which there is neither analytical
A Monte Carlo method needs a reliable way of generating random numbers. While
and are generated in a deterministic and predictable way. Since many millions
numbers must be easily computed. They should also pass a number of statistical
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
Monte Carlo methods thought statistical simulation methods that utilize sequences
8
was coined by Nicholas Constantine Metropolis (1915-1999) and inspired by
by generating suitable random numbers and observing that fraction of the numbers
that obeys some property or properties. The method is useful for obtaining
common application of the Monte Carlo method is Monte Carlo integration. Monte
accuracy for the same number of function evaluations than repeated integrations
work well in a small number of dimensions, but encounter two problems when the
functions have many variables. Monte Carlo method (Monte Carlo simulation)
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
variables from their probability distribution, since some inputs to the model are
the basic model that “ behaves like” the real problem , with special consideration
runs (called trials) to learn the behavior of the simulation behavior,(3) compute
the summary (output)statistics and make inference about the real problem.
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]
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
There are different methods of generating random numbers. In this thesis the
used:
2. Finite difference method and Iteration method to solve the random variable
11
CHAPTER 3
properties:
3. The method should be very fast and not require a large amount of computer
memory
12
3.1.2 Pseudo-random numbers
generated by a computer that “act like random numbers” .such numbers are called
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
Xn
2. Output :Set Un = m
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
The basic ingredient in all Monte Carlo simulation is a stream of iid U (0, 1)random
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
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.
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 probability 1 − P .
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:
The probability of any one of the single x values is given by the point distribution
n!
P (X = x) = C(n, x)P x (1 − P )n−x , whereC(n, x) = (3.2.2)
x!(n − x)
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!
The very important point in solving the Black-Scholes equation is to get rid of the
τ
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
∂V ∂V ∂x ∂V ∂τ
= + (3.3.2)
∂S ∂x ∂S ∂τ ∂S
∂V ∂V ∂x ∂V ∂τ
= + (3.3.3)
∂t ∂x ∂t ∂τ ∂t
∂τ
∂S
=0
∂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
∂V ∂ 2v ∂V r
= 2
+ (k − 1) − kv , where k = 1 2 (3.3.5)
∂τ ∂x ∂x 2
σ
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
∂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
α = − 12 (k − 1) , β = − 21 (k + 1)2
du d2 u
= 2 f or − ∞<x<∞ , τ >0 (3.3.10)
dτ dx
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= √
2τ
so that :
R∞ √ y2
u(x, τ ) = √12π −∞ u0 (y 2τ + x)e− 2 dy
is:
√
− 21 y 2 + 21 (k + 1)(x + y 2τ )
now substituting:
√
z = (y − 21 [k + 1] 2τ )
results in:
1
e 2 (k+1)x + 14 (k+1)2 τ R∞ 1 2
I1 = √
2π
√
− √x − 12 (k+1) 2τ
e− 2 z dz
2τ
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.
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, τ ).
C = Kv(x, τ )
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
Also, with Monte Carlo Simulation one can consider realistic and complicated
market condition is relatively easy way. However, Monte Carlo Simulation has
most of the techniques in Monte Carlo simulation are developed to improve this
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.
the function f (x) at of this random points and averaging them it is possible to
n
1X
ᾱ = f (xi ) (3.4.2)
n i=1
equation which are solved recursively. Consider an option price f that depends on
The differential equation that the option must satisfy is well-known Black and
∂f ∂f 1 ∂ 2f
+ rS + σ 2 S 2 2 = rf (3.5.2)
∂t ∂t 2 ∂S
21
.
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
∂f fi,j+1 − fi,j−1
= (3.5.3)
∂s 2∆s
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
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
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
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
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
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
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
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
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
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
given by:
1 1 2
f (ϕ) = √ e 2 ϕ dϕ f or − ∞ < ϕ < ∞ (3.8.2)
2π
27
with the definition of expectation operator ε given by:
Z ∞
1 1 2
ε[F (.)] = √ F (ϕ)e 2 ϕ dϕ (3.8.3)
2π −∞
dS
= µdt (3.8.4)
S
ST = S0 e−µT (3.8.5)
In order to have a complete option pricing model ,we need to make additional
assumption about:
2. Other factors.
28
3.9.1 One-period Binomial Model
For example:
Valuation of European call option on a stock Current stock price S0 = 50, there
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
• Present value of the call must equal the current cost of this replicating
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 =
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.
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 :
2.Suppose the stock price goes down to 25 in period 1. The replicating portfolio
25a + 1.1b = 0
30
The cost of the portfolio is :(0.6815)(50) − 15.48 = 18.59. The present value of the
• In period 1:
(a) When the stock price goes up ,the portfolio value 34.075.Re-balance the
. (b)When the stock price goes down , the portfolio becomes worthless
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
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
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σ..
function z=plotlog(r,sigms,T,K);
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
price and the current market price of a share of its underlying security is referred
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
3.11.3 Volatility
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.
Historically, higher interest rates have tended to result in higher call premiums
The value of European option can be found by solving the equation of the
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.
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
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
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)
lim V (S, t) = 0
S→∞
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
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
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
Figure 3.4: Graphs of generated stock prices generated using different number
of iterations
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
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
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
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
of random observations with another of the same expected value, but smaller
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
pair, effectively halving the number of Monte Carlo trials. This technique attempts
39
greater the extent of negative dependence, the more effective antithetic sampling
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
4.1 conclusion
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
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
53
[9] D.Tavella,Quantitative Methods in derivatives pricing:An
introduction to Computational Finance,J.Wiley ,N.Y.,2002.
[13] Hoffman P ,the man who loved only number: The story of Paul
Erdo and the search for Mathematical Truth. New York,1998
[15] Ilya M.Sobol ,A primer for the Monte Carlo Method CRC
Press,1994.
54
[19] Atkinson A.C. The computer generation of Poisson random
variables. Applied Statistics, 1979
55