-
-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VariableRateJump - Jumps don't match expected distribution for birth-death process #320
Comments
What are the parameters you are choosing and number of simulations you are averaging over? For a birth dominated system this model will grow exponentially so I'd expect it to have issues when the population gets big (though from what you say the issue is when the population is small). Note that the method you are using is not "exact" in the sense that So there are a couple things you can try. Can you let me know if either of the following helps:
That said, I tried 2., reducing the error tolerances to @ChrisRackauckas any suggestions on how to handle this via the ODE solvers? It didn't look like one could really reduce the tolerances in the jump/callbacks anymore as the defaults are already pretty small... |
Hi @isaacsas - thanks for looking at this. So re 1., am I right in thinking that because in my full model the rates can depend on an ODE solution, using And yes, sorry I wasn't clear which parameters I was looking at - I'm interested in a growing population (so Because the |
You can see what is going on here: JumpProcesses.jl/src/problem.jl Line 265 in c8ec2ba
The ODE state variables are internally augmented with the integrated intensities, and the ODE derivative function is augmented to return the current value of the intensities/rates. |
Closed by #320 |
I saw that a mixed birth-death ODE-jump process I was using wasn't behaving as expected.
Following some investigation, it appears that when I switch the rates from being '
ConstantRateJump
' to 'VariableRateJump
' the birth-death model stops properly simulating the theoretical expectation for a birth-death process.This issue is also only noticeable when the initial population sizes are small (eg
n0 = 1.0
in the code below), so I'm assuming that this means the issue is something to do with how the time between jumps is calculated when the gap between jumps is large.Here is a simple toy birth-death jump process model I wrote to investigate the problem (the real problem is more complicated - so although in this version the variable rates aren't necessary, they are in the full model. Also, in the full model, the rates do depend on part of the ODE solution, and hence the continuous problem has to be used).
Additionally, although this version could be modelled without the
VariableRateJump
, I would expect the behaviour to revert to theConstantRateJump
when the model experiences a period where the time between jumps is constant, even if the jumps become variable later on.If I run this model many times with a starting population (
n0
) of1.0
, I can see that the model is under-estimating the expected population size at time t, given some birth and death rates b & d. For the simple birth-death process, this should simply ben(t) = n0 * e^((b - d)*t)
- if I change theb_jump
andd_jump
toConstantRateJump
s then the model does reach the expected population size,(nt)
(when looking at the average behaviour following many iterations).The text was updated successfully, but these errors were encountered: