run | R Documentation |
Run the SimInf stochastic simulation algorithm
run(model, ...)
## S4 method for signature 'SimInf_model'
run(model, solver = c("ssm", "aem"), ...)
## S4 method for signature 'SEIR'
run(model, solver = c("ssm", "aem"), ...)
## S4 method for signature 'SIR'
run(model, solver = c("ssm", "aem"), ...)
## S4 method for signature 'SIS'
run(model, solver = c("ssm", "aem"), ...)
## S4 method for signature 'SISe'
run(model, solver = c("ssm", "aem"), ...)
## S4 method for signature 'SISe3'
run(model, solver = c("ssm", "aem"), ...)
## S4 method for signature 'SISe3_sp'
run(model, solver = c("ssm", "aem"), ...)
## S4 method for signature 'SISe_sp'
run(model, solver = c("ssm", "aem"), ...)
## S4 method for signature 'SimInf_abc'
run(model, ...)
model |
The SimInf model to run. |
... |
Additional arguments. |
solver |
Which numerical solver to utilize. Default is 'ssm'. |
SimInf_model
object with result from
simulation.
2019
\Bauer2016
\Bauer2015
## For reproducibility, call the set.seed() function and specify
## the number of threads to use. To use all available threads,
## remove the set_num_threads() call.
set.seed(123)
set_num_threads(1)
## Create an 'SIR' model with 10 nodes and initialise
## it to run over 100 days.
model <- SIR(u0 = data.frame(S = rep(99, 10),
I = rep(1, 10),
R = rep(0, 10)),
tspan = 1:100,
beta = 0.16,
gamma = 0.077)
## Run the model and save the result.
result <- run(model)
## Plot the proportion of susceptible, infected and recovered
## individuals.
plot(result)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.