genboot {mixstock} | R Documentation

## Generate bootstrap estimates of mixed stock analyses

### Description

Given a data set or simulated data set (in the usual format of a list of source samples and samples from the mixed stock), generate bootstrap-resampled data sets (either parametrically or nonparametrically) and a vector of estimates from the resampled data sets

### Usage

    genboot(x, method="cml", nboot=1000, rseed=1001, verbose=FALSE,
    fuzz=0.001, maxfail=100, rpt=20, start.type="lsolve",
    param=FALSE,param.match="mean",ndepfac=10000,save.boot=FALSE,
    print.boot=FALSE,...)

### Arguments

`x` | A mixed stock data set: a list with elements `sourcesamp` (a matrix, with sources as columns and markers as rows, of samples in the sources) and `mixsamp` (a vector of markers sampled in the mixed stock)
`method` | "cml" for conditional max. likelihood or "uml" for unconditional max. likelihood
`nboot` | number of bootstrap samples
`rseed` | random-number seed
`verbose` | produce verbose output?
`fuzz` | small value for keeping estimated frequencies away from 0/1
`maxfail` | number of consecutive fitting tries before entering NAs for a given simulation
`rpt` | frequency with which to report progress
`start.type` | starting conditions for fitting procedure (see `startvec` and/or `startvec0`)
`param` | Do parametric bootstrapping?
`param.match` | match mean or mode of resampled frequencies?
`ndepfac` | scaling factor for CML fit
`save.boot` | save bootstrap replicates?
`print.boot` | verbose output from bootstrap?
`...` | additional arguments to `cml`

### Value

An object of type `mixstock.est` with element `resample` as a matrix of bootstrap results (where the columns are the parameters, the negative log-likelihood of the fit, and a code for convergence).

### Examples

      data(simex)
      x <- genboot(simex,method="cml",nboot=100)
      r <- x$resample
      r.ok <- r[!is.na(r[,"Convergence"]) & r[,"Convergence"]==0,]
      old.par <- par(no.readonly=TRUE)
      par(mfrow=c(2,2))
      hist(r.ok[,1],main="Contrib. A")
      hist(r.ok[,2],main="Contrib. B")
      hist(r.ok[,3],main="Neg. log likelihoods")
      plot(r.ok[,1],r.ok[,3],
            xlab="Contrib. A",ylab="NLL")
      par(old.par)

[Package mixstock version 0.9.2 Index]