Eight independent trials of the same process give six successes and two failures. Is a success probability of or of better supported by these results? Likelihood answers questions of this kind by holding the observed data fixed and asking how probable they are under each value of the parameter. This lesson builds the likelihood from a stated model, compares parameter values through likelihood ratios, finds the value with the largest likelihood and explains why that value is an estimate rather than a certainty.
Key terms
Statistical model
Definition A statistical model is a stated family of probability distributions for the data, one distribution for each value of a parameter in a stated parameter space . For discrete data each distribution gives the probability of every possible data set, and for continuous data it gives a joint probability density. The model includes its assumptions about how the observations relate to one another, for example that they are independent. In the running example the model says that the eight trials are independent and that each one is , with for a success and for a failure. The parameter space is . Under this model the probabilities of the eight outcomes multiply, so a particular sequence with successes and failures has probability .
In plain words The model says how the data would behave if the parameter had a given value. It is an assumption made before the analysis, and the data can cast doubt on it but cannot prove it. Independence does real work in that product. If a success made the next trial more likely to succeed, the probability of a sequence would need factors that depend on the earlier outcomes, even though every recorded value would still be or .
Example At every one of the possible sequences of eight outcomes has probability . At the sequences are no longer equally likely, and a sequence with six successes has probability , while the sequence of eight failures has probability .
Likelihood function
Definition Fix the observed data and a statistical model with parameter in . The likelihood function assigns to each in the probability of the observed data when the parameter equals ,
or, for continuous data, the joint density evaluated at the observed values. The data are held fixed and varies. When the model makes discrete observations independent and their observed values are , the joint probability is a product,
and for independent continuous observations the individual densities are multiplied in the same way. Multiplying a likelihood by a positive constant that does not depend on gives an equivalent likelihood, with the same ratios between parameter values and the same maximizing values.
In plain words A probability holds the parameter fixed and asks which data might occur. Likelihood runs the other way. It holds the data that did occur fixed and compares parameter values. Its values come from probabilities or densities of data, so it is not a probability distribution for the parameter, and its values over all parameter values need not add or integrate to .
Example The observed sequence has six successes and two failures. Each success contributes a factor and each failure a factor , so for
If the model treats only the total number of successes as the data, the binomial probability includes the number of sequences with six successes, , and the likelihood becomes . The area under from to is , and the area under the count version is . Neither curve is a probability density for .
Likelihood ratio
Definition For two parameter values and in with , the likelihood ratio of to is
For discrete data it says how many times as probable the observed data are under as under , and for continuous data it compares the densities at the observed values. A ratio above favors , a ratio below favors , and a ratio of exactly means the data do not distinguish the two values. Any positive factor that does not depend on the parameter cancels from the ratio.
In plain words The ratio measures how strongly these data, under this model, support one parameter value relative to another. It is not the odds that rather than is the true value. Odds for parameter values need an extra ingredient, prior probabilities for those values. When a prior gives positive probability to both values, Bayes’ theorem says that the posterior odds equal the prior odds multiplied by the likelihood ratio.
Example Compare with for the observed sequence.
The observed sequence is about times as probable when as when . The count likelihood multiplies both values by , giving and , and the ratio is still .
Maximum likelihood estimate
Definition A maximum likelihood estimate (MLE) is a parameter value in with for every in . An MLE need not exist, and when one exists it need not be unique. For successes in independent Bernoulli trials with parameter space , the likelihood is , with read as , and it has exactly one maximizer, the sample proportion
This includes and , where the maximum sits at an end of the parameter space.
In plain words A maximum likelihood estimate is an allowed parameter value under which the observed data are most probable, or have the highest density. Raising makes each observed success more probable and each observed failure less probable, and when the data contain both kinds of outcome the peak sits where the two pulls balance. The MLE is an estimate computed from one sample. Another sample could give a different value, and the number alone does not report how far it may be from the true parameter.
Example For six successes in eight trials a few values of the likelihood are below.
A fine grid over puts the peak at , in agreement with the formula. For an MLE that is not unique, suppose the parameter space contains only the two values and , and two trials give one success and one failure. Both values have likelihood , so both are maximum likelihood estimates.
Log-likelihood
Definition The natural logarithm of a positive number is the exponent with . It is strictly increasing, and it turns products into sums, since for positive and . Where the likelihood is positive, the log-likelihood is
For independent observations it is the sum of the logarithms of the individual probabilities or densities. Because the logarithm is strictly increasing, exactly when . So if the likelihood is positive somewhere, maximizing over the values with positive likelihood gives exactly the maximizers of . A constant factor in the likelihood becomes an added constant , and a difference of log-likelihoods is the logarithm of a likelihood ratio.
In plain words Sums are easier to work with than long products, by hand and on a computer. A product of many probabilities can be too small for a computer to store. The product of factors of is less than , far below the smallest positive number that ordinary double-precision arithmetic can represent, so the computed product comes out as . Its logarithm, , is an ordinary number. Taking logarithms does not turn the likelihood into a probability. For discrete data the log-likelihood is never positive, because probabilities are at most , while densities can exceed .
Example For six successes and two failures, on ,
The values are and . Their difference, about , equals , the logarithm of the likelihood ratio. For readers who know derivatives, the derivative is positive for , zero at and negative for , which confirms the peak found on the grid.
Boundary estimate
Definition A maximum likelihood estimate is a boundary estimate when it lies on the edge of the parameter space rather than strictly inside it. With successes in trials and parameter space , the likelihood decreases as increases, so the MLE is the boundary value . Whether an MLE exists here depends on the declared parameter space. If the model allows only , the likelihood rises toward as approaches but never reaches it, and no maximum likelihood estimate exists.
In plain words An estimate on the edge says which allowed value fits these particular data best. It does not establish that the edge value is the truth. A run of failures is quite probable when the success probability is small but positive, so an estimate of does not show that success is impossible. Shortcuts that assume a peak strictly inside the parameter space can also mislead here. The standard error formula gives at , which understates the uncertainty.
Example Suppose all eight trials fail. Then , which equals at . At the probability of eight failures is , and at it is . The likelihood ratio of to is only about , so these data favor over only mildly.
Check yourself
- Five independent Bernoulli trials give success, failure, success, success, failure. Write the likelihood, find the maximum likelihood estimate of and compute the likelihood ratio of to .
Show the answer
There are three successes and two failures, so for , and the MLE is . The two likelihood values are and , so the ratio is . Modeling only the count of successes multiplies both values by and leaves the ratio at .
- Eight independent trials all fail. Find the maximum likelihood estimate of when the parameter space is . Does the estimate show that a success can never happen? What changes if the model allows only ?
Show the answer
The likelihood is , which is largest at , so , a boundary estimate. It does not show that success is impossible. If , eight failures in a row still have probability , so data like these are common when successes are merely uncommon. The estimate is the best-supported allowed value for this one sample, and its uncertainty has to be assessed separately. If the parameter space is , the likelihood approaches as approaches without reaching it, so no maximum likelihood estimate exists.
- For six successes in eight trials, a colleague says that the likelihood ratio of proves that is almost three times as probable as . The colleague also expects the estimate to move if the binomial factor is included. Correct both claims.
Show the answer
The ratio compares the probability of the observed data under two parameter values. It assigns no probabilities to the parameter values themselves, and a statement about those needs a prior. For example, if before the data a prior gave probability to each of exactly these two values, the posterior odds would be , and the posterior probability of would be . A different prior would give different odds. The factor is positive and does not depend on , so it multiplies the likelihood at every by the same amount. The maximizer stays at and the ratio stays at .