genboot               package:mixstock               R Documentation

_G_e_n_e_r_a_t_e _b_o_o_t_s_t_r_a_p _e_s_t_i_m_a_t_e_s _o_f _m_i_x_e_d _s_t_o_c_k _a_n_a_l_y_s_e_s

_D_e_s_c_r_i_p_t_i_o_n:

     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

_U_s_a_g_e:

     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,...)

_A_r_g_u_m_e_n_t_s:

       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'

_V_a_l_u_e:

     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).

_E_x_a_m_p_l_e_s:

       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)

