setup_and_run_MCMC: setup and run MCMC

View source: R/mcmc_setup.R

setup_and_run_MCMCR Documentation

setup and run MCMC

Description

setup and run MCMC

Usage

setup_and_run_MCMC(
  starting_pars = NULL,
  starting_point_seed,
  filenames,
  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)
)

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_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


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