For some families of two-parameter distributions, it is difficult to find maximum likelihood estimates algebraically.

A numerical method must then be used to evaluate the maximum likelihood estimates.

A simple algorithm is a grid search; it simply evaluates the log-likelihood over a grid of values of the two parameters, letting us identify approximately where the maximum lies. The grid can then be refined to focus on a narrower range of possible parameter values.

Beta distribution

The following data set contains proportions between zero and one:

0.078 0.713 0.668 0.621 0.069 0.378 0.735 0.255 0.220 0.220
0.136 0.413 0.516 0.183 0.724 0.377 0.409 0.403 0.042 0.692
0.486 0.421 0.358 0.236 0.654 0.717 0.520 0.266 0.520 0.641

A reasonable distribution that could be used to model the data would be a beta distribution with probability density function

\[ f(x) \;\;=\;\; \begin{cases} \dfrac {\Gamma(\alpha +\beta) }{\Gamma(\alpha)\Gamma(\beta)} x^{\alpha - 1} (1 - x)^{\beta - 1}& \text{if }0 \lt x \le 1 \\ 0 & \text{otherwise} \end{cases} \]

The log-likelihood is

\[ \begin{align} \ell(\alpha, \beta) \;=\; n \log \Gamma(\alpha + \beta) &- n \log \Gamma(\alpha) - n \log \Gamma(\beta) \\ &+ (\alpha - 1) \sum(\log(x_i) + (\beta - 1)\sum \log(1 - x_i) \end{align} \]

so we will maximise

\[ \ell(\alpha, \beta) \;=\; 30 \log \Gamma(\alpha + \beta) - 30 \log \Gamma(\alpha) - 30 \log \Gamma(\beta) -31.89 (\alpha - 1) - 18.75 (\beta - 1) \]

with respect to \(\alpha\) and \(\beta\). This cannot be done algebraically.

The following Excel spreadsheet shows the log-likelihood for values of \(\alpha\) between 1 and 2.4, and values of \(\beta\) between 2 and 3.4.

From these log-likelihoods, the maximum is at \(\alpha \approx 1.8\) and \(\beta \approx 2.6\).

Refining the grid to values of \(\alpha\) and \(\beta\) near 1.8 and 2.6, we can find that the MLEs are approximately

\[ \hat{\alpha} = 1.81 \spaced{and} \hat{\beta} = 2.56 \]