scan_R0_date: Grid search of R0 and start date

View source: R/estimation.R

scan_R0_dateR Documentation

Grid search of R0 and start date

Description

Run a grid search of the particle filter over R0 and start date. This is parallelised, first run plan(multiprocess) to set this up.

Usage

scan_R0_date(
  R0_min,
  R0_max,
  R0_step,
  first_start_date,
  last_start_date,
  day_step,
  data,
  model_params,
  Rt_func = function(R0_change, R0, Meff) {     exp(log(R0) - Meff * (1 - R0_change)) },
  R0_prior = NULL,
  R0_change = NULL,
  date_R0_change = NULL,
  date_contact_matrix_set_change = NULL,
  date_ICU_bed_capacity_change = NULL,
  date_hosp_bed_capacity_change = NULL,
  squire_model = explicit_SEIR(),
  pars_obs = NULL,
  n_particles = 100
)

Arguments

R0_min

Minimum value of R0 in the search

R0_max

Maximum value of R0 in the search

R0_step

Step to increment R0 between min and max

first_start_date

Earliest start date as 'yyyy-mm-dd'

last_start_date

Latest start date as 'yyyy-mm-dd'

day_step

Step to increment date in days

data

Deaths data to fit to. See example_deaths.csv and particle_filter_data()

model_params

Squire model parameters. Created from a call to one of the parameters_<type>_model functions.

Rt_func

Function for converting R0, Meff and R0_change. Function must have names arguments of R0, Meff and R0_change. Default is linear relationship on the log scale given by exp(log(R0) - Meff*(1-R0_change)).

R0_prior

Prior for R0. Default = NULL, which is a flat prior. Should be provided as a list with first argument the distribution function and the second the function arguments (excluding quantiles which are worked out based on R0_min and R0_max), e.g. 'list("func" = dnorm, args = list("mean"= 3.5, "sd"= 3))'.

R0_change

Numeric vector for relative changes in R0. Default = NULL, i.e. no change in R0

date_R0_change

Calendar dates at which R0_change occurs. Defaut = NULL, i.e. no change in R0

date_contact_matrix_set_change

Calendar dates at which the contact matrices set in model_params change. Defaut = NULL, i.e. no change

date_ICU_bed_capacity_change

Calendar dates at which ICU bed capacity changes set in model_params change. Defaut = NULL, i.e. no change

date_hosp_bed_capacity_change

Calendar dates at which hospital bed capacity changes set in model_params change. Defaut = NULL, i.e. no change

squire_model

A squire model. Default = explicit_SEIR()

pars_obs

list of parameters to use for the comparison function.

n_particles

Number of particles. Positive Integer. Default = 100

Value

List of R0 and start date grid values, and normalised probabilities at each point


mrc-ide/squire documentation built on Sept. 10, 2022, 1:11 a.m.