From Allele Frequencies to Genotype Likelihoods
At a biallelic locus, a sample records one of three genotypes: \(AA\), \(Aa\), or \(aa\). A likelihood connects the observed counts of these genotypes to a model for their probabilities. Under Hardy–Weinberg equilibrium (HWE), the three probabilities are not free to vary independently: they are determined by one allele frequency. This tutorial sets out that likelihood and contrasts it with a model that assigns a separate probability to each genotype.
The distinction is useful because the data are genotype counts, while the HWE model is expressed through an allele frequency. In the likelihood, the observed counts are held fixed and the probabilities are treated as functions of the model parameters. The resulting expression describes how compatible each parameter value is with the observed data; it is not, by itself, a probability distribution over parameter values.
The HWE probabilities sum to one because \(p^2+2pq+q^2=(p+q)^2=1\). Here \(p^2\) is the probability of receiving allele \(A\) from each parent, \(q^2\) the probability of receiving \(a\) from each, and \(2pq\) the probability of either parental order producing one \(A\) and one \(a\). These expressions assume the two alleles combine as independent draws from a population with allele frequencies \(p\) and \(q\).
Building the Likelihood for Counts
Suppose the sampled individuals are independent draws from the same population, their genotypes are observed without error, and the locus has the two alleles \(A\) and \(a\). Under HWE, each sampled genotype has the probabilities in the definition. The probability of one particular ordered sequence of genotypes is the product of the corresponding genotype probabilities. For counts rather than an ordered sequence, the likelihood also includes the number of different sequences that have those counts.
That number is the multinomial coefficient \(n!/(n_{AA}!n_{Aa}!n_{aa}!)\). It counts the ways to arrange the three genotype categories among the \(n\) sampled individuals. The coefficient does not depend on \(p\), but it is part of the probability of the observed count pattern. If the data are instead described as a particular ordered sequence, the sequence probability omits the coefficient.
Worked Example: Count Likelihood and Sequence Probability
Consider a hypothetical sample of five individuals with counts \(n_{AA}=1\), \(n_{Aa}=3\), and \(n_{aa}=1\). Evaluate the likelihood at \(p=0.60\), so \(q=0.40\). The HWE genotype probabilities are \(0.60^2=0.36\), \(2(0.60)(0.40)=0.48\), and \(0.40^2=0.16\). The assumptions for this calculation are that the five genotypes are independent observations from a population with these HWE probabilities and that calls are accurate.
For one particular ordered sequence with these counts, the probability is \(0.36(0.48)^3(0.16)\). Since \((0.48)^3=0.110592\),
There are \(5!/(1!3!1!)=20\) ordered sequences with these counts. Therefore the count likelihood is
Thus \(0.0063700992\) is the probability of one specified sequence, whereas \(0.127401984\) is the probability of observing the count pattern, without regard to the order in which the five genotypes occurred.
In general, the count likelihood has the multinomial form because each person falls into exactly one of three mutually exclusive genotype categories. The exponents record how many observations fall in each category. The coefficient accounts for all arrangements of those observations. For likelihood-based comparisons among values of \(p\), one may sometimes omit a factor that is constant in \(p\), but doing so changes the numerical value from the count probability. It is important to state which version is being used.
HWE Compared with Separate Genotype Probabilities
A model without the HWE restriction can assign probabilities \(\theta_{AA}\), \(\theta_{Aa}\), and \(\theta_{aa}\) to the three genotypes, subject only to being nonnegative and summing to one. The likelihood for counts is then the multinomial likelihood below. This model has two free probability values because the third is determined by the sum-to-one condition. In contrast, the HWE model sets these probabilities equal to \(p^2\), \(2p(1-p)\), and \((1-p)^2\), so it has one free parameter.
The unrestricted model allows any genotype-frequency triple in the probability simplex. HWE allows only triples generated by a single value of \(p\). For example, HWE implies that the heterozygote probability is linked to the two homozygote probabilities; it cannot be chosen independently. This comparison concerns the probability models and their likelihood expressions. A formal test or inferential comparison requires additional procedures and is a separate question.
Worked Example: Evaluating the HWE Likelihood
In a hypothetical sample of four individuals, suppose the counts are \(n_{AA}=1\), \(n_{Aa}=2\), and \(n_{aa}=1\). Evaluate the HWE count likelihood at \(p=0.50\). The HWE probabilities are \(0.25\), \(0.50\), and \(0.25\). The observations are assumed independent with accurate genotype calls, as required for this multinomial calculation.
The multinomial coefficient is \(4!/(1!2!1!)=12\). Substituting the probabilities and counts gives
The value \(0.1875\) is the probability, under the stated HWE model, of this count pattern. It is not the probability that \(p=0.50\), nor does it alone establish that the population is in HWE.
Worked Example: Evaluating an Unrestricted Model
Use the same hypothetical counts, \((1,2,1)\), but evaluate an unrestricted model at the assigned probabilities \(\theta_{AA}=0.50\), \(\theta_{Aa}=0.25\), and \(\theta_{aa}=0.25\). These values are nonnegative and sum to one, so they form a valid genotype-probability model. The sample-independence and accurate-call assumptions are the same as before.
The count likelihood is
This is the likelihood at the specified unrestricted probabilities. It differs from the HWE likelihood evaluated at \(p=0.50\), which was \(0.1875\), because the genotype probabilities differ: the unrestricted assignment has heterozygote probability \(0.25\), whereas HWE at \(p=0.50\) requires heterozygote probability \(0.50\). The two numerical values are evaluations at particular parameter settings; they are not a formal model comparison.
Why the Constraint Matters
HWE is a substantive constraint on genotype frequencies, not merely a convenient way to rewrite three unrelated proportions. Its interpretation generally relies on conditions such as random union of gametes, a sufficiently large population, and no systematic forces changing allele or genotype frequencies between generations. In an analysis, the sampling design and population definition also matter: a sample drawn from a mixture of subpopulations, for example, need not have the genotype proportions expected for one homogeneous population. Departures from the stated conditions can make the HWE likelihood an unsuitable description of the data.
The likelihood itself encodes a sampling model. It assumes that the observed individuals contribute independent genotype outcomes with common probabilities. If individuals are related, sampled in clusters, or have uncertain genotype calls, the simple product of genotype probabilities may not describe the sampling process. Those situations call for a different likelihood construction rather than silently applying the count formula unchanged.
Use \(n_{AA}\), \(n_{Aa}\), and \(n_{aa}\), and verify that they sum to \(n\).
For HWE, use \(p^2\), \(2p(1-p)\), and \((1-p)^2\). For the unrestricted model, use three nonnegative probabilities summing to one.
Multiply the category probabilities raised to their observed counts and include \(n!/(n_{AA}!n_{Aa}!n_{aa}!)\) when calculating the count probability.
The likelihood is a function of model parameters for the observed data; a numerical value is the probability of the count pattern at the specified parameter values.
Common Mistakes
- Forgetting the heterozygote factor of two. Under HWE, \(P(Aa)=2pq\), because either parental allele order produces the heterozygote. Using \(pq\) gives genotype probabilities that do not sum to one.
- Confusing a sequence with a count pattern. A product of genotype probabilities gives the probability of one specified ordering. For counts, multiply by the multinomial coefficient to include every ordering with those counts.
- Treating the three HWE probabilities as independent. Under HWE they are all determined by \(p\), with \(q=1-p\); arbitrary triples belong to the unrestricted model, not necessarily to HWE.
- Calling a likelihood value the probability that a parameter is true. The likelihood evaluates the probability of the observed data at parameter values. It does not assign probabilities to parameter values.
- Assuming a good fit proves HWE. A count likelihood is based on specified assumptions. Its numerical value alone does not establish that those assumptions hold or that HWE is true.
Check Your Understanding
Answer each question by identifying the probability model and the quantity represented.
- For allele frequency \(p=0.30\), what are the three HWE genotype probabilities? Verify that they sum to one.
- A sample has counts \(n_{AA}=2\), \(n_{Aa}=1\), and \(n_{aa}=1\). What is the multinomial coefficient, and what does it count?
- Explain the difference between the probability of one ordered genotype sequence and the probability of a count pattern.
- How many free probability parameters are in the unrestricted three-genotype model, and why?
- Why does the HWE model impose a restriction on the unrestricted probabilities?
- Give one sampling or population condition that could make the simple multinomial genotype likelihood inappropriate, and briefly explain why.