I am working with a model similar to the Heston model, and would like to add jumps. I would like to have the jump rate which depend on the ordinary volatility as
rate1(u,p,t) = λ0 .+ λ1.*exp(u/2.0)
I understand that this should be specified as a variable rate jump. However, I can’t seem to get the code to run if I do that. It does run if I specify it as a constant rate jump, but I’m doubting if the solution is correct when I do that. The code for the jump part follows. Any pointers would be welcome!
(this post is substantially similar to and earlier post, but with the diffeq tag added, sorry for the noise)
## jump in price rate1(u,p,t) = λ0 .+ λ1.*exp(u/2.0) # volatility dependent jump rate # jump is normal with st. dev. equal to λ1 times current st. dev. affect1!(integrator) = (integrator.u = integrator.u.+randn(size(integrator.u)).*λ2.*exp(integrator.u./2.0)) # this works: jump1 = ConstantRateJump(rate1,affect1!) # this does not #jump1 = VariableRateJump(rate1,affect1!) jump_prob = JumpProblem(prob,Direct(), jump1) sol = solve(jump_prob,SRIW1(), dt=dt, adaptive=false)