0

I am trying to do a Monte Carlo simulation of a local volatility model, i.e.

dSt = sigma(St,t) * St dWt .

Unfortunately the Matlab package class sde can not be applied, as the function is rather complex.

For this reason I am simulating this SDE manually with the Euler-Mayurama method. More specifically I used Ito's formula to get an SDE for the log-process Xt=log(St)

dXt = -1/2 sigma^2(exp(Xt),t) dt + sigma(exp(Xt),t) dWt

The code for this is the following:

function [S]=geom_bb(sigma,T,N,m)
 % T.. Time horizon, sigma.. standard deviation, N.. timesteps, m.. dimensions

 X=zeros(N+1,m);
 dt=T/N;
 t=(0:N)'*dt;
 dW=randn(N,m);

 for j=1:N
   X(j+1,:)=X(j,:) - 1/2* sigma(exp(X(j,:)),t(j))^2 * sqrt(dt) + sigma(exp(X(j,:)),t(j))*dW(j,:);
 end

 S=exp(X*sqrt(dt));
end

This code works rather good for small sigma, however for sigma around 10 the process S always tends to zero. This should not happen as S is a martingale, and therefore has expectation =1 (at least for constant sigma). However X should be simulated correctly, as the mean is exact.

Can anyone help me with this issue? Is this only due to numerical rounding errors? Is there another simulation method that should be preferred to solve this problem?

Piyush Deshmukh
  • 519
  • 1
  • 7
  • 14
Mathin
  • 1
  • 1

1 Answers1

1

First are you sure S=exp(X*sqrt(dt)) outside the loop is doing what you want ? Why not have it inside the loop to start with ? You're using the exp(X) for sigma() inside the loop in any case, which is now missing the sqrt(dt).

Beyond that, suggested ways to improve behavior: use the Milstein scheme instead, increase the number of timesteps, make sure your sigma() value is commensurate with your timestep. Sigma of 10 means 1000% volatility, i.e. moves of 60% per day. Assuming dt is more than a few minutes, this simply can't be good.

IMK
  • 195
  • 2
  • 7