run_sim | R Documentation |
Run pandemic simulation
run_sim(
params,
state = NULL,
start_date = "2020-03-20",
end_date = "2020-05-1",
params_timevar = NULL,
dt = 1,
ndt = 1,
stoch = c(obs = FALSE, proc = FALSE),
stoch_start = NULL,
ratemat_args = NULL,
step_args = list(),
ode_args = list(),
use_ode = FALSE,
condense = TRUE,
condense_args = NULL,
verbose = FALSE,
use_flex = FALSE,
flexmodel = NULL,
obj_fun = NULL
)
params |
named vector of parameters |
state |
named vector of states |
start_date |
starting date (Date or character, any sensible D-M-Y format) |
end_date |
ending date (ditto) |
params_timevar |
four-column data frame containing columns 'Date'; 'Symbol' (parameter name/symbol); 'Value'; and 'Type' ( |
dt |
time step for |
ndt |
number of internal time steps per time step |
stoch |
a logical vector with elements "obs" (add obs error?) and "proc" (add process noise?) |
stoch_start |
dates on which to enable stochasticity (vector of dates with names 'proc' and 'obs') |
ratemat_args |
additional arguments to pass to |
step_args |
additional arguments to pass to |
ode_args |
additional arguments to |
use_ode |
integrate via ODE rather than discrete step? |
condense |
if |
condense_args |
arguments to pass to |
verbose |
print messages (e.g. about time-varying parameters)? |
use_flex |
use |
flexmodel |
optional |
obj_fun |
optional TMB objective function computed with
|
Other classic_macpan:
add_d_log()
,
add_updated_vaxrate()
,
aggregate_agecats()
,
calibrate_comb()
,
calibrate()
,
check_age_cat_compatibility()
,
check_contact_rate_setting()
,
col_multiply()
,
condense_age()
,
condense_params_vax()
,
condense_state()
,
condense_vax()
,
dev_is_tikz()
,
do_step()
,
expand_params_age()
,
expand_params_desc_age()
,
expand_params_desc_variant()
,
expand_params_desc_vax()
,
expand_params_mistry()
,
expand_params_variant()
,
expand_params_vax()
,
expand_state_age()
,
expand_state_vax()
,
expand_stateval_testing()
,
fix_pars()
,
fix_stored()
,
forecast_ensemble()
,
forecast_sim()
,
getData()
,
get_GI_moments()
,
get_Gbar()
,
get_R0()
,
get_doses_per_day()
,
get_evec()
,
get_kernel_moments()
,
get_opt_pars()
,
get_r()
,
invlink_trans()
,
make_betavec()
,
make_beta()
,
make_jac()
,
make_ratemat()
,
make_state()
,
make_test_wtsvec()
,
make_vaxrate()
,
mk_Nvec()
,
mk_agecats()
,
mk_contact_rate_setting()
,
mk_mistry_Nvec()
,
mk_pmat()
,
mk_vaxcats()
,
mle_fun()
,
non_expanded_states
,
rExp()
,
read_params()
,
repair_names_age()
,
restore()
,
run_sim_ageify()
,
run_sim_break()
,
run_sim_loglin()
,
run_sim_mobility()
,
run_sim_range()
,
show_ratemat()
,
testify()
,
texify()
,
trans_state_vars()
,
update_contact_rate_setting()
,
update_foi()
,
update_params_mistry()
,
vis_model()
,
write_params()
params <- read_params("ICU1.csv")
paramsS <- update(params,c(proc_disp=0.1,obs_disp=100))
paramsSz <- update(paramsS, zeta=5)
state <- make_state(params=params)
time_pars <- data.frame(Date=c("2020-03-20","2020-03-25"),
Symbol=c("beta0","beta0"),
Relative_value=c(0.7,0.1),
stringsAsFactors=FALSE)
res1 <- run_sim(params,state,start_date="2020-02-01",end_date="2020-06-01")
res1X <- run_sim(params,state,start_date="2020-02-01",end_date="2020-06-01",
condense_args=list(keep_all=TRUE))
res1_S <- update(res1, params=paramsS, stoch=c(obs=TRUE, proc=TRUE))
res1_t <- update(res1, params_timevar=time_pars)
res1_S_t <- update(res1_S, params_timevar=time_pars)
res2_S_t <- update(res1_S_t,params=update(paramsS, proc_disp=0.5))
res3_S_t <- update(res2_S_t,stoch_start="2020-04-01")
res3_Sz <- update(res1_S, params=paramsSz)
plot(res3_Sz,log=TRUE,log_lwr=1e-4)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.