New answers tagged jump
Your code has a bug that it picks one random jump time by exprnd(lam), then makes a vector of jump times with jumps repeating at the same interval. It should pick a new random time for each jump.
The error is, you are not storing the random numbers for the same path at the end: xbefore = x + c*tau + sigma*sqrt(tau)*randn() A = muA + sigmaA*randn(); xafter = xbefore + A; But then at end you set a different path here by creating a new random number: xT = log(S0)+(c+muA*lambda)*T+sqrt((sigma^2+(muA^2+sigmaA^2)*lambda)*T)*randn(); randn() ...
Top 50 recent answers are included