So far, weβve been concerned with probability theory. Starting with a probability distribution and some parameter values, weβve tried to answer questions like: Whatβs the probability of seeing certain experimental results? Statistics is concerned with going in the other direction: Upon seeing the experimental results, can we determine the type of underlying probability distribution? Can we determine its parameters?
Suppose we find a coin on the street and donβt know whether or not itβs fair. We want to know the probability \(p\) of the coin coming up heads. We might, for example, flip the coin \(n\) times and count the number \(k\) of heads. Then, weβll estimate \(p = \frac{k}{n}\text{.}\) Weβll refer to this as a common sense estimator. (Other distributions and parameter types will have different notions of "common sense".)
An estimator is, itself, a random variable: it produces a numerical value based on the results of an experiment. Weβll use notation like \(\est{p}\) for a random variable which is an estimator for a parameter \(p\text{.}\) (Similarly, \(\est{\lambda}\) would denote an estimator for a parameter called \(\lambda\text{.}\))
Suppose we have a coin with parameter \(p\text{,}\) which weβll flip \(n\) times and count the number \(k\) of heads. We use the unbiased estimator \(\est{p} = \frac{k}{n}\text{.}\) In this case, notice that \(k \sim \Bin(n, p)\text{,}\) so we know \(\E(k) = np\text{,}\) although we donβt know the value of \(p\text{.}\) (We probably do know the value of \(n\text{;}\) after all, weβre flipping the coin!) Now:
Itβs worth pausing for a moment to be appropriately impressed with ourselves. We still donβt know the true value of \(p\text{.}\) But we managed to show that our common sense method of estimating \(p\) gives, on average, the correct value.
Weβd like to be able to collect some data and use that data to estimate the values of whatever parameters our distribution has. Perhaps as a starting point, it would be good to identify the single most likely value of a parameter:
If we want to know the most likely value of the parameter \(p\text{,}\) then we should maximize \(\L(p)\) over the interval \(0 \leq p \leq 1\text{.}\)
We can see that \(\L'(p) = 0\) when \(p = 0, 1, \frac{52}{100}\text{,}\) and the endpoints of the interval weβre maximizing over are \(p = 0, 1\text{,}\) so we can build a table:
Note that we donβt need to know the exact value of \(\L(52/100)\) in order to see that itβs strictly positive, and therefore the maximum value of \(\L(p)\text{.}\) So, the MLE of \(p\) is \(52/100\text{.}\)
We can see in the previous example that the MLE of \(p\) is also the common sense estimation of \(p\text{.}\) This will be the case in general for the binomial distribution, so we wonβt need to redo this work over and over:
As we remember from Calculus 1, maximizing a continuous function works slightly differently over a closed interval (like the previous example) or an open interval (like the next example).
Suppose a radioactive material emits particles as it decays. Let \(N\) count the particles emitted. Then \(N \sim \Poiss(\lambda)\) for some unknown rate parameter \(\lambda\text{:}\)
The only critical point is \(\lambda = 8\text{,}\) but we have not justified that this is the location of a global maximum. A critical point is only a potential location of a local minimum or maximum. But with a bit more justification: observe that \(\L'\) is positive on the interval \((0, 8)\) and negative on the interval \((8, \infty)\text{.}\) Therefore the function \(\L\) increases on \((0, 8)\) and decreases on \((8, \infty)\text{.}\) So it must reach its maximum at \(\lambda = 8\text{,}\) which is therefore the MLE.
The situation for continuous random variables is similar, but slightly different. To build the likelihood function, we should use the pdf of the continuous random variable. So the likelihood function will give the probabiliy density given the data collected, rather than the probability itself.
Suppose we observe a cell and measure the time \(T\) until a toxin molecule leaves the cell. Then \(T \sim \Exp(\lambda)\) for some unknown rate parameter \(\lambda\text{:}\)
The critical point is \(\lambda = \frac{1}{0.3} \approx 3.33\text{.}\) Since \(\L' \gt 0\) on \((0, 3.33)\) and \(\L' \lt 0\) on \((3.33, \infty)\text{,}\) there is a global maximum at \(\lambda \approx 3.33\text{,}\) which is therefore the MLE.
The specific time \(0.3\) minutes doesnβt particularly matter in this calculation. Whatever the time \(t\text{,}\) essentially the same calculation will result in a MLE of \(\lambda = 1/t\text{.}\) But what if we collect multiple pieces of data?
How should take all of this data into account in our maximum likelihood estimation? We might consider taking the average of all of the separate rate estimations, which would give \(1.87\text{.}\) Is this the most likely? We need some mathematical justification.
The only critical point is \(5/3.1 \approx 1.61\text{.}\) Since \(\L' \gt 0\) on \((0, 1.61)\) and \(\L' \lt 0\) on \((1.61, \infty)\text{,}\) there is a global maximum at \(\lambda = 1.61\text{,}\) which is therefore the MLE.
It may seem less clear how to generalize this calculation for other tables of data. Observe that the value \(3.1\) is the sum of the five times in the table, so \(3.1/5\) is the average time. The MLE turned out to be the reciprocal of the average time (just as the MLE with only one data point was the reciprocal of that one time). Notice that this does not match the guess we made previously of averaging the individual rate estimations for each data point.
If we observe a Poisson process and see events occur after waiting times \(t_1, t_2, \dotsc, t_n\text{,}\) then the MLE of the rate parameter \(\lambda\) is \(\frac{n}{t_1 + t_2 + \dotsb + t_n}\text{.}\)
Suppose a coin has an unknown probability of coming up heads. We perform the experiment in five independent trials, during which it takes 4, 5, 4, 3, and 6 flips to see our first heads in each trial. What is the maximum likelihood estimation for the probability of the coin coming up heads on a flip?
Suppose a coin has an unknown probability of coming up heads. We perform the experiment in \(n\) independent trials, during which it takes \(k_1, k_2, \dotsc, k_n\) flips to see our first heads in each trial. Find a "common sense" MLE formula for the geometric distribution.
A particular store owner wants to approximate the average hourly rate at which customers come into the store. They observe 80 customers enter during a particular 4-hour shift. What is the maximum likelihood estimation for the hourly customer rate?
A radioactive material emits particles at an unknown probabilistic rate \(\lambda\) particles per minute. We observe particles emitted at times 1.1, 1.7, 1.3, 2.2, 1.9, and 1.8 minutes. Write the likelihood function \(\mathcal{L}(\lambda)\) based on this data. What is the maximum likelihood estimation for \(\lambda\text{?}\)
Suppose a parameter \(\theta\) takes values in \([0, 1]\) with likelihood function \(\mathcal{L}(\theta) = \sqrt{\theta} - \theta^2\text{.}\) Find the maximum likelihood estimation of \(\theta\text{.}\)