run a pure-exponential sim; uses run_sim_range with a population of 1 (proportions) and a very small starting value, run for 100 steps (by default) used to calculate either r (technically r0) or eigenvector (for distributing initial exposed across states)

rExp(
  params,
  steps = getOption("MP_rexp_steps_default"),
  ndt = 1,
  do_hazard = FALSE,
  state = NULL,
  testify = has_testing(params = params),
  return_val = c("r0", "eigenvector", "sim"),
  type = "ICU1"
)

Arguments

params

parameters

steps

number of steps to run

ndt

sub-time steps

do_hazard

run with hazard

state

initial state as created by make_state. Leave as NULL to create state from params (??)

testify

testing compartments

return_val

return growth rate or eigenvector?

type

model type (passed to make_state)

Examples

pp <- read_params("PHAC_testify.csv")
rExp(pp)
#> Warning: CHECK: may not be working properly for testify?
#> Warning: the exponential simulation has not converged: please iterate for more steps.
#> [1] 0.2614623
rExp(pp,return_val="eigenvector")
#> Warning: CHECK: may not be working properly for testify?
#>          S_u          S_p          S_n          S_t          E_u          E_p 
#> 1.896206e-07 0.000000e+00 1.516964e-10 0.000000e+00 5.836112e-01 1.340307e-04 
#>          E_n          E_t         Ia_u         Ia_p         Ia_n         Ia_t 
#> 3.328891e-04 5.396956e-05 1.496804e-01 6.441082e-05 5.535675e-05 4.879847e-05 
#>         Ip_u         Ip_p         Ip_n         Ip_t         Im_u         Im_p 
#> 9.370669e-02 3.105751e-05 4.391633e-05 1.541096e-05 1.613725e-01 4.889444e-04 
#>         Im_n         Im_t         Is_u         Is_p         Is_n         Is_t 
#> 4.922923e-05 2.919833e-04 6.947143e-03 2.024226e-05 2.168249e-06 1.141896e-05 
#>          H_u          H_p          H_n          H_t         H2_u         H2_p 
#> 2.568763e-07 1.386182e-03 4.313795e-07 8.330210e-04 1.049726e-08 2.280085e-05 
#>         H2_n         H2_t       ICUs_u       ICUs_p       ICUs_n       ICUs_t 
#> 7.095606e-09 3.407923e-05 7.365822e-08 3.501440e-04 1.089647e-07 2.389421e-04 
#>       ICUd_u       ICUd_p       ICUd_n       ICUd_t 
#> 1.918730e-08 1.097061e-04 3.414049e-08 6.221567e-05 
rExp(pp,return_val="eigenvector",testify=TRUE)
#> Warning: CHECK: may not be working properly for testify?
#>          S_u          S_p          S_n          S_t          E_u          E_p 
#> 1.896206e-07 0.000000e+00 1.516964e-10 0.000000e+00 5.836112e-01 1.340307e-04 
#>          E_n          E_t         Ia_u         Ia_p         Ia_n         Ia_t 
#> 3.328891e-04 5.396956e-05 1.496804e-01 6.441082e-05 5.535675e-05 4.879847e-05 
#>         Ip_u         Ip_p         Ip_n         Ip_t         Im_u         Im_p 
#> 9.370669e-02 3.105751e-05 4.391633e-05 1.541096e-05 1.613725e-01 4.889444e-04 
#>         Im_n         Im_t         Is_u         Is_p         Is_n         Is_t 
#> 4.922923e-05 2.919833e-04 6.947143e-03 2.024226e-05 2.168249e-06 1.141896e-05 
#>          H_u          H_p          H_n          H_t         H2_u         H2_p 
#> 2.568763e-07 1.386182e-03 4.313795e-07 8.330210e-04 1.049726e-08 2.280085e-05 
#>         H2_n         H2_t       ICUs_u       ICUs_p       ICUs_n       ICUs_t 
#> 7.095606e-09 3.407923e-05 7.365822e-08 3.501440e-04 1.089647e-07 2.389421e-04 
#>       ICUd_u       ICUd_p       ICUd_n       ICUd_t 
#> 1.918730e-08 1.097061e-04 3.414049e-08 6.221567e-05