run_all: wrapper for running and postprocessing MCMC chain

View source: R/mcmc_run_all.R

run_allR Documentation

wrapper for running and postprocessing MCMC chain

Description

wrapper for running and postprocessing MCMC chain

Usage

run_all(
  starting_pars = NULL,
  starting_point_seed,
  filenames,
  run_flags = c(run = TRUE, process = TRUE),
  run_parallel = TRUE,
  mvr = TRUE,
  mvr_init = NULL,
  specify_parameters,
  get_data,
  CREATE_POSTERIOR_FUNC,
  CREATE_PRIOR_FUNC,
  mcmcPars = gen_mcmcPars(),
  mcmc_seed = NULL,
  generate_start_values = function(x, y, z) generate_random_start(x, y),
  gen_summary_statistics = NULL,
  calc_residuals = NULL,
  get_prediction_ci_df = NULL,
  plot_flags = c(trace = TRUE, diagnostics = TRUE, priors = TRUE, posteriors = TRUE,
    bivariate = FALSE),
  plot_dynamics = NULL,
  plot_residuals = NULL
)

Arguments

starting_pars

NULL for randomly generated start values, or n_replicates by n_temperatures list of vectors of length n_pars, where n_pars is the number of parameters, n_replicates is the number of parallel chains to run to assess convergence, and n_temperatures is the number of temperatures used for parallel tempering. If no parallel tempering, use an n_replicates list of vectors of length n_pars

starting_point_seed

list of n_replicates vectors, each of length n_temperatures, used for random number generator for generating starting point for each chain.

filenames

vector of n_replicates filenames in which to store results (without extension)

run_flags

logical vector with elements run: run MCMC if TRUE process: read in a process MCMC chain if TRUE

run_parallel

logical. Whether to run calculations in parallel

mvr

logical. if TRUE, use multivariate proposal, else use univariate proposal

mvr_init

list of parameters for multivariate proposal. if NULL, use defaults

specify_parameters

closure to specify parameters by generating the parTab data frame.

mcmcPars

list of tuning parameters for MCMC

mcmc_seed

list of length n_replicates, each element being an integer. Used to seed RNG for MCMC. if NULL, use default

generate_start_values

closure to generate starting parameter values if starting_pars = NULL

gen_summary_statistics

closure. NULL or function to calculate summary statistics

calc_residuals

closure. NULL or function to calculate residuals

get_prediction_ci_df

closure. NULL or function to calculate credible intervals for model predictions

generate_data_and_posterior

closure to load data and create the function used to evaluate the likelihood.


ada-w-yan/deltaomicron1 documentation built on June 24, 2022, 5:41 a.m.