I would like to price Asian and Digital options under Merton's jump-diffusion model. To that end, I will have to simulate from a jump diffusion process.
In general, the stock price process is given by S(t)=S(0)e(r−q−ω)t+X(t),
So, the issue here is the simulation of X(t). I would like to simulate X(t) as follows: first, I construct a grid [0,T] with grid step size Δt=1/252 (number of trading days in one year). I now want to compute X on this grid stepwise. Therefore: XnΔt=X(n−1)Δt+σ√Δtϵn+pn,
I was thinking to write a compound Poisson generator myself:
function [p] = CPoissonGenerator(mu,delta,lambda,dt,rows,columns)
N = poissrnd((1/lambda)*dt,rows,columns);
Y = normrnd(mu,delta,1,N);
cP = cumsum([0,Y]);
p = cP(end);
end
However, I do not know how to generate a matrix of Poisson random variables without using a loop in the above code? This can be very time consuming. Furthermore, I'm not sure if the program is correct. Is there a better way to do this?
No comments:
Post a Comment