modeP              package:MasterBayes              R Documentation

_P_o_s_t_e_r_i_o_r _M_o_d_e _o_f _P_a_r_e_n_t_s

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

     Finds the mode of the posterior marginal distribution of parents

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

     modeP(postP, threshold=0, ...)

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

   postP: posterior distribution of parentage from an 'MCMCped' model
          with argument 'write_postP="MARGINAL"'

threshold: threshold probability under which ML parents are replaced by
          NA

     ...: further arguments to be passed

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

     Individuals that do not have a parent assignment with a posterior
     probability exceeding the 'threshold', or whose parents belong to
     the base or unsampled population, have NA in the dan and sire
     columns. Please bear in mind that the mode of the marginal
     distribution may be different from the mode of the joint
     distribution.  For example the male that has the highest marginal
     probability (marginal with respect to potential mothers) may not
     be the male that is in the parental category (i.e. dam/sire
     combination) with the highest probability.  With multigenerational
     pedigrees, the mode of the joint distribution of parental
     combinations may not coincide with the mode of the distribution of
     pedigrees!

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

     pedigree with id in the first column, and ML estimates for dam and
     sire in the second and third columns

_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_, Molecular Ecology

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

     'MCMCped'

_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=2, burnin=1000) 

     ped<-modeP(model1$P, threshol=0.9)
     ped

