Compute "Rt" for a set of simulated trajectories (e.g., the result of dust::dust_iterate(), mcstate::pmcmc() or mcstate::pmcmc_predict(). The trajectories may or may not share parameters.

carehomes_Rt_trajectories(
  step,
  S,
  pars,
  initial_step_from_parameters = TRUE,
  shared_parameters = NULL
)

Arguments

step

A vector of steps

S

A 3d (19 x n trajectories x n steps) array of "S" compartment counts

pars

Either a single carehomes_parameters() object (shared parameters) or an unnamed list of carehomes_parameters() objects, the same length as ncol(S).

initial_step_from_parameters

If TRUE, then step[[1]] is replaced by the value of initial_step from the parameters. This is usually what you want.

shared_parameters

Should pars be treated as a single shared list? Leave as NULL to detect automatically, set to TRUE or FALSE to force it to be interpreted one way or the other which may give more easily interpretable error messages.

Value

As for carehomes_Rt(), except that every element is a matrix, not a vector.