View source: R/simulate_interventions.R
simulate_vivax_interventions | R Documentation |
Uses the compartmental model to simulate the effect of interventions
simulate_vivax_interventions(
df,
intervention_list,
previous_simulation = NULL,
f = 1/72,
gamma = 1/223,
r = 1/60,
year = T,
maxtime = 2000,
delay = FALSE,
rcd = FALSE,
referral = FALSE,
mda = FALSE,
rcd_at_baseline = FALSE,
sto = FALSE,
sto_method = "exact",
runs = 1,
seeds = NULL
)
df |
a dataframe containing the data, with one column called I containing the proportion
of infectious individuals (I0+Il) at equilibrium, one column called lambda containing the transmission rate,
and one variable called id which identifies uniquely each row in the dataset.
Additional optional variables are: |
intervention_list |
a list of intervention objects. |
previous_simulation |
the result of a previous simulation (e.g. the outcome of simulate_vivax_interventions or chain_vivax_interventions). If NULL (default), the model is simulated from equilibrium |
f |
relapse frequency |
gamma |
liver clearance rate |
r |
blood clearance rate |
year |
if TRUE, aggregates the outputs per year (h would be in cases per person year). if FALSE, returns daily outputs (h would be in cases per person day). |
maxtime |
number of time steps for simulation |
delay |
a boolean indicating if the model including delays in treatment should be used. Default (FALSE) is the model without delay in treatment |
rcd |
a boolean indicating if the model including reactive case detection should be used. Default (FALSE) is the model without RCD |
referral |
a boolean indicating if the rcd model includes referral. Default (FALSE) is the model with referral for RCD. This parameter is used only if rcd==TRUE. |
mda |
a boolean indicating if the model including mass drug administration (MDA) prophylaxis should be used. Default (FALSE) is the model without MDA |
rcd_at_baseline |
a boolean indicating if the model was calibrated using the RCD model (i.e. there is some RCD at baseline already). Default (FALSE) is the model without RCD at baseline |
sto |
a boolean indicating if the stochastic model is used. Default (FALSE) is the deterministic (ODE) model |
sto_method |
a scalarindicating which simulation method is used. Default ("exact") is Gillespie's direct method. Other options are "approximate" (tau-leap) or "mixed". cf. the documentation of the TiPS package for more information. |
runs |
number of draws of the stochastic model |
seeds |
a vector of the length of runs containing the seeds for each simulation (don't use "0" which has another use in TiPS) |
An intervention object is named list containing the intervention description. It should have the follwing structure: list(intervention_name="string", "alpha.new"=NA, "beta.new"=NA, "omega.new"=NA, "rho.new"=NA ) where NA can be replaced by scalars or kepts as such. If alpha.new is not provided in intervention_object it is equal to alpha. If beta.new is not provided in intervention_object it is equal to beta. If omega.new is not provided in intervention_object it is equal to omega. If rho.new is not provided in intervention_object it is equal to rho.
A dataframe with the simulated state variables for each parameter combination in df
mydata=data.frame(incidence=c(23,112),lambda=c(0.0063,0.0071),I=c(0.017,0.12),id=c(1,2))
mydata$rho.old=c(0.18,0.13)
mydata$beta.old=c(0.43,0.42)
mydata$alpha.old=c(0.17, 0.12)
mydata$delta=c(0,0)
mydata$omega.old=c(1,1)
int_0=list(intervention_name="0", "alpha.new"=NA, "beta.new"=NA, "omega.new"=NA, "rho.new"=NA )
int_A=list(intervention_name="A", "alpha.new"=NA, "beta.new"=0.6, "omega.new"=NA, "rho.new"=NA )
my_intervention_list=list(int_0, int_A)
simulate_vivax_interventions(df=mydata, my_intervention_list)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.