startvec0 {mixstock} | R Documentation

## Produce (raw) starting vector of parameters for mixed stock analysis

### Description

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

### Usage

    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

     data(simex)
     startvec0(simex)
     startvec(simex,transf="part")
     startvec(simex)

[Package mixstock version 0.9.2 Index]