-
-
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
Ficticious jump algorithm for time-dependent variable rate jumps. #252
base: master
Are you sure you want to change the base?
Conversation
Pull Request Test Coverage Report for Build 4127486574Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
@pihop still taking a look over this -- I've been delayed by the US holiday and travel for it. One quick comment is it would be great if you could add a test that actually tests accuracy by comparing some statistic against simulations using the current approach. |
@pihop looks like tests are passing now. Please let me know when you feel this is done and you have added an accuracy test that compares against the current solvers (to check you are getting the correct statistics on some simple example like A+B -> C). I'll then go through and give it a review. Thanks!!! |
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.
It would be good to add this to the Hawkes test too and make sure that passes, but the bigger thing to address is that this doesn't seem to actually implement Extrande to me (based on the pseudo-code in Box 1 of the PLOS Comp Bio paper).
If you are trying to implement a different method that is fine, but we shouldn't call this Extrande then, and should reference the relevant paper.
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.
You need to update next_extrande_jump
to handle MassActionJump
s too, see how we do it in Direct.jl
. They work differently than ConstantRateJump
s or VariableRateJump
s.
Please also add extrande
to some of the tests for constant rate problems so we can make sure it is working ok there too.
src/aggregators/extrande.jl
Outdated
|
||
# Calculate the total rate bound and the largest common validity window. | ||
if !isempty(p.rate_bnds) | ||
Bmax = typeof(t)(0.) |
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.
Bmax = typeof(t)(0.) | |
Bmax = zero(t) |
src/aggregators/extrande.jl
Outdated
ma_jumps, save_positions, rng; variable_jumps = (), kwargs...) | ||
ma_jumps_ = !isnothing(ma_jumps) ? ma_jumps : () | ||
rates, affects! = get_jump_info_fwrappers(u, p, t, | ||
(constant_jumps..., variable_jumps..., ma_jumps_..., |
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.
This doesn't make sense as MassActionJump
s don't use the same interface as ConstantRateJump
s or VariableRateJump
s. So while you can merge the rate functions from the latter two you need to keep track of MassActionJump
s separately and handle their rate calculation separately. See what we do in Direct
for handling them.
Looks like a real CI failure. |
Extends the VariableRateJump interface to allow for user-defined bounds on time-dependent jump rates and look-ahead horizons for which the bound is valid. Implements a fictitious jump rejection algorithm based on https://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1004923.
Relevant issue: #28