simmixstock0 {mixstock} | R Documentation

## Simulate a sample from sources and mixed stock

### Description

Given information on marker frequencies in sources, the contributions of each source to a mixed stock, and sample sizes, generates multinomial samples of markers from sources and the mixed stock.

### Usage

    simmixstock0(sourcefreq, input.freq, sourcesampsize, mixsampsize, rseed=NULL)

### Arguments

`sourcefreq` | Matrix (markers=rows, source=cols) of true marker frequencies in sources
`input.freq` | True contributions from each source to the mixed stock
`sourcesampsize` | Sample size from (each) source
`mixsampsize` | Sample size from mixed stock
`rseed` | Random-number seed

### Value

Multinomial sample.

`mixsamp` | Sample from mixed stock (vector)
`sourcesamp` | Sample from sources (matrix, markers=rows, source=cols)

...

### Author(s)

Ben Bolker

### Examples

    true.freq <- matrix(c(0.65,0.33,0.01,0.01,
                          0.33,0.65,0.01,0.01),ncol=2)
    true.contrib <- c(0.9,0.1)
    x <- simmixstock0(true.freq,true.contrib,sourcesampsize=50,mixsampsize=100,rseed=1004)

[Package mixstock version 0.9.2 Index]