load_mcmc_chains: Combine theta and infection history chains

View source: R/analysis.R

load_mcmc_chainsR Documentation

Combine theta and infection history chains

Description

Reads in all MCMC chains for theta and infection histories from the specified directory, adding in the total number of infections

Usage

load_mcmc_chains(
  location = getwd(),
  par_tab = NULL,
  estimated_only = FALSE,
  thin = 1,
  burnin = 0,
  convert_mcmc = FALSE
)

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

estimated_only

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 of the concatenated and individual chains (4 elements, either data frames of coda::mcmc objects)

See Also

Other load_data_functions: load_antibody_data(), load_antigenic_map_file(), load_infection_chains(), load_start_tab(), load_theta_chains()

Examples

## Not run: load_mcmc_chains(par_tab=par_tab, estimated_only=TRUE,thin=10,burnin=5000,convert_mcmc=TRUE)

seroanalytics/serosolver documentation built on Dec. 14, 2024, 5:33 a.m.