RECON-gathering-March-2018 / projects

Discuss projects for the RECON gathering hackathon on the 23rd March 2018
https://recon-gathering-march2018.netlify.com/
8 stars 0 forks source link

new package: individual-based epidemics simulation #3

Open thibautjombart opened 6 years ago

thibautjombart commented 6 years ago

There are different versions of this scattered around, but no good package I am aware of. The model implemented in simOutbreak in the old outbreaker package may be a starting point. It contains:

sdwfrost commented 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.

thibautjombart commented 6 years ago

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 :)

sdwfrost commented 6 years ago

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