FE5106 Advanced Numerical Methods

Download Report

Transcript FE5106 Advanced Numerical Methods

Monte-Carlo Simulation
Mathematical basis
• The discounted price is a martingale (MA4257 and
MA5248).
European vanilla call: linked to BS equation
Generating stock prices (1)
Generating stock prices (2)
• For European vanilla options, we can just take t=T and use the
discrete process of x since prices at intermediate times are
unnecessary.
• For path dependent options like Asian options, it is necessary to
generate prices at each ti.
Generating normal variables
The polar form of the Box-Muller method can be found at
http://en.wikipedia.org/wiki/Box-Muller_method.
A Matlab code for European call
• T=0.5; N=100; dt=T/N; sigma=0.3; r=0.05; q=0.01;
mu=r-q; S0=1; K=0.9; nsample=2000; v=0;
• for i=1:nsample
s(1)=S0;
for j=2:N+1
eps=randn;
s(j)=s(j-1)*(1+mu*dt+eps*sigma*sqrt(dt));
end
v=v+max(s(j)-K,0);
end
v=exp(-r*T)*v/nsample
Another code for European call
• T=0.5; sigma=0.3; r=0.05; q=0.01;
mu=r-q-sigma^2/2; S0=1; K=0.9; nsample=2000; v=0;
• for i=1:nsample
x=mu*T+randn*sigma*sqrt(dt));
s=S0*exp(x);
v=v+max(s-K,0);
end
v=exp(-r*T)*v/nsample
A better code
• T=0.5; sigma=0.3; r=0.05; q=0.01;
mu=r-q-sigma^2/2; S0=1; K=0.9; nsample=2000;
• epsv=randn(nsample,1);
• ST=S0*exp((mu-sigma^2/2)*T+epsv*sigma*sqrt(T));
• v=exp(-r*T)*mean(max(ST-X,0))
Number of trials and error of estimate
• The number of simulation trials carried out depends on
the accuracy required.
• Denote the mean by b and the standard deviation by .
Then variable b is the simulation's estimate for the true
value f, with the standard error of the estimate
• To increase the accuracy by a factor of 10, the number
of trials must increase by a factor of 100.
Sampling through a tree
• Suppose we have a binomial tree where the risk neutral
probability is p.
• The sampling procedure:
– At each node, we sample a random number between
[0,1]. We take the down path if the number <1-p; and
the up path otherwise. Once we have a complete path
from the initial node to the end of the tree we can
calculate a payoff. This completes the first trial.
• A similar procedure is used to complete more trials. The
mean of the payoffs is discounted at the risk-free rate to
get an estimate of the value of the derivative.
Calculating the Greek letters: method 1
Calculating the Greek letters: method 2
Calculating the Greek letters: method 3
Generation of correlated samples (1)
Generation of correlated samples (2)
The Cholesky factorization gives one way of choosing
this decomposition.
Generation of correlated samples (3)
Antithetic variance reduction
Control variates (1)
Suppose we are trying to use MC to price a derivative
A, and there is a derivative B with payoff correlated to
A and with a price available in analytically closed form.
Control variates (2)
Control variates (3): an example
Handling early exercise
• Not required
• I refer interested students to Longstaff and Schwartz (2001):
Valuing American options by simulation: a simple least squares
approach, Review of Financial Studies, 14(1), 113-147.
Quasi Monte Carlo
• Not required
• Quasi MC makes use of low discrepancy sequences,
instead of pseudo random variables, to generate
representative samples for desired probability
distributions.
• References:
– http://www.puc-rio.br/marco.ind/quasi_mc.html
– P. Glasserman, Monte Carlo Methods in Financial
Engineering, Springer