I’m trying to get a variable rate jump to work. I am using
## jump in price
#rate1(u,p,t) = λ0 # constant jump rate
rate1(u,p,t) = λ0.*exp(u[2]) # volatility dependent jump rate
# jump is normal with st. dev. equal to λ1 times current st. dev.
affect1!(integrator) = (integrator.u[1] = integrator.u[1].+randn(size(integrator.u[1])).*λ1.*exp(integrator.u[2]./2.0))
# this works:
jump1 = ConstantRateJump(rate1,affect1!)
# this does not
#jump1 = VariableRateJump(rate1,affect1!)
jump_prob = JumpProblem(prob,Direct(), jump1)
The rate, rate1, depends on the second integrator, so I understand that it is a variable rate jump. However, I get a dimension error if I try to specify it as variable rate (jump1, commented out). The solver gives a solution if I specify it as constant rate.
Am I making an error in the syntax for a variable rate jump?
Thanks!