epirecipes / sir-julia

Various implementations of the classical SIR model in Julia
MIT License
196 stars 39 forks source link

add jump process with delay example #46

Closed slwu89 closed 2 years ago

slwu89 commented 2 years ago

Hi @sdwfrost, this addresses (part of) #13 using callbacks and the DifferentialEquations.jl solver. Dynamics look much more like the DDE solutions than the Gillespie and jump process solutions, as expected.

sdwfrost commented 2 years ago

Thanks @slwu89! This is a nice and clear example of using the integrator interface directly.

sdwfrost commented 2 years ago

I added a fixed delay to my DES example - there should be a check to ensure that the results are comparable.

slwu89 commented 2 years ago

@sdwfrost could we compare the mean/some quantiles of a large number of simulations from both methods to the DDE solution? They should both be quite close I think.

sdwfrost commented 2 years ago

Yes, something simple like that should be sufficient. Comparing the empirical CDF of some quantity for the DES and your jump system should look like a straight line.

slwu89 commented 2 years ago

OK I can do a comparison after I fix the problem of initial infectives not being queued for recovery in the jump example. Where should that notebook (the comparison) live?

sdwfrost commented 2 years ago

In some ways, I think the DES should be the gold standard, as it's the most general. In order to keep the notebooks separate, perhaps a distribution of the final size?