MCMC_fit_single: Bottom level MCMC wrapper function

Description Usage Arguments Value See Also

View source: R/mcmc_wrapper_2.R View source: R/mcmc_wrapper_script.R

Description

Calls the run_metropolis_MCMC function to carry out the MCMC algorithm. This function handles parallelisation of chains and some basic formatting.

Usage

1
2
3
4
MCMC_fit_single(data, param_table, iterations = 1000, opt_freq = 50,
  thin = 50, burnin = 100, adaptive_period = 1, nchain = 1,
  popt = 0.44, tmp_filename, LIKELIHOOD_FUNCTION, MODEL_FUNCTION,
  VERBOSE = FALSE, PARALLEL = FALSE)

Arguments

data

the data over which to calculate likelihoods

param_table

table of parameter data as specified in load_param_table

iterations

number of iterations for the MCMC algorithm

opt_freq

how frequently the acceptance rate is adapted. Defaults to 50

thin

thinning value for the MCMC chain. Default is 50

burnin

the length of the burn in period. Defaults to 100

adaptive_period

length of the adaptive period. Defaults to 1

nchain

number of chains to run

popt

the desired acceptance rate. Defaults to 0.44

tmp_filename

the generic file name/location at which to save the MCMC chains. Note that the file extension will be appended to this string

LIKELIHOOD_FUNCTION

a valid pointer to an R function which returns a single, log likelihood of the data given the current parameters

MODEL_FUNCTION

a valid pointer to an R function which is used to evaluate the model for the current set of parameters

VERBOSE

boolean flag for additional output. Defaults to FALSE

PARALLEL

OPTIONAL boolean flag indicating if each MCMC chain should be run in parallel using doPar. Defaults to FALSE

Value

returns a list containing the whole MCMC chains, MCMC summary objects (from coda), the file locations of the MCMC chains, and the maximum likelihood parameters

See Also

run_metropolis_MCMC


jameshay218/mcmcJH documentation built on May 18, 2019, 11:20 a.m.