Generate genotype frequencies under Hardy-Weinberg equilibrium
given the allele frequency of the reference allele (r
),
the double reduction parameter (alpha
), and the ploidy
of the species (ploidy
).
hwefreq(
r,
alpha,
ploidy,
niter = 100,
tol = sqrt(.Machine$double.eps),
more = FALSE
)
The allele frequency of the reference allele.
A numeric vector containing the double reduction parameter(s).
This should be a
vector of length floor(ploidy/4)
where alpha[i]
is the probability of exactly i
pairs of IBDR alleles
being in the gamete. Note that sum(alpha)
should be less than
1, as 1 - sum(alpha)
is the probability of no double reduction.
The ploidy of the species. This should be an even positive integer.
The maximum number of iterations to simulate.
The stopping criterion on the Chi-square divergence between old and new genotype frequencies.
A logical. Should we return more output (TRUE
) or
less (FALSE
). See the Value section for details.
If more = FALSE
, then returns just the genotype frequencies
after niter
generations of random mating. If more = TRUE
,
then returns a list with these genotype frequencies, as well as
the parental gamete frequencies.