The likelihood function
A coin lands heads 7 times in 10 flips. What is your best guess for its heads probability ? Most people say 0.7 without thinking. Maximum likelihood is the method that makes that instinct precise and extends it to models where the answer is less obvious.
Fix the data and treat the probability of seeing it as a function of the parameter. That function is the likelihood:
For the coin (in the order observed), . Plug in candidates:
The data are about 2.3 times more probable if than if the coin is fair. The maximum likelihood estimate (MLE) is the parameter value where peaks: the explanation under which what you saw was most likely to happen.
One warning that interviewers like to probe: is not a probability distribution over . It does not integrate to 1 in , and is not "the probability that ". It is the probability of the data, given . Turning it into a statement about itself needs a prior, which is the last section.