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,
  params_data = list(),
  input_data = list(),
  obs_sero_data = list(),
  obs_case_data = list(),
  mode_start = 1,
  time_inc = 1,
  n_reps = 1,
  enviro_data_const = list(),
  enviro_data_var = list(),
  deterministic = TRUE,
  mode_time = 0,
  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

params_data

TBA

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 (stratified by age)
If mode_start = 2, use SEIRV input in list from previous run(s)

time_inc

time increment in days (must be 1 or 5)

n_reps

Number of repetitions

enviro_data_const

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

enviro_data_var

List containing values of time-varying environmental covariates (TBA)

deterministic

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

mode_time

TBA

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).