Hedge with an EdgeAn Introduction to the Mathematics of Finance
Riaz Ahmed & Adnan KhanLahore Uviersity of Management Sciences
Monte Carlo Methods
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
0 1 2 3 4 5 6 7 8 9 100
5
10
15
20
25
hist
hist
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
0
200
400
600
800
1000
1200
1400
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
-3-2.76
-2.52-2.28
-2.04-1.8
-1.56-1.32
-1.08
-0.8399999999...
-0.5999999999...
-0.3599999999...
-0.1199999999...
0.1200000000...
0.3600000000...
0.6000000000...
0.8400000000...1.08
1.321.56 1.8
2.042.28
2.522.76 3
-100
0
100
200
300
400
500
600
Series1Series2Series3
Rejection Method
• Simulate &
• To Simulate look @
• If 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
0
100
200
300
400
500
600
700
800
Weiner Process
• W(t) CT-CS process is a Weiner Process if W(t) depends continuously on t and the following holda)b) are independentc)
Simulating Brownian Motion
• Initialize at 0 as W(0)=0
• Simulate Weiner Increments according to
• The Weiner Process then follows
Simulation
00.15 0.3
0.45 0.60.75 0.9
1.05 1.21.35 1.5
1.65 1.81.95 2.1
2.25 2.42.55 2.7
2.85 33.15 3.3
3.45 3.6
3.74999999999999
3.89999999999999
4.04999999999999
4.19999999999999
4.34999999999999
4.49999999999999
4.64999999999999
-0.7
-0.6
-0.5
-0.4
-0.3
-0.2
-0.1
0
0.1
Weiner Process
Weiner Process
Tim
e
Simulation
00.15 0.3
0.45 0.60.75 0.9
1.05 1.21.35 1.5
1.65 1.81.95 2.1
2.25 2.42.55 2.7
2.85 33.15 3.3
3.45 3.6
3.74999999999999
3.89999999999999
4.04999999999999
4.19999999999999
4.34999999999999
4.49999999999999
4.64999999999999
-0.4
-0.2
0
0.2
0.4
0.6
0.8
Weiner Process 1Weiner Process 2Weiner Process 3Weiner Process 4Weiner Process 5
Tim
e
Stock Price Model
• Modeled by Geometric Brownian Motion
• Note
• To simulate use the ‘Euler Scheme’
Simulating GBM
00.15 0.3
0.45 0.60.75 0.9
1.05 1.21.35 1.5
1.65 1.81.95 2.1
2.25 2.42.55 2.7
2.85 33.15 3.3
3.45 3.6
3.74999999999999
3.89999999999999
4.04999999999999
4.19999999999999
4.34999999999999
4.49999999999999
4.649999999999990
1
2
3
4
5
6
GBM1GBM2Mean
Simulating GBM
00.15 0.3
0.45 0.60.75 0.9
1.05 1.21.35 1.5
1.65 1.81.95 2.1
2.25 2.42.55 2.7
2.85 33.15 3.3
3.45 3.6
3.74999999999999
3.89999999999999
4.04999999999999
4.19999999999999
4.34999999999999
4.49999999999999
4.649999999999990
0.5
1
1.5
2
2.5
3
3.5
Series1exact
Mean Reverting Process
• Arithmetic Brownian Motion is mean reverting
• Interest rate models
• The numerical scheme is
Simulating ABM
00.15 0.3
0.45 0.60.75 0.9
1.05 1.21.35 1.5
1.65 1.81.95 2.1
2.25 2.42.55 2.7
2.85 33.15 3.3
3.45 3.6
3.74999999999999
3.89999999999999
4.04999999999999
4.19999999999999
4.34999999999999
4.49999999999999
4.64999999999999
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
1.2
1.4
Arithmetic Brownian Motion
Simulating ABM
00.15 0.3
0.45 0.60.75 0.9
1.05 1.21.35 1.5
1.65 1.81.95 2.1
2.25 2.42.55 2.7
2.85 33.15 3.3
3.45 3.6
3.74999999999999
3.89999999999999
4.04999999999999
4.19999999999999
4.34999999999999
4.49999999999999
4.649999999999990
0.2
0.4
0.6
0.8
1
1.2
ExactNumerical
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