SinglefReject: 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.
vector of size $k$ that is the specification for the Dirichlet prior on the allele frequencies.
lambdamu
prior mean for $\lambda$.
lambdasd
prior standard deviation for $\lambda$.
nvec
vector of genotype frequencies in the order $n_{11}, n_{21}, n_{22}, ..., n_{k1}, n_{k2}, ..., n_{kk}$.
Value
psampsamples for $k$ allele frequencies.
fsampsamples for inbreeding coefficient $f$.
accrateacceptance rate of the rejection algorithm.
PrnH1estimate of normalizing constant (which may be used in Bayes factor calculations). Calculated by averaging the likelihood over the sampled points.
varestestimated variance of the estimate of the normalizing constant.
References
Wakefield, J. (2010). Bayesian methods for examining Hardy-Weinberg
equilibrium. Biometrics; Vol 66:257-65