forecast_sim: simulate/forecast a single trajectory

View source: R/calibrate.R

forecast_simR Documentation

simulate/forecast a single trajectory

Description

simulate based on a vector of parameters (including both time-varying change parameters, initial conditions, and other dynamical parameters), for fitting or forecasting

Usage

forecast_sim(
  p,
  opt_pars,
  base_params,
  start_date,
  end_date,
  time_args = NULL,
  fixed_pars = NULL,
  stoch = NULL,
  stoch_start = NULL,
  sim_args = list(),
  aggregate_args = NULL,
  condense_args = NULL,
  return_val = c("aggsim", "vals_only"),
  sim_fun = run_sim_break,
  calc_Rt = FALSE,
  debug = FALSE,
  ...
)

Arguments

p

vector of parameters - on the link (log/logit) scale as appropriate; these are the parameters that will be adjusted during calibration

opt_pars

starting parameters (and structure). Parameters that are part of the params_pansim parameter vector can be specified within the params element (with prefixes if they are transformed); other parameters can include distributional parameters or time-varying parameters

base_params

baseline parameters (an object (vector?) of type params_pansim containing all of the parameters needed for a simulation; some may be overwritten during the calibration process)

start_date

starting date for sims (far enough back to allow states to sort themselves out)

end_date

ending date

time_args

arguments passed to sim_fun

fixed_pars

parameters to fix

stoch

stochastic settings (see run_sim)

stoch_start

dates on which to enable stochasticity (vector of dates with names 'proc' and 'obs')

sim_args

additional arguments to pass to run_sim

aggregate_args

arguments passed to aggregate.pansim

condense_args

arguments to pass to condense (via run_sim)

return_val

specify values to return (aggregated simulation, or just the values?)

sim_fun

function for simulating a single run (e.g. run_sim_break, run_sim_mobility)

calc_Rt

calculate and include R(t) in prediction/forecast?

debug

print debugging messages?

...

extra args (ignored)

See Also

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(), 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(), run_sim(), show_ratemat(), testify(), texify(), trans_state_vars(), update_contact_rate_setting(), update_foi(), update_params_mistry(), vis_model(), write_params()

Examples

ff <- ont_cal1$forecast_args
op <- ff$opt_pars
p <- unlist(op)
params <- fix_pars(read_params("ICU1.csv"))
forecast_sim(p, op, base_params=params,ff$start_date, ff$end_date,
    time_args=ff$time_args)

bbolker/McMasterPandemic documentation built on Aug. 25, 2024, 6:35 p.m.