Nothing
## ---- setseed, echo=FALSE-----------------------------------------------------
set.seed(1)
knitr::opts_chunk$set(fig.width = 6, fig.height = 4)
if("package:GillespieSSA" %in% search()) detach("package:GillespieSSA", unload=TRUE)
## -----------------------------------------------------------------------------
library(GillespieSSA2)
sim_name <- "Radioactive Decay model"
params <- c(k = 0.5)
final_time <- 20
initial_state <- c(N = 1000)
## -----------------------------------------------------------------------------
reactions <- list(
reaction("k * N", c(N = -1))
)
## ----exact--------------------------------------------------------------------
set.seed(1)
out <- ssa(
initial_state = initial_state,
reactions = reactions,
params = params,
final_time = final_time,
method = ssa_exact(),
sim_name = sim_name
)
plot_ssa(out)
## ----etl----------------------------------------------------------------------
set.seed(1)
out <- ssa(
initial_state = initial_state,
reactions = reactions,
params = params,
final_time = final_time,
method = ssa_etl(tau = .003),
sim_name = sim_name
)
plot_ssa(out)
## ----btl----------------------------------------------------------------------
set.seed(1)
out <- ssa(
initial_state = initial_state,
reactions = reactions,
params = params,
final_time = final_time,
method = ssa_btl(),
sim_name = sim_name
)
plot_ssa(out)
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.