From Y successes in n trials, three estimators of p compete: the maximum likelihood estimator Y/n, the minimax estimator (Y + √n/2)/(n + √n), and the posterior mean (Y + α)/(n + α + β) for a Beta(α, β) prior of your choice. Their exact risk functions cross, so none is best at every p. Panel (a) shows the risk functions and a second, independent prior (the “judge”) used to average them; the table ranks the estimators by their worst case (maximum risk) and by their average (Bayes risk); panel (b) shows how both rankings change with n.
Squared loss is (p̂ − p)²; weighted loss divides it by p(1 − p) (Example 12.13). All risks are exact: R(p) = [np(1 − p) + (α − (α + β)p)²]/(n + α + β)² and its Beta averages are in closed form. Setting α = β = 0 gives the MLE.
code/ch12_decision_theory.py (bern_risk, bern_max_risk, bern_bayes_risk; Figures 12.2 and 12.S1).