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

load_infection_chains(
  location = getwd(),
  thin = 1,
  burnin = 0,
  chain_subset = NULL
)

Arguments

location

defaults to current working directory. Where to look for MCMC chains? These are files ending in "_infection_histories.csv"

thin

thin the chains by every thin'th sample

burnin

discard the first burnin samples from the MCMC chain

chain_subset

if not NULL, a vector of indices to only load and store a subset of the chains detected. eg. chain_subset = 1:3 means that only the first 3 detected files will be processed.

Value

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

See also

Examples

if (FALSE) load_infection_chains(thin=10,burnin=5000,chain_subset=1:3)