MCMCped             package:MasterBayes             R Documentation

_M_a_r_k_o_v _c_h_a_i_n _M_o_n_t_e _C_a_r_l_o _M_e_t_h_o_d_s _f_o_r _P_e_d_i_g_r_e_e _R_e_c_o_n_s_t_r_u_c_t_i_o_n _a_n_d _A_n_a_l_y_s_i_s

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

     Markov chain Monte Carlo methods for estimating the joint
     posterior distribution of a pedigree and the parameters that
     predict its structure using genetic and non-genetic data.  These
     parameters can be associated with covariates of fecundity such as
     a sexually selected trait or age, or can be associated with
     spatial or heritable traits that relate parents to specific
     offspring.  Population size, allele frequencies, allelic dropout
     rates, and stochastic genotyping error rates can also be
     simultaneously estimated.

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

     MCMCped(PdP=PdataPed(), GdP=GdataPed(), sP=startPed(), tP=tunePed(), 
        pP=priorPed(), mm.tol=999, nitt = 13000, thin = 10,  burnin = 
        3000, write_postG = FALSE, write_postA=FALSE, write_postP = 
        "MARGINAL", verbose=TRUE, ...)

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

     PdP: optional 'PdataPed' object containing phenotypic data

     GdP: optional 'GdataPed' object containing genetic data

      sP: optional 'startPed' object containing starting
          parameterisation

      tP: optional 'tunePed' object containg tuning parameters for
          Metropolis Hastings updates

      pP: optional 'priorPed' object containg prior specifications

  mm.tol: maximum number of mismatches tollerated

    nitt: number of MCMC iterations

    thin: thinning interval of the Markov chain

  burnin: the number of initial iterations to be discarded

write_postG: if 'TRUE' the marignal posterior distribution of true
          genotypes is stored

write_postA: if 'TRUE' the joint posterior distribution of allele
          frequencies is stored

write_postP: if '"MARGINAL"' the marginal distribution of parents is
          stored. If '"JOINT"' the joint distribution of parents (the
          pedigree) is stored.

 verbose: if 'TRUE' posterior samples and the Metropolis Hastings
          accpetance rates of 'beta', 'USdam', 'USsire', 'E1', 'E2' are
          printed to the screen every 1000 iterations.

     ...: further arguments to be passed

_D_e_t_a_i_l_s:

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

    beta: an 'mcmc' object containing samples from the posterior
          distribution of the population level parameters

   USdam: an 'mcmc' object containing samples from the posterior
          distribution of the number of unsampled females

  USsire: an 'mcmc' object containing samples from the posterior
          distribution of the number of unsampled males

      E1: an 'mcmc' object containing samples from the posterior
          distribution of allelic dropout rates

      E2: an 'mcmc' object containing samples from the posterior
          distribution of stochasting genotyping error rates

       G: list of marginal distributions of true genotypes at each
          locus

       A: list of 'mcmc' objects containing samples from the posterior
          distribution of the base population allele frequencies at
          each locus

       P: either samples from the posterior distribution of the
          pedigree, or the marginal distribution of parents

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

     Jarrod Hadfield j.hadfield@sheffield.ac.uk

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

     Hadfield J.D. _et al_ (2006) Molecular Ecology 15 3715-31

_S_e_e _A_l_s_o:

     'getXlist'

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

     data(WarblerP)
     data(WarblerG)

     GdP<-GdataPed(WarblerG)

     var1<-expression(varPed(c("lat", "long"), gender="Male", 
       relational="OFFSPRING"))

     # paternity is to be modelled as a function of distance 
     # between offspring and male territories

     res1<-expression(varPed("offspring", restrict=0))

     # indivdiuals from the offspring generation are excluded as parents

     res2<-expression(varPed("terr", gender="Female", relational="OFFSPRING",
       restrict=TRUE))

     # mothers not from the offspring territory are excluded
      
     PdP<-PdataPed(formula=list(var1,res1,res2), data=WarblerP, USsire=FALSE)
     tP<-tunePed(beta=30)

     model1<-MCMCped(PdP=PdP, GdP=GdP, tP=tP, nitt=3000, thin=1, burnin=0) 

     plot(model1$beta)

