I am working with a Markov jump process with multiple possible reactions (Variable rates) coupled to a stochastic differential equation. I am trying to simulate it using the JumpProcesses.jl package.
I am trying to obtain the statistics of the total number of jumps occurred due to a particular reaction. There are multiple reactions with different rates giving the same state change. From the output file, I am able to identify the timestamps of the jumps, but I am unable to identify which reaction caused that specific change.
I have already my our script to simulate the dynamics and get those statistics, but it is very slow as of now.
I will be happy to share further information of the details of the process.
Hmm interesting ask. I would just manually instrument the generated jumps, but that’s not a nice transferrable way to do it. @isaacsas do you have a way you’d suggest?
The easiest way I can think of that would work for all jump types is to add for each reaction you want to track a new state that is a product. i.e.
A + B --> C would become
A + B --> C + R1 and
C --> A + B would become
C --> A + B + R2. Then
R2 would count how many times those specific reactions occur. This would have the advantage of showing when the jumps occur too.
We could add keeping total counts as an option, but wouldn’t want to save the full paths for each reaction by default. It might make more sense to just add the “virtual state” suggestion as a FAQ entry.
Thanks for the quick responses. After some discussions, someone suggested the same, and the idea of virtual state as counters totally makes sense.
In the documentation, it is mentioned that most of the jump aggregators work with constant or mass action rates. However, my system has custom rates which depends on the state of an SDE. Which aggregator should I use in this case?
Kudos on the wonderful work to everyone involved in this package! @ChrisRackauckas
The aggregators only handle the constant and mass action jumps, so if you have none they won’t be used anyways (i.e, the choice doesn’t matter). There currently is no flexibility in method for handling variable rate jumps, so just choose the SDE solver you need.