Checks and prepares a `par_tab` table for use by `simulate_data()` or the MCMC fitting workflow in `serosolver()`. The table supplies parameter names, starting values, fixed values, bounds, and parameter types. When required, the function adds default proposal steps, adds missing version-1 `phi` rows, or removes `phi` rows that are not used by prior versions 2–4. It also checks the infection-history prior parameters and the bounds used for random starting values.
check_par_tab(
par_tab,
mcmc = FALSE,
version = NULL,
possible_exposure_times = NULL,
verbose = FALSE
)A data frame containing the model parameter table. It must contain `names`, `values`, `fixed`, `lower_bound`, `upper_bound`, `lower_start`, `upper_start`, and `par_type`. A missing `par_type` column is added with value 1 when possible. To use exponential waning, add one fixed row named `exponential_waning` with `par_type = 0` and `values = 1`.
Logical; if `TRUE`, also prepares and checks fields required by the MCMC algorithm. Use `FALSE` when checking a table for simulation.
Optional infection-history prior version. If omitted, version 2 is used, matching the default in `serosolver()`. Version 1 is the phi-based prior; versions 2–4 use the newer prior formulations. This argument is mainly used internally when `serosolver()` or `create_posterior_func()` passes a selected prior version.
Optional vector of possible exposure times. For version 1, this is used to ensure that the table has one `phi` row for each possible exposure time.
Logical; if `TRUE`, print messages when optional columns are added or version-specific rows are changed.
The checked parameter table, with any required default columns or version-specific rows added or removed.
Other check_inputs:
check_attack_rates(),
check_data(),
check_demographics(),
check_inf_hist(),
check_proposals()
data(example_par_tab)
checked_par_tab <- check_par_tab(example_par_tab)
checked_par_tab_mcmc <- check_par_tab(example_par_tab, mcmc = TRUE)