Learn R Programming

HWEBayes (version 1.4)

SinglefPrior: Samples from the single f prior.

Description

Function to sample from the single $f$ prior, that is the Dirichlet and normal on $\lambda$, where $\lambda=\log((f-f_{\min})/(1-f))$.

Usage

SinglefPrior(nsim, alpha, lambdamu, lambdasd)

Arguments

nsim
number of simulations from prior
alpha
vector of $k$ parameters for the Dirichlet prior on the $k$ allele frequencies.
lambdamu
mean of the normal prior on $\lambda$.
lambdasd
standard deviation of the normal prior on $\lambda$.

Value

  • psample for vector of $k$ allele frequencies
  • fsample of $f$ parameters
  • lgtssamples for logits of baseline logits
  • lambdasamples for $\lambda$

References

Wakefield, J. (2010). Bayesian methods for examining Hardy-Weinberg equilibrium. Biometrics; Vol 66:257-65

See Also

SinglefReject, HWEsimdat

Examples

Run this code
SinglefSamp <- SinglefPrior(nsim=1000,alpha=c(1,1,1,1),
  lambdamu=-2.95,lambdasd=1.07)

Run the code above in your browser using DataLab