Skip to contents

S3 generic for computing reproduction numbers from fitted models

Usage

Rt(fitted_model, tau_max = 7, gi_dist, ...)

# S3 method for class 'ps'
Rt(fitted_model, tau_max = 7, gi_dist, ...)

# S3 method for class 'rw'
Rt(fitted_model, tau_max = 7, gi_dist, ...)

# S3 method for class 'ps_single'
Rt(fitted_model, tau_max = 7, gi_dist, ...)

# S3 method for class 'rw_single'
Rt(fitted_model, tau_max = 7, gi_dist, ...)

Arguments

fitted_model

Fitted model object with class `EpiStrainDynamics.fit`

tau_max

Integer maximum generation interval in days (default: 7)

gi_dist

Function that returns generation interval probability for given day

...

Additional arguments passed to metrics calculation

Value

named list of class `EpiStrainDynamics.metric` containing a dataframe of the calculated metric outcome (`$measure`), the fit object (`$fit`), and the constructed model object (`$constructed_model`). The `measure` data frame contains the median of the epidemiological quantity (`y`), the 50 interval of the quantity (`lb_50` & `ub_50`), the 95 (`lb_95` & `ub_95`), the proportion greater than a defined threshold value (`prop`), the pathogen name (`pathogen`), and the time label (`time`).

Examples

if (FALSE) { # \dontrun{
  mod <- construct_model(
    method = random_walk(),
    pathogen_structure = single(
      case_timeseries = sarscov2$cases,
      time = sarscov2$date))

  fit <- fit_model(mod)

  rt <- Rt(fit, tau_max = 7, gi_dist = function(x) 4*x*exp(-2*x))
} # }