SinglefReject {HWEBayes}R Documentation

Samples from the posterior for the single f model

Description

Function to generate samples from the posterior for allele frequencies and f, under the single f model. Samples are generated using a rejection algorithm that simulates from the prior.

Usage

SinglefReject(nsim, bvec, lambdamu, lambdasd, nvec)

Arguments

nsim number of samples to generate from the prior.
bvec vector of size k that is the specification for the Dirichlet prior on the allele frequencies.
lambdamu prior mean for λ.
lambdasd prior standard deviation for λ.
nvec vector of genotype frequencies in the order n_{11}, n_{21}, n_{22}, ..., n_{k1}, n_{k2}, ..., n_{kk}.

Value

psamp samples for k allele frequencies.
fsamp samples for inbreeding coefficient f.
accrate acceptance rate of the rejection algorithm.
PrnH1 estimate of normalizing constant (which may be used in Bayes factor calculations). Calculated by averaging the likelihood over the sampled points.
varest estimated variance of the estimate of the normalizing constant.

Author(s)

Jon Wakefield (jonno@u.washington.edu)

References

Wakefield, J. (2009). Bayesian methods for examining Hardy-Weinberg equilibrium. Biometrics.

Examples

data(DiabRecess)
postsampf1 <- SinglefReject(nsim=100,bvec=rep(1,4),lambdamu=-2.95,
   lambdasd=1.07,nvec=DiabRecess)


[Package HWEBayes version 1.0 Index]