View source: R/treeSimulatorCpp2.R
show.demographic.process | R Documentation |
Shows a graphical representation of the demographic process given values for each parameter of interest, and initial population sizes. The user should also provide the initial size for the population of interest in the their model.
show.demographic.process(
demo.model,
theta,
x0,
t0,
t1,
res = 1000,
integrationMethod = "lsoda",
legend_position = "bottomright",
...
)
demo.model |
An object of class |
theta |
A named numeric vector or named list of parameter values used by the demographic model |
x0 |
A named vector of initial conditions required by the model. This includes demes and any other dynamic variables. |
t0 |
Initial time for the simulation (to show the demographic process) |
t1 |
Final time for tge simulation (to show the demographic process) |
res |
Integer number of time steps to use when simulating model. |
integrationMethod |
If simulating an ODE model, this provides the integration routine corresponding to options in deSolve. |
legend_position |
String for position of legend in final plot. Default is set to "bottomright" |
... |
Additional arguments that can be passed to the function, such as graphical parameters. |
build.demographic.process
# A simple exponential growth model with birth rates beta and death rates gamma:
# I is the number of infected individuals.
dm <- build.demographic.process(births=c(I = 'parms$beta * I'),
deaths = c(I = 'parms$gamma * I'),
parameterNames=c('beta', 'gamma'),
rcpp=FALSE,
sde = TRUE)
# Do a simulation and plot the trajectory:
show.demographic.process(dm,
theta = list(beta = 1.5, gamma = 1),
x0 = c(I = 1),
t0 = 0,
t1 = 10)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.