epirecipes / sir-julia

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

Added Petri.jl implementation of SIR model #15

Closed mehalter closed 4 years ago

mehalter commented 4 years ago

Addresses #11

ChrisRackauckas commented 4 years ago

It looks like it's general non-diagonal non-commutative noise. LambdaEM is the algorithm to go to right now. It'll be a lot more costly, but it's correct.

sdwfrost commented 4 years ago

Perhaps for reaction network/Petri models, there should be the choice of conversion to the 'standard' version in terms of states (S,I,R in this case) or to a multivariate birth process along the lines of https://github.com/epirecipes/sir-julia/blob/master/tutorials/mbp/mbp.jmd . The latter gives you diagonal noise.

sdwfrost commented 4 years ago

My bad here on the solver for the SDE example; is there a way to catch these errors? I'll change the solver to LambaEM on the next commit.

ChrisRackauckas commented 4 years ago

It's not you it's me. We can have a compiler or type system way of dealing with this. I actually just thought of a good way to do it, so we can make this case throw an error.

That said, it's not egregious. The method will still converge at order 0.5, but the error estimate in the adaptivity will be incorrect.