mle_fun | R Documentation |
negative log-likelihood function
mle_fun(
p,
data,
debug = FALSE,
debug_plot = FALSE,
debug_hist = FALSE,
opt_pars,
base_params,
start_date = min(data$date),
end_date = max(data$date),
time_args = NULL,
sim_args = NULL,
sim_fun = run_sim_break,
checkpoint = FALSE,
aggregate_args = NULL,
priors = NULL,
na_penalty = 1e+06,
...
)
p |
parameter vector (in unlisted form) |
data |
a data set to compare to, containing date/var/value (current version assumes that only a single state var is included) |
debug |
print debugging messages? |
debug_plot |
plot debugging curves? (doesn't work with parallel DEoptim) |
debug_hist |
keep information on parameter history? |
opt_pars |
starting parameters (and structure). Parameters
that are part of the |
base_params |
baseline parameters (an object (vector?) of
type |
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_args |
additional arguments to pass to
|
sim_fun |
function for simulating a single run
(e.g. |
checkpoint |
save file containing call information? |
aggregate_args |
arguments passed to
|
priors |
a list of tilde-delimited expressions giving prior
distributions expressed in terms of the elements of
|
na_penalty |
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)
op <- op["params"] ## exclude log_nb_disp
try(mle_fun(p=unlist(op), dd, opt_pars=op, base_params=p))
p2 <- update(p, obs_disp=2)
mle_fun(p=unlist(op), dd, opt_pars=op, base_params=p2)
p3 <- update(p, obs_disp_H=2, obs_disp_death=2)
mle_fun(p=unlist(op), dd, opt_pars=op, base_params=p3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.