RGillespie | R Documentation |
R6 class implementing the Gillespie method in R
This is a subclass of Simulator, using an R implementation of the Gillespie method to simulate a compartmental model.
R6 class implementing the Gillespie method in R
This is a subclass of Simulator, using an R implementation of the Gillespie method to simulate a compartmental model.
REpiSim::Simulator
-> RGillespie
clone()
The objects of this class are cloneable with this method.
RGillespie$clone(deep = FALSE)
deep
Whether to make a deep clone.
# an SIR model
SIR = Compartmental$new(S, I, R, title="SIR")
SIR$transition(S->I ~ beta*S*I/N, N=S+I+R, name="infection")
SIR$transition(I->R ~ gamma*I, name="recovery")
g = RGillespie$new(SIR)
g$simulate(0:100, y0=c(S=1000, I=10, R=0), parms=c(beta=0.4,gamma=0.2))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.