-
-
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
Coevolve
aggregator for VariableRateJump
#276
Conversation
@gzagatti just to update you. I've gone through and updated a subset of the tutorials, along with updating some of the new doc strings. I also changed Stil TODO on my end:
A few minor comments for you:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the doc updates. They look much better. I have one minor comments for you to consider.
Also, great to learn about a simpler way of passing keyword arguments.
I will build the docs locally to see if everything is working.
By the way, I re-ran the benchmarks. I get closer results. Coevolve
sometimes beats NRM
.
Benchmark | Direct | FRM | SortingDirect | NRM | DirectCR | RSSA | RSSACR | Coevolve |
---|---|---|---|---|---|---|---|---|
Diffusion CTRW | 4.85 s | 15.88 s | 1.17 s | 0.87 s | 0.43 s | 1.91 s | 0.37 s | 0.77 s |
Multistate Model | 0.12 s | 0.22 s | 0.12 s | 0.27 s | 0.20 s | 0.11 s | 0.16 s | 0.28 s |
Neg. Feed. Gene Expression | 0.17 ms | 0.24 ms | 0.21 ms | 0.44 ms | 0.38 ms | 0.35 ms | 0.73 ms | 0.40 ms |
Marchetti Gene Expression | 0.44 s | 0.62 s | 0.39 s | 0.75 s | 0.79 s | 0.59 s | 0.83 s | 0.96 s |
Some of the differences probably come from my machine (personal work laptop), so running them on a dedicated server might provide more consistent results. However, it seems that it is only the Marchetti model that displays substantial and persistent difference.
@gzagatti do the changes I made look ok to you? Otherwise I think this is good to go (though some more tests mixing bounded and general |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your review.
I like the simplifications to the JumpProblem
and the Coevolve
aggregator.
I have made some comments on the documentation, otherwise it's all good on my side.
Co-authored-by: Guilherme Zagatti <[email protected]>
Co-authored-by: Guilherme Zagatti <[email protected]>
All merged. Thanks @gzagatti this is a great PR. |
You're welcome. Thanks for your support @isaacsas! |
Hi, thank you for the great work to support
it seems to me that !isempty(rs) should check whether the JumpProblem has either ConstantRateJump or VariableRateJump . But in the construction of Coevolve aggregator, rates only refers to VariableRateJump
should the condition !isempty(rs) be changed to !isempty(urates) instead?Thank you! |
Hi-, good catch. Could you submit a PR with that change? |
this pull request is related to SciML#276 (comment)
This PR introduces the
Coevolve
aggregator forVariableRateJump
. This aggregator supports theSSAStepper()
integrator for the efficient simulation of jump processes with time-varying rates.Some background, in
JumpProcesses.jl
most of the algorithms are borrowed from the biochemistry literature. However, jump processes have also been extensively studied in the statistics literature where they go by point processes (see Daley and Vere-Jones [1]). In the point process literature, we find many of the simulation algorithms implemented in this library that go by other names. Among the most popular one is Ogata's algorithm [2] which is very similar to Gillespie's direct method. Ogata's algorithm as adapted in Daley [1] is a general-purpose algorithm for any point process that evolves through time. Farajtabar et al. [3] modifies Ogata's algorithm to use a priority queue in order to simulate a compound Hawkes process using a priority queue. Here I adapt Farajtabar's COEVOLVE algorithm to simulate any evolutionary point process, thus the name of the algorithm.This algorithm requires user-defined bounds and a dependency graph. Therefore, I extend the
VariableRateJump
to accept three aditional keyword argumentslrate
,urate
andL
.lrate(u, p, t)
is a function that computes the lower-bound of the rate fromt
tot + L
,urate
computes the upper-bound, andL
computes the interval for which the bounds are valid.A toy example is given below
I have performed some benchmarks to evaluate the performance of the model. I ran the jump benchmarks of
SciMLBenchmarks
.Coevolve
performs on par with the alternatives, with a fixed penalty overNRM
. TheQueueMethod
basically reduces to theNRM
when all the jumps areConstantRateJump
orMassActionJump
, but I was not able to equate theNRM
performance.More complex examples include the compound Hawkes process which was the main motivation for contributing this PR.
I have also developed a new benchmark using the compound Hawkes process and found significant improvements compared to using the ODE solver. Please check my branch of
SciMLBenchmarks
for more details. Note that theDirect
method does not run within the allowed time when the number of nodes reaches above 40.I have added unit tests and updated the documentation to reflect the changes introduced here.
As I completed this PR, I learnt about PR #252 which also extends
VariableRateJump
. The author implements a different algorithm which also uses rate bounds. While the algorithm implemented in that PR is analogous to rejection-based algorithms, the algorithm in this PR is analogous to next-reaction methods. So they both face different trade-offs.I am looking forward to your feedback.
[1] D. J. Daley and D. Vere-Jones, An Introduction to the Theory of Point Processes: Volume I: Elementary Theory and Methods, 2nd ed. New York: Springer-Verlag, 2003. doi: 10.1007/b97277.
[2] Y. Ogata, “On Lewis’ simulation method for point processes,” IEEE Transactions on Information Theory, vol. 27, no. 1, pp. 23–31, Jan. 1981, doi: 10.1109/TIT.1981.1056305.
[3] M. Farajtabar, Y. Wang, M. Gomez-Rodriguez, S. Li, H. Zha, and L. Song, “COEVOLVE: a joint point process model for information diffusion and network evolution,” J. Mach. Learn. Res., vol. 18, no. 1, pp. 1305–1353, Jan. 2017, doi: 10.5555/3122009.3122050.