MCMCped {MasterBayes} | R Documentation

## Markov chain Monte Carlo Methods for Pedigree Reconstruction and Analysis

### Description

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.

### Usage

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

### Arguments

`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

### Details

### Value

`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

### Author(s)

Jarrod Hadfield j.hadfield@sheffield.ac.uk

### References

Hadfield J.D. et al (2006) Molecular Ecology 15 3715-31

### See Also

`getXlist`

### Examples

    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)

[Package MasterBayes version 2.0 Index]