The Wald test of H0: θ = θ0 rejects when |W| > zα/2, where W = (θ̂ − θ0)/se standardises the estimate. Its power function β(θ) is the probability of rejecting when the true value is θ; its size is β(θ0), which should be α. For a Normal mean the power has a closed form; for a Bernoulli probability or a Poisson mean the estimate takes only lattice values, and β(θ) is an exact finite sum. The upper panel compares this exact power with the book's approximation (10.6) and with a simulation; the lower panel shows the exact size as the sample size grows.
Normal model: Xi ~ N(θ, 1) with σ = 1 known, so se = 1/√n and both standard errors coincide. Bernoulli: θ̂ = S/n, estimated se √(θ̂(1 − θ̂)/n), null se √(θ0(1 − θ0)/n). Poisson: θ̂ = S/n, se √(θ̂/n) or √(θ0/n). When the estimated se is 0 (all observations equal), the test rejects exactly when θ̂ ≠ θ0. The approximation (10.6) uses the standard error at the true value. The one-sided version (Example 10.2) rejects when W > zα. Simulated data come from the seeded generator (seed in the readout): data set r uses draws rn + 1, …, (r + 1)n.
code/ch10_hypothesis_testing.py (power_normal, wald_power_approx, wald_exact_power, wald_sim; Figures 10.1 and 10.S1).