R/sim_funs.R
make_jac.Rdconstruct Jacobian matrix for ICU model (not quite complete: doesn't include flows to R)
make_jac(params, state = NULL)parameter vector
state vector (named)
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_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()
params <- read_params("ICU1.csv")
state <- make_state(params[["N"]],E0=params[["E0"]], use_eigvec=FALSE)
## state[c("E","Ia","Ip","Im","Is")] <- 1
state[["E"]] <- 1
J <- make_jac(params,state)
J["S","S"]
#> [1] 0
Jr <- J[1:6,1:6]
round(Jr,3)
#> to
#> from S E Ia Ip Im Is
#> S 0 0.000 -0.667 -1.000 -1.000 -1.000
#> E 0 -0.192 0.667 1.000 1.000 1.000
#> Ia 0 0.064 -0.143 0.000 0.000 0.000
#> Ip 0 0.128 0.000 -2.000 0.000 0.000
#> Im 0 0.000 0.000 1.912 -0.143 0.000
#> Is 0 0.000 0.000 0.088 0.000 -0.175
eigen(Jr)$values
#> [1] -1.9941503 -0.5979562 0.2558539 -0.1737373 -0.1428571 0.0000000
make_jac(params)
#> to
#> from S E Ia Ip Im Is H H2 ICUs
#> S 0 0.00000000 -0.6666667 -1.000 -1.0000000 -1.00000000 0.0 0.0 0.00
#> E 0 -0.19230769 0.6666667 1.000 1.0000000 1.00000000 0.0 0.0 0.00
#> Ia 0 0.06410256 -0.1428571 0.000 0.0000000 0.00000000 0.0 0.0 0.00
#> Ip 0 0.12820513 0.0000000 -2.000 0.0000000 0.00000000 0.0 0.0 0.00
#> Im 0 0.00000000 0.0000000 1.912 -0.1428571 0.00000000 0.0 0.0 0.00
#> Is 0 0.00000000 0.0000000 0.088 0.0000000 -0.17482517 0.0 0.0 0.00
#> H 0 0.00000000 0.0000000 0.000 0.0000000 0.13286713 -0.1 0.0 0.00
#> H2 0 0.00000000 0.0000000 0.000 0.0000000 0.00000000 0.0 -0.2 0.05
#> ICUs 0 0.00000000 0.0000000 0.000 0.0000000 0.02097902 0.0 0.0 -0.05
#> ICUd 0 0.00000000 0.0000000 0.000 0.0000000 0.02097902 0.0 0.0 0.00
#> D 0 0.00000000 0.0000000 0.000 0.0000000 0.00000000 0.0 0.0 0.00
#> R 0 0.00000000 0.1428571 0.000 0.1428571 0.00000000 0.1 0.2 0.00
#> X 0 0.00000000 0.0000000 0.000 0.0000000 0.00000000 0.0 0.0 0.00
#> V 0 0.00000000 0.0000000 0.000 0.0000000 0.00000000 0.0 0.0 0.00
#> to
#> from ICUd D R X V
#> S 0.000 0 0 0 0
#> E 0.000 0 0 0 0
#> Ia 0.000 0 0 0 0
#> Ip 0.000 0 0 0 0
#> Im 0.000 0 0 0 0
#> Is 0.000 0 0 0 0
#> H 0.000 0 0 0 0
#> H2 0.000 0 0 0 0
#> ICUs 0.000 0 0 0 0
#> ICUd -0.125 0 0 0 0
#> D 0.125 0 0 0 0
#> R 0.000 0 0 0 0
#> X 0.000 0 0 0 0
#> V 0.000 0 0 0 0