Description Usage Arguments Examples
Create a model for an Erlang distribution in SimInf
1 | erlang(src, dst, shape, rate)
|
src |
The name of the source compartment. |
dst |
The name of the destination compartment. |
shape |
The shape parameter (integer) of the Erlang distribtion. |
rate |
The rate parameter of the Erlang distribution. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | library(SimInf)
library(SWmisc)
shape <- 100
m <- erlang("A", "B", shape, rate = shape / 730)
u0 <- matrix(c(100, rep(0, length(m$compartments) - 1)),
ncol = length(m$compartments))
u0 <- as.data.frame(u0)
colnames(u0) <- m$compartments
m <- mparse(m$transitions, m$compartments)
model <- init(m, u0, 1:1000)
plot(as.numeric(SimInf:::extract_U(run(model), "B")),
type = "l", ylab = "Number of individuals in B compartment",
xlab = "Time [day]")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.