Hedge with an Edge An Introduction to the

Hedge with an Edge
An Introduction to the Mathematics
of Finance
Monte Carlo Methods
Riaz Ahmed & Adnan Khan
Lahore Uviersity of Management Sciences
Topics
• Simulating Bernoulli Random Variable
• Generating Random Variables
– Inverse Transform Method
– Box Muller Method
– Rejection Method
• Simulate a 1-D random Walk
– Calculate the mean
– Calculate the Variance
•
•
•
•
Simulating Brownian Motion
Geometric Brownian Motion
Arithmetic Brownian Motion
Variance Reduction Techniques
Simulating a Binomially Distributed
Random Variable
• Note sum of Bernoulli trials is a binomial
• Let X i be a Bernoulli trial with probability ‘p’
of success
•
is binomial ‘n’, ‘p’
Some Properties
• Distribution of successes in trials
• Expected Value
• Variance
Simulation of Binomial
• Generating Bernoulli
• Binomial as the sum of Bernoulli
• Monte Carlo Simulation
• Numerical vs. Exact Mean and Variance
Simulation of Binomial
hist
25
20
15
hist
10
5
0
0
1
2
3
4
5
6
7
8
9
10
Continuous Random Variables
• Inverse Transform Method
– Suppose a random variable has cdf ‘F(x)’
– Then Y=F-1(U) also had the same cdf
• Generating the exponential
• Generate the exponential, compare with
exact cdf
• Generate a r.v. with cdf
Simulating the Exponential
1400
1200
1000
800
600
400
200
0
0 0.120.240.360.48 0.6 0.720.840.961.08 1.2 1.321.441.561.68 1.8 1.922.042.162.28 2.4 2.522.642.762.88 3
Simulating Normal using Inverse
Transform
• Cannot get a closed form in terms of
elementary functions
• Excel has built in command normsinv()
• Use normsinv(rand())
Simulation of Normal
600
500
400
300
Series1
Series2
200
100
0
-100
Series3
Rejection Method
• Simulate
• To Simulate
• If
&
look @
accept, else reject
• To Simulate N(0,1) let
• If
set
Box Muller Method
• Recall the cdf for the standard normal is
• We saw one way was to invert this
• Another technique is to generate
• Then
and
where
Simulation
800
700
600
500
400
300
200
100
0
Weiner Process
• W(t) CT-CS process is a Weiner Process if W(t)
depends continuously on t and the following
hold
a)
b)
c)
are independent
Simulating Brownian Motion
• Initialize at 0 as W(0)=0
• Simulate Weiner Increments according to
• The Weiner Process then follows
Time
-0.3
-0.4
-0.5
-0.6
-0.7
4.65
4.5
4.35
4.2
4.05
3.9
3.75
3.6
3.45
3.3
3.15
3
2.85
2.7
2.55
2.4
2.25
2.1
1.95
1.8
1.65
1.5
1.35
1.2
1.05
0.9
0.75
0.6
0.45
0.3
0.15
0
Simulation
Weiner Process
0.1
0
-0.1
-0.2
Weiner Process
Simulation
0.8
0.6
0.4
0.2
Weiner Process 1
0
Time
0
0.15
0.3
0.45
0.6
0.75
0.9
1.05
1.2
1.35
1.5
1.65
1.8
1.95
2.1
2.25
2.4
2.55
2.7
2.85
3
3.15
3.3
3.45
3.6
3.75
3.9
4.05
4.2
4.35
4.5
4.65
Weiner Process 2
-0.2
Weiner Process 3
Weiner Process 4
Weiner Process 5
-0.4
-0.6
-0.8
-1
Stock Price Model
• Modeled by Geometric Brownian Motion
• Note
• To simulate use the ‘Euler Scheme’
Simulating GBM
6
5
4
3
GBM1
GBM2
Mean
2
1
0
4.65
4.5
4.35
4.2
4.05
3.9
3.75
3.6
3.45
3.3
3.15
3
2.85
2.7
2.55
2.4
2.25
2.1
1.95
1.8
1.65
1.5
1.35
1.2
1.05
0.9
0.75
0.6
0.45
0.3
0.15
0
Simulating GBM
3.5
3
2.5
2
Series1
1.5
exact
1
0.5
0
Mean Reverting Process
• Arithmetic Brownian Motion is mean reverting
• Interest rate models
• The numerical scheme is
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
1.1
1.2
1.3
1.4
1.5
1.6
1.7
1.8
1.9
2
2.1
2.2
2.3
2.4
2.5
2.6
2.7
2.8
2.9
3
3.1
3.2
3.3
3.4
3.5
3.6
3.7
3.8
3.9
4
4.1
4.2
4.3
4.4
4.5
4.6
4.7
Simulating ABM
Arithmetic Brownian Motion
1.4
1.2
1
0.8
0.6
0.4
0.2
0
-0.2
-0.4
4.65
4.5
4.35
4.2
4.05
3.9
3.75
3.6
3.45
3.3
3.15
3
2.85
2.7
2.55
2.4
2.25
2.1
1.95
1.8
1.65
1.5
1.35
1.2
1.05
0.9
0.75
0.6
0.45
0.3
0.15
0
Simulating ABM
1.2
1
0.8
0.6
Exact
Numerical
0.4
0.2
0
Option Pricing using Monte Carlo
• Generate several risk-neutral random walks
for the asset starting at the asset price today
and going on till expiry.
• For each path generated calculate the payoff.
• Calculate average the average of all the
payoffs
• Take the present value of this average to get
the option value today.
Pricing of European Call
Challenge Problem
Simulate using Monte Carlo techniques the
price of a European call option where the
underlying with volatility 0.5 interest rate 3%
exercise price 100 and currently underlying at
90