prepares posterior distribution for 'bridgesampling' by removing unnecessary parameters and attaching lower and upper bounds of parameters based on a list of prior distributions.

JAGS_bridgesampling_posterior(
  posterior,
  prior_list,
  add_parameters = NULL,
  add_bounds = NULL
)

Arguments

posterior

matrix of mcmc samples from the posterior distribution.

prior_list

named list of prior distributions. Names correspond to parameter names owned by BayesTools priors and determine the posterior columns retained for bridge sampling together with their bounds.

add_parameters

character vector of additional monitored posterior parameter names to retain in addition to the prior-owned parameters. These parameters are passed through as named entries and must be indexed by name by downstream likelihood code.

add_bounds

list with two named numeric vectors, "lb" and "ub", containing lower and upper bounds for every add_parameters entry. The vectors are named by the add_parameters entries (every entry, no others), contain no NA, and satisfy lb < ub; -Inf and Inf are allowed. Must be supplied whenever add_parameters is non-empty.

Value

JAGS_bridgesampling_posterior returns a matrix of posterior samples with 'lb' and 'ub' attributes carrying the lower and upper boundaries.