# functions for mixed stock analysis

## Documentation for package ‘mixstock’ version 0.9.2

## User Guides and Package Vignettes

Read overview or browse directory.

## Help Pages

A B C D E G H L M N P Q R S T U W

## -- A --

addlabels.barplot | add labels to a barplot
AIC.mixstock.est | commands for mixed stock analysis estimates
as.mcmc.bugs | convert from R2WinBUGS to CODA format
as.mixstock.data | class for marker data from sources and mixed stocks
as.mixstock.est | commands for mixed stock analysis estimates
as.mixstock.est.bugs | Convert BUGS or CODA objects to mixstock estimate object
as.mixstock.est.mcmc | Convert BUGS or CODA objects to mixstock estimate object

## -- B --

blockdiag | Block diagonal matrices
bolten98 | Loggerhead turtle data from Bolten 1998
bolten98raw | Loggerhead turtle data from Bolten 1998
boxplot.mixstock.est | commands for mixed stock analysis estimates
BUGS.out | generate MCMC output in BUGS format

## -- C --

calc.GR | Run chains and calculate Gelman and Rubin diagnostics for mixed stock analyses
calc.mult.GR | Calculate Gelman and Rubin diagnostic multiple times for mixed stock analyses
calc.mult.RL | Use Raftery and Lewis diagnostics to calculate MCMC chain lengths
calc.RL.0 | Use Raftery and Lewis diagnostics to calculate MCMC chain lengths
cml | Mixed stock analysis by conditional maximum likelihood
cml.grad | Likelihoods and gradients of stock analysis models
cml.lik | Likelihoods and gradients of stock analysis models
coef.mixstock.est | commands for mixed stock analysis estimates
coef.toptim | minimal structure for optim fits
confint.mixstock.est | commands for mixed stock analysis estimates

## -- D --

dcmat.a | Likelihoods and gradients of stock analysis models

## -- E --

expand.bugs.data | convert data to BUGS input format

## -- G --

genboot | Generate bootstrap estimates of mixed stock analyses
get.bot | Masuda-Pella interchange functions
get.bse | Masuda-Pella interchange functions
get.ctl | Masuda-Pella interchange functions
get.frq | Masuda-Pella interchange functions
get.mix | Masuda-Pella interchange functions
get.mp.input | Masuda-Pella interchange functions
gibbs | Mixed stock analysis by Markov Chain Monte Carlo
gibbsC | Run mixed stock analysis Gibbs sampler, in C
gibbsmat | Plot Gibbs sampler output
gibbsrpt | Plot Gibbs sampler output

## -- H --

hist.mixstock.est | commands for mixed stock analysis estimates
hwdiag.check | check Heidelberger and Welch diagnostic results

## -- L --

label.mixstock.data | Extract/assign names from mixed stock data
lahanas98 | Green turtle data from Lahanas et al. 1998
lahanas98raw | Green turtle data from Lahanas et al. 1998
locnames | Extract/assign names from mixed stock data
logLik.mixstock.est | commands for mixed stock analysis estimates
logLik.toptim | minimal structure for optim fits
loglik2.C | likelihood calculation, in C
lsolve | Produce (raw) starting vector of parameters for mixed stock analysis

## -- M --

markfreq.condense | condense marker frequency list
marknames | Extract/assign names from mixed stock data
mcmc.chainlength.est | Estimate appropriate chain length for mixed stock analysis by MCMC
mixnames | Extract/assign names from mixed stock data
mixstock.boot | Bootstrap samples of mixed stock analysis data
mixstock.data | class for marker data from sources and mixed stocks
mixstock.dimnames | Extract/assign names from mixed stock data
mixstock.est | construct (or print) a mixed stock analysis estimate object
mm.wbugs | Run many-to-many model via WinBUGS (or JAGS)
mysum | summaries of MCMC output
mysumvec | summaries of MCMC output

## -- N --

nmark | Set and query mixed stock parameters
nmark<- | Set and query mixed stock parameters
nmix | Set and query mixed stock parameters
nmix<- | Set and query mixed stock parameters
normcols | scale columns to frequencies
nsource | Set and query mixed stock parameters
nsource<- | Set and query mixed stock parameters
numderiv | take the numeric derivative of a function

## -- P --

p.bayes | Empirical Bayes estimate of prior strength for source marker frequencies
p.to.q | Real-to-multifrequency transformation
packval | Pack and unpack contribution and marker frequencies
packval2 | Pack and unpack contribution and marker frequencies
plot.mixstock.data | class for marker data from sources and mixed stocks
plot.mixstock.est | plot mixed stock analysis estimates
plotvar | Plot Gibbs sampler output
pm.wbugs | Run Pella-Masuda model via WinBUGS
print.mixstock.data | class for marker data from sources and mixed stocks
print.mixstock.est | construct (or print) a mixed stock analysis estimate object
put.bse | Masuda-Pella interchange functions
put.ctl | Masuda-Pella interchange functions
put.mix | Masuda-Pella interchange functions
put.mp | Masuda-Pella interchange functions

## -- Q --

q.to.p | Real-to-multifrequency transformation

## -- R --

rdirichlet | Dirichlet deviates
RL.burn | Use Raftery and Lewis diagnostics to calculate MCMC chain lengths
RL.max | Use Raftery and Lewis diagnostics to calculate MCMC chain lengths
runsims | Run mixed stock simulations

## -- S --

sim.mark.freq | Simulate marker frequencies and distributions in a mixed stock
simex | A small sample mixed stock analysis data set
simmixstock0 | Simulate a sample from sources and mixed stock
simmixstock1 | Simulate marker frequencies and distributions in a mixed stock
simmixstock2 | Simulate multiple mixed stocks
sourcenames | Extract/assign names from mixed stock data
sourcesize.wbugs | Run hierarchical model with via WinBUGS
startvec | Produce (raw) starting vector of parameters for mixed stock analysis
startvec0 | Produce (raw) starting vector of parameters for mixed stock analysis
summary.mixstock.est | commands for mixed stock analysis estimates

## -- T --

tmcmc | Mixed stock analysis by Markov Chain Monte Carlo

## -- U --

uml | Mixed stock analysis by unconditional maximum likelihood
uml.ds | Mixed stock analysis by unconditional maximum likelihood
uml.em | Mixed stock analysis by unconditional maximum likelihood
uml.grad | Likelihoods and gradients of stock analysis models
uml.lik | Likelihoods and gradients of stock analysis models
unpackval | Pack and unpack contribution and marker frequencies
unpackval2 | Pack and unpack contribution and marker frequencies

## -- W --

write.TO.bugscode | Run many-to-many model via WinBUGS (or JAGS)