TPmodel: Function to create a JAGS-based Bayesian model to calculate...

TPmodelR Documentation

Function to create a JAGS-based Bayesian model to calculate trophic position

Description

This function is a wrapper of jags.model. It receives an isotopeData class object containing the data, a model string returned by either jagsOneBaseline, jagsTwoBaselines, jagsTwoBaselinesFull or jagsBayesianModel, and creates a JAGS model object.

Usage

TPmodel(
  data = NULL,
  model.string = NULL,
  n.chains = 2,
  n.adapt = 10000,
  quiet = FALSE,
  ...
)

Arguments

data

a list containing the data.

model.string

model string containing a description of the model.

n.chains

number of parallel chains for the model.

n.adapt

number of iterations for adaptation (initial sampling phase)

quiet

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

...

additional arguments passed to jags.model.

Value

TPmodel returns an object inheriting from class jags which can be used to generate dependent samples from the posterior distribution of the parameters

Examples

## Not run: 
isotopeData <- generateTPData()
model.string <- jagsBayesianModel()
model <- TPmodel(data = isotopeData, model.string = model.string,
n.adapt = 500)

## End(Not run)

AndrewLJackson/tRophicPosition documentation built on Jan. 2, 2023, 12:14 p.m.