startvec0: Produce (raw) starting vector of parameters for mixed stock...

Description Usage Arguments Value Note Author(s) Examples

View source: R/mixstock.R

Description

Provides raw (untransformed) starting vector of source contribution parameters for mixed stock analysis.

Usage

1
2
3
4
5
startvec0(sourcesamp, mixsamp=NULL, type="equal", sd=1, lmin=0.001)
startvec(sourcesamp, mixsamp=NULL, type="equal", 
         marktype="sample",a=1,cond=FALSE,transf="full",
fuzz=0,sd=1)
lsolve(n, s, tol = 1e-05, warn = FALSE)

Arguments

sourcesamp

Marker frequencies in sources, or a list with source and mixed samples, or a turtle.data object.

mixsamp

Marker frequencies in mixed stock

type

Various options for setting starting contributions. equal: equal contributions from all sources. random: random multinomial sample with equal multinomial probabilities. rand2: random sample from transformed normal variates with mean 0 and standard deviation sd. A number n between 1 and the number of sources inclusive gives a starting condition with 95% of the contribution from source n and the other 5% evenly split between the other sources. The default is to attempt a solution of the linear equation (sourcesamp*f=mixsamp) and use these values as the starting contributions.

sd

standard deviations for starting type rand2

lmin

When doing linear solutions, the boundary values are {lmin, 1-lmin.

marktype

method for starting marker frequencies: sample uses the observed sample probabilities; random used observed sample probabilities; weighted does a Bayes-weighted start (a la Masuda and Pella)

cond

Conditional likelihood? (i.e. cond=TRUE gives just the parameters for source contributions, not parameters for source marker frequencies)

a

prior strength parameter

transf

transform ("full","part", or "none")

fuzz

fuzz parameter for moving parameters away from the boundary

n

source samples (HxR matrix)

s

mixed stock samples (vector)

tol

tolerance for linear fit

warn

warn if numeric problems with solution

Value

A parameter vector of the contributions from each of the sources: just the raw source contributions in the case of startvec0, or source contributions and possibly marker frequencies (transformed or untransformed) in the case of startvec.

Note

lsolve attempts to get a starting value by solving the linear equation (solve(n,s,tol=tol))

Author(s)

Ben Bolker

Examples

1
2
3
4

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