For independent data the likelihood is the product of the densities at the data points, ∏n N(xn | μ, σ2). Its maximum is at the sample mean and the sample variance about it. That variance estimate is measured from a centre fitted to the same data, so it is too small on average by the factor (N − 1)/N: a small, exactly computable example of how fitting and evaluating on the same data flatters a model.
code/ch02_probabilities.py (functions gauss_ml, gauss_loglik, likelihood_data_js, ml_bias_js).