Learn R Programming

strataG (version 1.0.3)

exptdNumAlleles: Expected Number of Alleles

Description

Calculate the expected number of alleles in a sample of a given size and value of theta.

Usage

exptdNumAlleles(n, theta, ploidy)

Arguments

n
size of sample.
theta
value of theta in population (= 2 * ploidy * Ne * mu).
ploidy
ploidy of locus.

Value

  • a two element vector with the expected number of alleles (num.alleles) and variance (var.num.alleles).

References

Ewens, W. 1972. The sampling theory of selectively neutral alleles. Theoretical Population Biology 3:87-112. Eqns. 11 and 24.

Examples

Run this code
exptdNumAlleles(20, 1, 2)

# double the samples
exptdNumAlleles(40, 1, 2)

# for a haploid locus
exptdNumAlleles(40, 1, 1)

# double theta
exptdNumAlleles(40, 2, 1)

Run the code above in your browser using DataLab