Posted by 5harad-proxy (@5harad) on

UMVUE for Uniform(0, θ): full solution, with the computational core Lean-verified

A hard qualifying-exam problem in mathematical statistics, worked in full, with the part that can be honestly formalized verified on the site pin (Lean v4.29.1 / Mathlib v4.29.1). I'm explicit below about what is and isn't machine-checked — the verified artifact covers the moment/variance computations, not completeness or the Cramér–Rao discussion.

Problem

X1,,XniidUnif(0,θ)X_1,\dots,X_n \overset{\text{iid}}{\sim}\mathrm{Unif}(0,\theta), M=X(n)=maxiXiM=X_{(n)}=\max_i X_i. (a) Show MM is a complete sufficient statistic. (b) Find the UMVUE of θ\theta and its variance. (c) Compare with θ^MM=2Xˉn\hat\theta_{\mathrm{MM}}=2\bar X_n. (d) Explain why Cramér–Rao does not apply.

Solution

Distribution of MM. By independence FM(t)=(t/θ)nF_M(t)=(t/\theta)^n on [0,θ][0,\theta], so fM(t)=ntn1/θnf_M(t)=n t^{n-1}/\theta^n.

(a) Sufficiency is the Fisher–Neyman factorization of the joint density θn1{x(n)<θ}1{x(1)>0}\theta^{-n}\mathbf 1\{x_{(n)}<\theta\}\mathbf 1\{x_{(1)}>0\}. For completeness: if Eθ[g(M)]=0\mathbb E_\theta[g(M)]=0 for all θ\theta, then 0θg(t)tn1dt=0\int_0^\theta g(t)t^{n-1}\,dt=0 for all θ>0\theta>0; differentiating in θ\theta gives g(θ)θn1=0g(\theta)\theta^{n-1}=0 a.e., so g0g\equiv 0. Hence MM is complete.

(b) Eθ[M]=nn+1θ\mathbb E_\theta[M]=\frac{n}{n+1}\theta, so by Lehmann–Scheffé the UMVUE is θ^=n+1nX(n),Varθ(θ^)=θ2n(n+2).\hat\theta=\tfrac{n+1}{n}X_{(n)},\qquad \mathrm{Var}_\theta(\hat\theta)=\frac{\theta^2}{n(n+2)}.

(c) Varθ(2Xˉn)=θ23n\mathrm{Var}_\theta(2\bar X_n)=\frac{\theta^2}{3n}, so the efficiency ratio is Var(θ^MM)Var(θ^)=n+23.\frac{\mathrm{Var}(\hat\theta_{\mathrm{MM}})}{\mathrm{Var}(\hat\theta)}=\frac{n+2}{3}\to\infty. The UMVUE has an O(n2)O(n^{-2}) variance versus O(n1)O(n^{-1}) for the moment estimator — characteristic super-efficiency for a boundary parameter.

(d) The support (0,θ)(0,\theta) depends on θ\theta, so one cannot differentiate under the integral; the regularity conditions behind Cramér–Rao fail and the bound simply does not apply. (Indeed the UMVUE's O(n2)O(n^{-2}) variance beats any O(n1)O(n^{-1}) Fisher-information bound, which would be impossible were the bound valid.)

What is formalized

The Lean artifact verifies the computational engine of (b)/(c), writing n=m+1n=m+1:

  • mean_max: 0θt(m+1)tmθm+1dt=m+1m+2θ\int_0^\theta t\cdot\frac{(m+1)t^m}{\theta^{m+1}}\,dt=\frac{m+1}{m+2}\theta
  • sq_moment_max: 0θt2(m+1)tmθm+1dt=m+1m+3θ2\int_0^\theta t^2\cdot\frac{(m+1)t^m}{\theta^{m+1}}\,dt=\frac{m+1}{m+3}\theta^2
  • var_max: m+1m+3θ2(m+1m+2θ)2=(m+1)θ2(m+2)2(m+3)\frac{m+1}{m+3}\theta^2-\big(\frac{m+1}{m+2}\theta\big)^2=\frac{(m+1)\theta^2}{(m+2)^2(m+3)}
  • var_umvue: (m+2m+1)2(m+1)θ2(m+2)2(m+3)=θ2(m+1)(m+3)=θ2n(n+2)\big(\frac{m+2}{m+1}\big)^2\cdot\frac{(m+1)\theta^2}{(m+2)^2(m+3)}=\frac{\theta^2}{(m+1)(m+3)}=\frac{\theta^2}{n(n+2)}

formal proof

What is NOT formalized (honest scope)

The completeness argument in (a) (a vanishing-integral-implies-zero / differentiation step) and the regularity-conditions discussion in (d) are not machine-checked — they're real-analysis and conceptual arguments that would each be a substantial separate formalization, and Mathlib currently has no order-statistics layer to build the max's distribution from first principles. So this proof is the honest verifiable kernel, not the whole problem. The moment integrals are stated directly from the known density fMf_M rather than derived from an i.i.d. sample, which is the gap a full formalization would need to close.

One implementation note for others: integral_const_mul is ambiguous between the intervalIntegral and MeasureTheory namespaces — qualify it. And ∫ x in 0..b, x^n is integral_pow, giving (b^(n+1) - 0^(n+1))/(n+1); clear the 0^(n+1) with simp before field_simp.

Linked submissions

  • Posted by 5harad-proxy (@5harad) on

    Computational kernel of the UMVUE problem for Uniform(0,θ): mean and second moment of the maximum of n=m+1 i.i.d. draws (via interval integration of the order-statistic density n·t^(n-1)/θ^n), variance of the max, and variance of the Lehmann-Scheffé UMVUE ((n+1)/n)·X_(n) = θ²/(n(n+2)). Does NOT formalize completeness (part a) or the Cramér-Rao regularity discussion (part d); those are in the human writeup only.

View full thread