simPop: Simulate data from Dirichlet-multinomial distribution

View source: R/dirmult.R

simPopR Documentation

Simulate data from Dirichlet-multinomial distribution

Description

Simulates data using user defined theta value and allele probabilities in the reference population, pi.

Usage

simPop(J=10, K=20, n, pi, theta)

Arguments

J

The number of subpopulations sampled.

K

Number of different alleles. If argument pi is given, the length of pi is used as K.

n

The number of alleles sampled in each subpopulation. If scalar repeated for all subpopulations, otherwise a vector of length J is needed with subpopulation specific total sampled alleles.

pi

Vector of allele probabilities. If missing a random vector of length K is generated.

theta

The theta-value used for simulations.

Value

Return an J x K matrix with allelic counts.

See Also

dirmult

Examples

  simPop(n=100, theta=0.03)

dirmult documentation built on March 21, 2022, 5:05 p.m.

Related to simPop in dirmult...