2
$\begingroup$

I want to simulate a jump-diffusion process with compound Poisson jumps and a deterministic jump frequency function $\lambda(t)$.

The function should follow the following stochastic differential equation:

$$dS_t = \mu S_tdt+\sigma S_tdW_t+dJ$$

While $dJ = z$ with probability $d\lambda_t$ and $dJ = 0$ with probability $1-d\lambda_t$ and $z\sim N(0,1)$

According to Glasermann's book, I can simulate directly from this expression $$S(t_i+1)=S(t_i)e^{(\mu-1/2\sigma^2)(t_{i+1}-t_i)+\sigma[W(t_{i+1})-W(t_i)]}\prod_{N(t_i)+1}^{N(t_{i+1})}J_j$$

However this is giving me weird results, so something must be wrong in either my understanding or my code.

S0 = 100
sigma = 0.2
mu=0.05
n = 1000
T=20
dt=1
m=dt*T
alpha=0.5
beta=m/2
KA=50
lambda <- function(t) return(KA/(1+exp(-alpha*(t-beta))))
S <- matrix(NA, nrow = n, ncol = m)
S[,1]=S0

for (i in 1:n){
  for(t in 1:(m-1)){
    nJ=rpois(1,(integrate(lambda,lower= t, upper= t+dt)$value)) # number of jumps in (t+dt-t)
    if(nJ!=0){ 
      M<-vector(mode="double", length = nJ)
      M[]=rnorm(nJ, mean = 0, sd = 1) #vector with jump size for each jump time
    }
    S[i,t+1]=S[i,t]*exp((mu-1/2*sigma^2)*(dt)+sigma*sqrt(dt)*rnorm(1, mean = 0, sd = 1))*prod(M)
  }
}
  plot(S[1,])

Also, I don't understand why jumps are multiplicative and not additive. I'd really appreciate your help, as I am obviously not an expert on financial mathematics.

$\endgroup$
5
  • $\begingroup$ Hi @MrPefister. Didn't have a deep look into this but (i) Shouldn't your intensity be $\color{blue}{\frac{1}{dt}} \int_t^{t+dt} \lambda(u) du$ (take the case where $\lambda = cst$ to convince yourself; (ii) jumps are only multiplicative if the SDE is $$ dS_t = \mu S_t dt + \sigma S_t dW_t + \color{blue}{S_{t^-}} dJ_t $$ with the compound Poisson process $J_t = \sum_{j=1}^{N_t} V_j$. Actually the expression you use for simulating would only be correct if you write the compound process as $$ J_t = \sum_{j=1}^{N_t} (V_j-1) $$ could you provide the Glasserman reference? $\endgroup$
    – Quantuple
    Commented Dec 27, 2018 at 10:04
  • $\begingroup$ Hi Quantuple, thanks for your swift reply. The reference is Glasserman, P. (2013). Monte Carlo methods in financial engineering (Vol. 53). Springer Science & Business Media p. 138. Regarding your suggestion for the intensity, could you explain the meaning of $u$ (why not $t$?) and why we have to divide by $dt$? A similar intensity is provided on p. 141 of the same book. I don't understand where the $u$ comes from. $\endgroup$
    – MrPefister
    Commented Dec 27, 2018 at 13:44
  • $\begingroup$ So yep, answer was too swift indeed. You are looking at simulating the number of jumps over $[t, t+\delta[$ which is $\text{nJ} := N_{t+\delta t}-N_t \sim P(\int_t^{t+dt} \lambda(u) du)$ so please forget my first comment: you are doing it right! Note that I used $u$ as the mute integration variable. it's a slight technicality you cannot use $t$ since $t$ is involved in the integral bounds. My second point was correct though. He gets the expression you mention for simulating the paths by considering the SDE (3.79) with definition (3.80) which was my point exactly. $\endgroup$
    – Quantuple
    Commented Dec 27, 2018 at 14:26
  • $\begingroup$ Thanks that has already helped me a lot. So if I simulate from $S(t_{i+1})=S(t_i)e^{(\mu−1/2\sigma^2)(t_{i+1}−t_i)+\sigma[W(t_{i+1})−W(t_i)]}+\sum_{N(t_i)+1}^{N(t_{i+1})}J_j$ it should do what I want regarding my SDE and my code, right? $\endgroup$
    – MrPefister
    Commented Dec 27, 2018 at 14:40
  • $\begingroup$ I would rather go with the Euler discretisation because you cannot use the trick of applying Itô on log-returns, i.e. $$ S_{t_{i+1}} = S_{t_i} \left( 1 + \mu \delta t + \sigma \delta W_t \right) + \sum_{j=1}^{\delta N_t} J_j$$ with $\delta W_t \sim \sqrt{\delta t} N(0,1)$ and the Poisson increment $\delta N_t$ simulated as we just discussed. Note that Glasserman's SDE makes more sense if you are looking to simulate equities future spot prices since you are then guaranteed that these will never be negative. $\endgroup$
    – Quantuple
    Commented Dec 27, 2018 at 14:49

0

Browse other questions tagged or ask your own question.