tmcmc                package:mixstock                R Documentation

_M_i_x_e_d _s_t_o_c_k _a_n_a_l_y_s_i_s _b_y _M_a_r_k_o_v _C_h_a_i_n _M_o_n_t_e _C_a_r_l_o

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

     Runs a Gibbs sampler MCMC starting with 95% contribution from each
     source, then combines the chains

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

     tmcmc(data, n.iter=20000, rseed=1001, n.burnin=floor(n.iter/2),
     n.thin=max(1, floor(n.chains * (n.iter - n.burnin)/1000)),
     verbose=FALSE, fprior=NULL,
     contrib.only=TRUE, rptiter=-1,
     outfile=NULL, lang="C",a=NULL,gr=FALSE)
     gibbs(sourcesamp, mixsamp, a = 1, startiter, maxiter, startfval = NULL, 
         n.thin = 1, fprior = NULL, rptiter = -1) 

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

    data: Data: a 'mixstock.data' object

  n.iter: Total length of each chain

n.burnin: Number of burn-in iterations

  n.thin: thinning rate.  Must be a positive integer. Set 'n.thin' > 1
          to save memory and computation time if 'n.iter' is large.
          Default is 'max(1, floor(n.chains * (n.iter-n.burnin) /
          1000))' which will only thin if there are at least 2000
          simulations.

   rseed: Random-number seed

 verbose: Produce lots of output

  fprior: Bayesian prior for source contributions

contrib.only: To save memory, store only information about
          contributions from each source and not about the estimated
          marker frequencies in each source

 rptiter: How often to issue a progress report.  Negative numbers mean
          no reports

 outfile: file to use for output

    lang: Run the chain in C or R (for debugging/testing purposes
          only)?

       a: prior strength parameter

      gr: calculate Gelman-Rubin convergence statistic?

sourcesamp: matrix of marker samples from sources

 mixsamp: vector of marker samples from mixed stock

startiter: starting iteration

 maxiter: max. number of iterations

startfval: starting source contributions

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

     Returns an object of type 'mixstock.est'

_A_u_t_h_o_r(_s):

     Ben Bolker

_R_e_f_e_r_e_n_c_e_s:

     Masuda and Pella

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

       data(bolten98)
       b98c <- markfreq.condense(as.mixstock.data(bolten98))
       t1 <- tmcmc(b98c); t1

