runsims               package:mixstock               R Documentation

_R_u_n _m_i_x_e_d _s_t_o_c_k _s_i_m_u_l_a_t_i_o_n_s

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

     Run multiple simulations of a mixed stock systems with specified
     marker frequencies and source contributions, running multiple
     estimations (bootstrap samples or MCMC chains) for each simulation

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

     runsims(sim.n=10, mc.n=10, totsamp=200, which="all",
     true.freq=matrix(c(0.65, 0.31, 0.01, 0.01, 0.01, 0.01,
                    0.31,0.65,0.01,0.01,0.01,0.01),ncol=2),
            true.contrib=c(0.9, 0.1), est="MCMC", verbose=FALSE,
     fuzz=0.001, nboot=1000, bootrpt=20, minmarks=3)

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

   sim.n: Number of simulations to run

    mc.n: Number of bootstrap/MCMC chains to run for each simulation

 totsamp: total sample size (to be distributed half in  mixed stock and
          half, evenly, among sources)

   which: which markers to use: "common", "rare", or "all"

true.freq: matrix of true marker frequencies in the sources
          (column=source, row=marker)

true.contrib: vector of true contributions of sources to the mixed
          stock

     est: estimation method: "MCMC" (Markov Chain Monte Carlo), "cml"
          (conditional max. likelihood), or "uml" (unconditional max.
          likelihood)

 verbose: produce lots of debugging output?

    fuzz: "fuzz" parameters for (e.g.) keeping estimated values away
          from 0/1

   nboot: Number of bootstrap samples/length of MCMC chain

 bootrpt: Frequency for reporting on the progress of bootstrap code

minmarks: Minimum number of markers to allow for a simulation

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

     Array of the results from all simulations and bootstrap samples

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

     ## mild kluge to drop unneeded dimensions
       runsims(sim.n=1,mc.n=1,nboot=100,est="cml")[,,]
       

