How to Use the Method of Moments for a Binomial Distribution
At a glance
- 1. Write the moments
For a binomial variable, the mean is np and the variance is np(1 − p).
- 2. Match sample moments
Set the sample mean equal to the theoretical mean; if n is unknown, also match the empirical variance.
- 3. Solve for parameters
With n known, estimate p from the mean. With both unknown, solve the two moment equations.
- 4. Check the estimates
Verify the estimates are feasible; a method-of-moments estimate of n need not be an integer.
The method of moments estimates distribution parameters by matching theoretical moments to moments calculated from the data. For a binomial random variable , the first two useful moments are
The calculation depends on whether the number of trials is known. If both and the success probability are unknown, use the sample mean and sample variance to obtain two equations.
If the number of trials is known
Suppose you observe independent counts , each from the same binomial distribution, and is specified. The sample mean is
Match it to the theoretical mean :
Solving gives the method-of-moments estimate
For example, if each observation counts successes in trials and the observed counts are , then . Thus .
If both parameters are unknown
Now suppose both and must be estimated. Use the first two raw moments of the data, equivalently the sample mean and the empirical variance. Define the empirical variance with divisor :
The method-of-moments equations are
Divide the variance equation by the mean equation (assuming ):
So the estimates are
These formulas can also be derived by matching the second raw moment to .
Worked example
Take the observed counts . Their mean is
The empirical variance, using divisor , is
Therefore,
and
The unconstrained method-of-moments estimate for is not an integer. A binomial trial count must be a positive integer, so this pair is not itself a valid binomial parameter pair. If an integer estimate is required, use a method that accounts for the integer constraint, or round only after checking that the chosen is at least the largest observed count. Rounding is a practical adjustment, not part of the basic moment-matching calculation.
Feasibility and common mistakes
- Using only the mean when both parameters are unknown: the equation identifies the product , not and separately. A second moment is needed.
- Using the unbiased sample variance without noticing the convention: the usual unbiased sample variance divides by . Direct method-of-moments matching uses empirical moments with divisor . Substituting the variance gives a different estimator.
- Ignoring the parameter bounds: a binomial model requires integer and . For positive sample mean, the formulas require to give a finite, nonnegative and positive . If , the denominator for is zero; if , the estimates are not feasible.
- Treating a noninteger as a binomial trial count: the unconstrained moment estimate is a real number. It can be useful as a starting point, but it does not make a noninteger number of trials valid.
If all observations are zero, then and the two-parameter formulas cannot determine ; the data provide no moment-based estimate of the number of trials. In that case, additional information or a different estimation approach is needed.
References
- Statistical Inference, 2nd Edition — George Casella and Roger L. Berger
Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.