gibbs_known: Gibbs sampler under random mating with known genotypes.

View source: R/RcppExports.R

gibbs_knownR Documentation

Gibbs sampler under random mating with known genotypes.

Description

Gibbs sampler under random mating with known genotypes.

Usage

gibbs_known(x, alpha, B = 10000L, T = 1000L, more = FALSE, lg = FALSE)

Arguments

x

The vector of genotype counts. x(i) is the number of individuals that have genotype i.

alpha

Vector of hyperparameters for the gamete frequencies. Should be length (x.length() - 1) / 2 + 1.

B

The number of sampling iterations.

T

The number of burn-in iterations.

more

A logical. Should we also return posterior draws (TRUE) or not (FALSE).

lg

Should we return the log marginal likelihood (true) or not (false).

Value

A list with some or all of the following elements

  • mx: The estimate of the marginal likelihood

  • p_tilde: The value of p used to evaluate the posterior density.

  • p: The samples of the gamete frequencies

  • post: The likelihood times prior evaluated at current samples.

  • ptilde_post: The samples of the full conditionals of p_tilde.

Author(s)

David Gerard


hwep documentation built on May 31, 2023, 9:06 p.m.