Skip to contents

Combined MCMC Multi-Region - series of MCMC iterations for one or more regions

Usage

MCMC(
  log_params_ini = c(),
  input_data = list(),
  obs_sero_data = NULL,
  obs_case_data = NULL,
  filename_prefix = "Chain",
  Niter = 1,
  mode_start = 0,
  prior_settings = list(type = "zero"),
  dt = 1,
  n_reps = 1,
  enviro_data = list(),
  p_severe_inf = 0.12,
  p_death_severe_inf = 0.39,
  add_values = list(vaccine_efficacy = 1, p_rep_severe = 1, p_rep_death = 1, m_FOI_Brazil
    = 1),
  deterministic = FALSE,
  mode_parallel = FALSE,
  cluster = NULL
)

Arguments

log_params_ini

Initial values of parameters to be estimated. These should always be the log() values of the actual parameters, ordered as follows:
1) A number of environmental coefficients used to calculate spillover force of infection values from environmental covariates equal to the number of environmental covariates listed in the enviro_data frame. Values should be in the order of the columns in the environmental data frame.
2) A number of environmental coefficients used to calculate basic reproduction number values from environmental covariates equal to the number of environmental covariates listed in the enviro_data frame. Values should be in the order of the columns in the environmental data frame.
3) Values of the additional parameters (reported vaccination effectiveness vaccine_efficacy, severe case reporting probability p_rep_severe, and fatal case reporting probability p_rep_death, and Brazil spillover FOI multiplier m_FOI_Brazil); if these are to be estimated, in the order vaccine_efficacy->p_rep_severe->p_rep_death->m_FOI_Brazil. If these parameters are to be estimated, the values separately supplied to this function (see add_values below) should be set to NA.

input_data

List of population and vaccination data for multiple regions (created using data input creation code and usually loaded from RDS file)

obs_sero_data

Seroprevalence data for comparison, by region, year & age group, in format no. samples/no. positives

obs_case_data

Annual reported case/death data for comparison, by region and year, in format no. cases/no. deaths

filename_prefix

Prefix of names for output files; function outputs a CSV file every 10,000 iterations with a name in the format: "(filename_prefix)XX.csv", e.g. Chain00.csv

Niter

Total number of iterations to run

mode_start

Flag indicating how to set initial population immunity level in addition to vaccination
If mode_start = 0, only vaccinated individuals
If mode_start = 1, shift some non-vaccinated individuals into recovered to give herd immunity (uniform by age, R0 based only)
If mode_start = 3, shift some non-vaccinated individuals into recovered to give herd immunity (stratified by age)

prior_settings

List containing settings for priors: must contain text named "type": If type = "zero", prior probability is always zero
If type = "flat", prior probability is zero if log parameter values in designated ranges param_min_limits and param_max_limits, -Inf otherwise; param_min_limits and param_max_limits included in prior_settings as vectors of same length as log_params_ini
If type = "norm", prior probability is given by truncated normal distribution calculation on parameter values with settings based on vectors of values in prior_settings:
norm_params_mean and norm_params_sd (vectors of mean and standard deviation values applied to log FOI/R0 parameters and to actual values of additional parameters)
+ FOI_mean + FOI_sd (mean + standard deviation of computed FOI, single values)
+ R0_mean + R0_sd (mean + standard deviation of computed R0, single values)
+ param_min_limits and param_max_limits (lower and upper limits applied to truncated normal distributions)

dt

time increment in days (must be 1 or 5)

n_reps

Number of times to repeat calculations to get average likelihood at each iteration

enviro_data

Data frame of values of environmental covariates (columns) by region (rows)

p_severe_inf

Probability of an infection being severe

p_death_severe_inf

Probability of a severe infection resulting in death

add_values

List of parameters in addition to those governing FOI/R0, either giving a fixed value or giving NA to indicate that they are part of the fitted parameter set
vaccine_efficacy Vaccine efficacy (proportion of reported vaccinations causing immunity) (must be present)
p_rep_severe Probability of observation of severe infection
p_rep_death Probability of observation of death
m_FOI_Brazil Multiplier of spillover FOI for Brazil regions (only relevant if regions in Brazil to be considered)

deterministic

TRUE/FALSE - set model to run in deterministic mode if TRUE

mode_parallel

TRUE/FALSE - indicate whether to use parallel processing on supplied cluster for speed

cluster

Cluster of threads to use if mode_parallel = TRUE '

Details

This is the master function for running a Markov chain to optimize the parameters of the yellow fever model based on the calculated likelihood of observing supplied data given a particular set of parameters.