adjust pars to match targets

fix_pars(
  params,
  target = c(r = 0.23, Gbar = 6),
  pars_adj = list("beta0", c("sigma", "gamma_s", "gamma_m", "gamma_a")),
  r_method = c("expsim", "rmult"),
  u_interval = c(-3, 3),
  debug = FALSE
)

Arguments

params

a parameter vector

target

target values for one or more epidemic moments

pars_adj

list of sets of parameters to adjust

r_method

method for fixing r (brute-force exponential simulation or JD's kernel-based approach?)

u_interval

interval for uniroot adjustment

debug

debug?

Examples

pp <- read_params("ICU1.csv")
summary(pp)
#>         r0         R0       Gbar    CFR_gen   dbl_time 
#>  0.2278149  6.5180089 12.1897402  0.0352000  3.0425898 
pp2 <- fix_pars(pp,debug=TRUE)
#>   Nelder-Mead direct search function minimizer
#> function value for initial parameters = 38.312888
#>   Scaled convergence tolerance is 5.70907e-07
#> Stepsize computed as 0.100000
#> BUILD              3 38.313104 25.347254
#> LO-REDUCTION       5 38.312888 25.347254
#> EXTENSION          7 25.347486 9.272902
#> EXTENSION          9 25.347254 4.799472
#> REFLECTION        11 9.272902 0.519104
#> REFLECTION        13 4.799472 0.007931
#> LO-REDUCTION      15 0.519104 0.007931
#> HI-REDUCTION      17 0.118932 0.007931
#> HI-REDUCTION      19 0.078348 0.007680
#> LO-REDUCTION      21 0.017933 0.007680
#> HI-REDUCTION      23 0.007931 0.004501
#> HI-REDUCTION      25 0.007680 0.000039
#> LO-REDUCTION      27 0.004501 0.000018
#> HI-REDUCTION      29 0.001087 0.000018
#> HI-REDUCTION      31 0.000251 0.000018
#> HI-REDUCTION      33 0.000053 0.000018
#> HI-REDUCTION      35 0.000039 0.000009
#> HI-REDUCTION      37 0.000018 0.000002
#> LO-REDUCTION      39 0.000009 0.000002
#> HI-REDUCTION      41 0.000004 0.000002
#> REFLECTION        43 0.000002 0.000001
#> HI-REDUCTION      45 0.000002 0.000000
#> Exiting from Nelder Mead minimizer
#>     47 function evaluations used
summary(pp2)
#>        r0        R0      Gbar   CFR_gen  dbl_time 
#> 0.2297113 3.1497921 6.0003859 0.0352000 3.0174706