Learn R Programming

tRophicPosition (version 0.8.0)

posteriorTP: Function to generate posterior samples of a trophic position JAGS model

Description

This is a wrapper of coda.samples which in turn, is a wrapper of jags.samples. It extracts random samples from the posterior distribution of the parameters of a jags model.

Usage

posteriorTP(
  model,
  variable.names = c("TP", "muDeltaN"),
  n.iter = 10000,
  burnin = NULL,
  thin = 10,
  quiet = FALSE,
  ...
)

Value

mcmc.list object containing posterior samples of the Bayesian model.

Arguments

model

a JAGS model object returned by any of functions jagsOneBaseline, jagsTwoBaselines, jagsTwoBaselinesFull or jagsBayesianModel

variable.names

vector of characters giving the names of variables to be monitored.

n.iter

integer defining the number of iterations. By default is 10000

burnin

number of iterations discarded as burn in.

thin

thinning interval to get posterior samples.

quiet

logical value to indicate whether messages generated during posterior sampling will be suppressed, as well as the progress bar.

...

additional arguments passed to coda.samples.

Examples

Run this code
if (FALSE) {
isotopeData <- generateTPData()
model.string <- jagsBayesianModel()
model <- TPmodel(data = isotopeData, model.string = model.string,
n.adapt = 500)
posterior.samples <- posteriorTP(model, n.iter = 500)
}

Run the code above in your browser using DataLab