tmcmc: Mixed stock analysis by Markov Chain Monte Carlo

Description Usage Arguments Value Author(s) References Examples

View source: R/mixstock.R

Description

Runs a Gibbs sampler MCMC starting with 95% contribution from each source, then combines the chains

Usage

1
2
3
4
5
6
7
tmcmc(data, n.iter=20000, rseed=1001, n.burnin=floor(n.iter/2),
n.thin=max(1, floor(n.chains * (n.iter - n.burnin)/1000)),
verbose=FALSE, fprior=NULL,
contrib.only=TRUE, rptiter=-1,
outfile=NULL, lang="C",a=NULL,gr=FALSE)
gibbs(sourcesamp, mixsamp, a = 1, startiter, maxiter, startfval = NULL, 
    n.thin = 1, fprior = NULL, rptiter = -1) 

Arguments

data

Data: a mixstock.data object

n.iter

Total length of each chain

n.burnin

Number of burn-in iterations

n.thin

thinning rate. Must be a positive integer. Set 'n.thin' > 1 to save memory and computation time if 'n.iter' is large. Default is 'max(1, floor(n.chains * (n.iter-n.burnin) / 1000))' which will only thin if there are at least 2000 simulations.

rseed

Random-number seed

verbose

Produce lots of output

fprior

Bayesian prior for source contributions

contrib.only

To save memory, store only information about contributions from each source and not about the estimated marker frequencies in each source

rptiter

How often to issue a progress report. Negative numbers mean no reports

outfile

file to use for output

lang

Run the chain in C or R (for debugging/testing purposes only)?

a

prior strength parameter

gr

calculate Gelman-Rubin convergence statistic?

sourcesamp

matrix of marker samples from sources

mixsamp

vector of marker samples from mixed stock

startiter

starting iteration

maxiter

max. number of iterations

startfval

starting source contributions

Value

Returns an object of type mixstock.est

Author(s)

Ben Bolker

References

Masuda and Pella

Examples

1
2
3

mixstock documentation built on May 2, 2019, 6:48 p.m.