# SEIR Connected
seirconn <- ModelSEIRCONN(
name = "Disease",
n = 10000,
prevalence = 0.1,
contact_rate = 2.0,
transmission_rate = 0.8,
incubation_days = 7.0,
recovery_rate = 0.3
)
# Running the simulation for 50 steps (days)
set.seed(937)
run(seirconn, 50)
# Retrieving the transition probability
get_transition_probability(seirconn)
# Retrieving date, state, and counts dataframe including any added tools
get_hist_tool(seirconn)
# Retrieving overall date, state, and counts dataframe
head(get_hist_total(seirconn))
# Retrieving date, state, and counts dataframe by variant
head(get_hist_virus(seirconn))
# Retrieving (and plotting) the reproductive number
rp <- get_reproductive_number(seirconn)
plot(rp) # Also equivalent to plot_reproductive_number(seirconn)
# We can go further and get all the history
t_hist <- get_hist_transition_matrix(seirconn)
head(t_hist)
# And turn it into an array
as.array(t_hist)[, , 1:3]
# We cam also get (and plot) the incidence, as well as
# the generation time
inci <- plot_incidence(seirconn)
gent <- plot_generation_time(seirconn)
Run the code above in your browser using DataLab