Function to obtain the MLEs of parameters under the HWE, single f and saturated models. For the single f model numerical maximization is required if k>2, where k is the number of alleles.
1  HWEmodelsMLE(nvec)

nvec 
vector of genotype frequencies in the order n_{11}, n_{21}, n_{22}, ..., n_{k1}, n_{k2}, ..., n_{kk}. 
phat 
matrix of k \times k MLEs of genotype frequencies 
qhat 
MLEs of k allele frequencies under the HWE model 
fqhat 
MLEs of k allele frequencies under the single f model 
fsingle 
MLE of single f 
fmaxloglik 
maximized loglikelihood (without the normalizing constant), under the single f model 
fmin 
estimated lower bound of f_{\min} in the single f model. Under the single f model f_{\min} < f <1 where f_{\min}=p_{\min}/(1p_{\min}) and p_{\min} is the minimum of the allele frequencies. 
Jon Wakefield (jonno@u.washington.edu)
Wakefield, J. (2010). Bayesian methods for examining HardyWeinberg equilibrium. Biometrics; Vol 66:25765
Weir, B.S. (1996). Genetic Data Analysis II. Sunderland MA: Sinauer.
1 2  data(DiabRecess)
HWEmodelsMLE(nvec=DiabRecess)

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.
Please suggest features or report bugs with the GitHub issue tracker.
All documentation is copyright its authors; we didn't write any of that.