Take a single simulation time step

do_step(
  state,
  params,
  ratemat,
  dt = 1,
  do_hazard = TRUE,
  stoch_proc = FALSE,
  do_exponential = FALSE,
  testwt_scale = "N"
)

Arguments

state

named vector of states

params

named vector of parameters

ratemat

transition matrix

dt

time step (days)

do_hazard

use hazard calculation?

stoch_proc

stochastic process error?

do_exponential

prevent outflow of susceptibles, to create a pure-exponential process?

testwt_scale

how to scale testing weights? "none"=use original weights as specified; "N" = multiply by (pop size)/(sum(wts*state[u_pop])); "sum_u" = multiply by (sum(state[u_pop])/(sum(wts*state[u_pop])))

Examples

params1 <- read_params("ICU1.csv")
state1 <- make_state(params=params1)
M <- make_ratemat(params=params1, state=state1)
s1A <- do_step(state1,params1, M, stoch_proc=TRUE)