Description Usage Arguments Value Author(s) References Examples
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.
1 | SinglefReject(nsim, bvec, lambdamu, lambdasd, nvec)
|
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}. |
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. |
Jon Wakefield (jonno@u.washington.edu)
Wakefield, J. (2010). Bayesian methods for examining Hardy-Weinberg equilibrium. Biometrics; Vol 66:257-65
1 2 3 | data(DiabRecess)
postsampf1 <- SinglefReject(nsim=100,bvec=rep(1,4),lambdamu=-2.95,
lambdasd=1.07,nvec=DiabRecess)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.