Download MonTe Carlo Simulation

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

2010 Flash Crash wikipedia , lookup

Lattice model (finance) wikipedia , lookup

Transcript
MONTE CARLO
SIMULATION
Topics
• History of Monte Carlo Simulation
• GBM process
• How to simulate the Stock Path in Excel,
• Monte Carlo simulation and VaR
History of the Monte Carlo
• http://www.youtube.com/watch?v=ioVccVC_Smg
Markov Property
• A Markov process is a particular type of stochastic
process where only the present value of a variable is
relevant for predicting the future
Continuous-Time Stochastic Process
• Suppose a variable follow a Markov stochastic process and its
current value is 10. Suppose further that its value during 1 year
is Type equation here.
𝑋~∅(0,1)
• What is the probability of the change in the value during 2
year?......Ans. Because of the Markov process (independent
distribution), the distribution
𝑋~∅(0,2)
• What is the prob. of change during 6 months?….
• Generally, the change during a very short time period ∅(0, ∆t)
but note that the variances of changes are additive but the
standard deviations are not additive. Variance in 2, 3 years are
2 and 3 but the standard deviation are √2 and √3
Wiener Process
• Wiener process is a particular type of Markov process. In
physics, it is called as Brownian motion
• If a variable z follows wiener process it must follow two
properties
• Property 1. The change in ∆z during a small time ∆t is
∆𝑧 = 𝜖 ∆t
Where 𝜖 has a standardized normal distribution ∅(0,1)
• Property 2. The value of ∆z for any two different short
intervals of time ∆t are independent, thus
•
•
•
Mean of ∆z = 0,
Standard deviation of ∆z = ∆𝑡
Variance of ∆z = ∆t
The second property implies that z follows Markov process
Graphically
∆𝑧1
𝜖 ∆t
∆𝑧 2
𝜖 ∆t
∆𝑧3
𝜖 ∆t
∆𝑧4
𝜖 ∆t
∆𝑧5
𝜖 ∆t
Generalized Wiener Process
• dS = a(Sdx = adt + bdz
dx = a(S, t )dt + b(S, t)dz
• ,mean change per unit of time is known as drift rate and the
variance per unit is called as the variance rate)dt + b(S, t)dz
Example
• Suppose stock price follow the process of
dx = adt or dx/dt = a
Integrating with respect to time, we get
x = x0 + at
- Where x0 is the value of x at time 0. In a period of time of
length T, the variable x increase by an amount of aT
- bdz is regarded as noise or variability term added to the
path of x
- Wiener process has a standard deviation of 1.0. so, b
times a Wiener process has a standard deviation of b.
Stock price process: with out volatile
If the volatility of stock price is zero, then
∆s = μ𝑠∆𝑡
When ∆𝑡 → 0,
𝑑𝑠 = μ𝑠𝑑𝑡
Or,
𝑑𝑆
𝑆
= 𝜇𝑑𝑡
Integrating between 0 and time T, we get
𝑆𝑇 = 𝑆0 𝑒 𝜇𝑇
Meaning that the stock price grow at a continuous
compound rate of 𝜇
Stock price process with volatile
𝑑𝑠 = μ𝑠𝑑𝑡 + σsdz
Or,
𝑑𝑠
𝑠
= μ𝑑𝑡 + σdz … … … … . . GBM
For the discrete time, ∆𝑡
∆𝑠
𝑠
= μ∆𝑡 + σϵ ∆𝑡
Return of stock price is normal distributed as;
∆𝑆
~∅(
𝑆
μ∆𝑡, σ2 ∆𝑡)
Change of x at small time changes and in
time interval T
∆𝑥 = 𝑎∆𝑡 + 𝑏𝜖 ∆𝑡
• 𝜖 has a standard normal distribution. Thus, ∆𝑥 has a
normal distribution with
mean of ∆𝑥 = 𝑎∆𝑡
variance of ∆𝑥 = 𝑏 2 ∆𝑡
standard deviation of ∆𝑥 = 𝑏 ∆𝑡
• So, change in value of x in any time interval T
mean of 𝑐ℎ𝑎𝑛𝑔𝑒 𝑖𝑛 𝑥 = 𝑎𝑇
variance of 𝑐ℎ𝑎𝑛𝑔𝑒 𝑖𝑛 𝑥 = 𝑏 2 𝑇
standard deviation of 𝑐ℎ𝑎𝑛𝑔𝑒 𝑖𝑛 𝑥 = 𝑏 𝑇
Log normal return
• When a log of any variable distribute as normal, we call it
as lognormal distribute. We can show that the Log of
returns is normally distributed as
• 𝑙𝑛𝑆𝑇 − 𝑙𝑛𝑆0 ~∅
𝜇−
𝜎2
2
𝑇, 𝜎 2 𝑇
• Or
• 𝑙𝑛𝑆𝑇 ~∅ 𝑙𝑛𝑆0 + 𝜇 −
𝜎2
2
𝑇, 𝜎 2 𝑇
Fundamentals of Futures and Options Markets, 4th edition
© 2001 by John C. Hull
The Lognormal Property
• These assumptions imply ln ST is normally
distributed with mean:
lnlnSS0 (( 2/ /22)T)T
0
2
and standard deviation:
 T
• Because the logarithm of ST is normal, ST is
lognormally distributed
11.14
Fundamentals of Futures and Options Markets, 4th edition
© 2001 by John C. Hull
11.15
The Lognormal Property
continued

ln S T   ln S 0  (   2 2)T ,  T

or

ST
2
ln
  (   2)T ,  T
S0

where m,s] is a normal distribution with
mean m and standard deviation s
Fundamentals of Futures and Options Markets, 4th edition
© 2001 by John C. Hull
The Lognormal Distribution
E ( ST )  S0 e T
2 2 T
var ( ST )  S0 e
(e
2T
 1)
11.16
Monte Carlo Simulation (See Excel)
• Suppose X follow the Wiener Process
∆𝑥 = 𝑎∆𝑡 + 𝑏𝜖 ∆𝑡
Suppose 𝑎 = 0.5, 𝑏 = 3.0 Find the path of X using Excel
• To generate random variables using Excel
Normsinv (rand())
* Note that rand() function generate the variables drawn
from the uniform distribution, but to keep it simple just use
it to generate ‘Z’.
1
3
5
7
9
11
13
15
17
19
21
23
25
27
29
31
33
35
37
39
41
43
45
47
49
51
53
55
57
59
61
63
65
67
69
71
73
75
77
79
81
83
85
87
89
91
93
95
97
99
101
value of x
Monte Carlo Simulation (See Excel)
80
70
60
50
40
30
20
10
0
-10