Open thibautjombart opened 6 years ago
Happy to contribute here. I have working models in Julia and Javascript, which could easily be wrapped, and will be a lot faster than R. Also happy to start from scratch, perhaps with a view towards Rcpp.
Sounds pretty cool! In terms of portability I suspect Rcpp would be the easiest way forward, but I'm curious about the other approaches too :)
I guess it all depends whether you want the flexibility of having an event queue (which would easily allow non-exponential passage times etc.) or just a simulation that goes in discrete steps. Rcpp wise I could port my old C code:
https://code.google.com/archive/p/simonfrost/downloads
(there's a Python one too)
Portability-wise, Javascript would be easy via V8:
https://cran.r-project.org/web/packages/V8/index.html
There's already a nice netlogo-like IBM framework that would be easy to code up from. Here is a simple SIR model:
https://beta.observablehq.com/@sdwfrost/sir-model-in-agentscript
Although time is in discrete steps, it's easy to have an auxiliary variable that captures time. If you want a pure R version that time steps that's still flexible, you could use simecol:
https://cran.r-project.org/web/packages/simecol/vignettes/a-simecol-introduction.pdf
There are different versions of this scattered around, but no good package I am aware of. The model implemented in
simOutbreak
in the oldoutbreaker
package may be a starting point. It contains: