Skip to contents

Test multiple sets of parameters randomly drawn from range between maximum and minimum values in order to find approximate values giving maximum posterior likelihood

Usage

mcmc_prelim_fit(
  n_iterations = 1,
  n_param_sets = 1,
  n_bounds = 1,
  log_params_min = NULL,
  log_params_max = NULL,
  input_data = list(),
  obs_sero_data = list(),
  obs_case_data = list(),
  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 = TRUE,
  mode_parallel = FALSE,
  cluster = NULL,
  plot_graphs = FALSE
)

Arguments

n_iterations

= Number of times to run and adjust maximum/minimum

n_param_sets

= Number of parameter sets to run in each iteration

n_bounds

= Number of parameter sets (with highest likelihood values) to take at each iteration to create new maximum/minimum values

log_params_min

Initial lower limits of estimated parameter values (natural logarithm of actual limits)

log_params_max

Initial upper limits of estimated parameter values (natural logarithm of actual limits)

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

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 = "norm", prior probability is given by dnorm 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)

dt

time increment in days (must be 1 or 5)

n_reps

Number of repetitions

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

plot_graphs

TRUE/FALSE - plot graphs of evolving parameter space '

Details

This function is used to estimate the model parameter values giving maximum posterior likelihood; it is primarily intended to be used to generate initial parameter values for Markov Chain Monte Carlo fitting (using the mcmc() function).