load_theta_chains: Load MCMC chains for theta

View source: R/analysis.R

load_theta_chainsR Documentation

Load MCMC chains for theta

Description

Searches the given working directory for MCMC outputs from run_MCMC, loads these in, subsets for burn in and thinning, and formats as both lists and a combined data frame.

Usage

load_theta_chains(
  location = getwd(),
  par_tab = NULL,
  unfixed = TRUE,
  thin = 1,
  burnin = 0,
  convert_mcmc = TRUE
)

Arguments

location

defaults to current working directory. Gives relative file path to look for files ending in "_chain.csv"

par_tab

if not NULL, can use this to only extract free model parameters

unfixed

if TRUE, only returns free model parameters (par_tab$fixed == 0) if par_tab specified

thin

thin the chains by every thin'th sample

burnin

discard the first burnin samples from the MCMC chain

convert_mcmc

if TRUE, converts everything to MCMC objects (from the 'coda' R package)

Value

a list with a) a list of each chain separately; b) a combined data frame, indexing each iteration by which chain it comes from

See Also

Other load_data_functions: load_antigenic_map_file(), load_infection_chains(), load_mcmc_chains(), load_start_tab(), load_titre_dat()

Examples

## Not run: load_theta_chains(par_tab=par_tab, unfixed=TRUE,thin=10,burnin=5000,convert_mcmc=TRUE)

seroanalytics/serosolver documentation built on April 24, 2023, 9:52 a.m.