SinglefReject: Samples from the posterior for the single f model

Description Usage Arguments Value Author(s) References Examples

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

1
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. (2010). Bayesian methods for examining Hardy-Weinberg equilibrium. Biometrics; Vol 66:257-65

Examples

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

HWEBayes documentation built on May 2, 2019, 11:07 a.m.