negative log-likelihood function
parameter vector (in unlisted form)
a data set to compare to, containing date/var/value (current version assumes that only a single state var is included)
print debugging messages?
plot debugging curves? (doesn't work with parallel DEoptim)
keep information on parameter history?
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
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)
starting date for sims (far enough back to allow states to sort themselves out)
ending date
arguments passed to sim_fun
additional arguments to pass to
run_sim
function for simulating a single run
(e.g. run_sim_break
,
run_sim_mobility
)
save file containing call information?
arguments passed to
aggregate.pansim
a list of tilde-delimited expressions giving prior
distributions expressed in terms of the elements of
opt_pars
,
e.g. list(~dlnorm(rel_beta0[1],meanlog=-1,sd=0.5))
value to add to NLL for NA values in log-likelihood
unused (but useful in case junk needs to be discarded)
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()
,
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()
library(dplyr)
p <- read_params("ICU1.csv")
op <- get_opt_pars(p)
dd <- ont_all %>% trans_state_vars() %>% filter(var %in% c("H","death"))
mle_fun(p=unlist(op), dd, opt_pars=op, base_params=p)
#> [1] 318.4274
op <- op["params"] ## exclude log_nb_disp
try(mle_fun(p=unlist(op), dd, opt_pars=op, base_params=p))
#> Error in mle_fun(p = unlist(op), dd, opt_pars = op, base_params = p) :
#> dispersion params must be specified in opt_pars *or* parameters
p2 <- update(p, obs_disp=2)
mle_fun(p=unlist(op), dd, opt_pars=op, base_params=p2)
#> [1] 875.1008
p3 <- update(p, obs_disp_H=2, obs_disp_death=2)
mle_fun(p=unlist(op), dd, opt_pars=op, base_params=p3)
#> [1] 875.1008