mixsiar_fitsims: Fits a MixSIAR model to a randomly generated data-set

Description Usage Arguments Details Value Author(s)

View source: R/mixsiar_fitsims.R

Description

Useful for obtaining fits from a sequence of randomly simulated datasets. For instance, you could use this function to perform a sort of broad-sense power analysis to ask how many samples are required to obtain a specific confidence about an animal's diet.

Usage

1
2
3
mixsiar_fitsims(n, tracer_means, tracer_sds, snames, modelfile, mixsiardat,
  sdmult = 1, seed = 42, mcmc.control = list(iter = 50000, burn = 10000,
  thin = 10, n.chain = 4), prior.control = NULL)

Arguments

n

A integer giving the sample size to simulate.

tracer_means

A numeric vector giving means of the mixes.

tracer_sds

A numeric vector giving SDs of the mixes.

snames

A character giving source names.

modelfile

A character giving the location of the MixSIAR model filename.

mixsiardat

A list giving MixSIAR input data that will be modified for the re-run (should include objects mix, source, and disc, see the MixSIAR manual for further info).

sdmult

A numeric that is multiplied by source SDs

mcmc.control

A list giving parameters for the MCMC chains.

priorcontrol

A list with the means and standard deviations of the priors.

Details

The mixes and sampled randomly from normal distributions. Fixing the seed is useful if you want to compare runs across different SDs, because the random samples will have the same pattern deviations.

Value

A list where the first object gives the simulated data and the second object is a rjags object giving the model fit.

Author(s)

Christopher J. Brown


cbrown5/remixsiar documentation built on April 26, 2020, 12:40 a.m.