simmr_fitsims: Fits a simmr model to a randomly generated data-set

Description Usage Arguments Details Value Author(s)

View source: R/simmr_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
simmr_fitsims(n, tracer_means, tracer_sds, snames, smeans, ssds, sdmult = 1,
  seed = 42, mcmc.control = list(iter = 50000, burn = 2000, 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.

smeans

A numeric vector giving means of the sources

ssds

A numeric vector giving SDs of the mixes

sdmult

A numeric that is multiplied by source SDs

mcmc.control

A list giving parameters for the MCMC chains.

sdmult

A numeric giving the random seed

priorcontrol

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

Details

The mixes and sampled randomly from normal distributions. Make sure the means and SDs of mixes and sources are given in the same order (e.g. Carbon then Nitrogen for all of them). Fixing the seed is useful if you want to compare runs across different SDs, because the random samples will have the same pattern deviations. See simmr::simmr_load simmr::simmr_mcmc for more details of how the data is fit.

Value

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

Author(s)

Christopher J. Brown


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