How JumpProblem() simulates general variable rate jumps coupled to an ODE
or SDE (vr_aggregator), as in JumpProcesses.jl. VR_FRM() (the default)
adds one state per jump holding its integrated rate and fires the jump
when it reaches an exponential threshold. VR_Direct() (and its function
wrapper variant VR_DirectFW(), the same algorithm in R) integrates the
total rate of all variable rate jumps along the solution, with adaptive
Gauss-Kronrod quadrature on each step's interpolant, fires at the time
its integral reaches one exponential threshold and picks the jump in
proportion to the rates there.
Examples
f <- function(u, p, t) 0 * u
vrj <- VariableRateJump(function(u, p, t) 1 + sin(t), function(integ) integ$u[1] <- integ$u[1] + 1)
jp <- JumpProblem(ODEProblem(f, 0, c(0, 10)), Direct(), vrj, vr_aggregator = VR_Direct())
tail(solve(jp, Tsit5(), seed = 1)$u, 1)
#> [[1]]
#> [1] 13
#>