06-likelihood-vs-probability's likelihood_curve swept a grid of candidate means and evaluated each one, then you could squint at a plot and guess where the peak was. That's fine for one parameter and a hand-picked grid, but it doesn't scale, doesn't give an exact answer, and doesn't generalize to distributions with several parameters at once (mean AND std together).
Maximum likelihood estimation (MLE) is the principled version of "find where the likelihood curve peaks": instead of searching a grid, use calculus, set the derivative of the (log-)likelihood to zero and solve, to get an exact, closed-form answer directly. For a Normal distribution, this turns out to have a remarkably simple, familiar answer.
Theory works in log-space (summing log-densities rather than multiplying raw densities, for numerical stability) and derives closed-form MLE formulas for a Normal distribution's mean and standard deviation by setting derivatives to zero. Implement the log-space objective first (so you can numerically verify the closed forms against it), then the two closed-form estimators directly.
Implement negative_log_likelihood_normal(x, mean, std), mle_normal_mean(x) and mle_normal_std(x) against that reasoning. The signatures and docstrings are already in the editor.
negative_log_likelihood_normal works in log-space (sum of log(density)), not -log(product of densities).mle_normal_mean and mle_normal_std are closed-form (no search, no calls to negative_log_likelihood_normal).mle_normal_std divides by n (the biased estimator), not n - 1, Theory explains why MLE gives this specific version.Open one at a time. Each gives away a little more than the last.
log(a * b * c) = log(a) + log(b) + log(c). Turn the product from joint_density into a sum of logs instead.
The MLE for the mean of a Normal distribution turns out to be exactly the plain sample average, no surprise formula needed.
Click "Run Tests" to test your implementation