fit_escroc: Fit the model

Description Usage Arguments Value References Examples

Description

This is the core funtion of the packages. It fits the model ESCROC using run.jags and returns an mcmc.list object. ESCROC was described in Ballutaud et al. (in press).

Usage

1
2
fit_escroc(mydata, mymodel, burnin = 1000, sample = 1000,
  adapt = 1000, method = "parallel", ...)

Arguments

mydata

a list as returned by function prepare_data

mymodel

a string describing the model as build by building_model

burnin

number of burnin iterations

sample

number of iterations that will be saved for inference

adapt

number of iterations for adaptive phase, if not sufficient a warning will be thrown

method

methods to parallize the MCMC chains, see run.jags for further details

...

additionnal arguments that will be sent to run.jags

Value

a mcmc.list storing the 3 MCMC

References

Ballutaud et al. (in press) EStimating Contaminants tRansfers Over Complex food webs (ESCROC): an innovative Bayesian method for estimating POP's biomagnification in aquatic food webs. Science of the Total Environment

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
#importing data
data(signature_data)
data(prior_diet_matrix)
data(LOQ)
data(prior_signature_data)
prior_delta <- data.frame(tracer=c("X15N","X13C"),mean=c(3,0),sd=c(1,1))

#check that everything is ok
mydata <- prepare_data(prior_diet_matrix,signature_data,
LOQ,prior_signature_data,prior_delta)

#build the model
mymodel <- building_model(mydata)

#fit the model
myresults <- fit_escroc(mydata, mymodel)

#a summary of the results
library(coda)
summary(myresults)$qua

Irstea/escroc documentation built on May 17, 2019, 7:43 a.m.