Two machines fill boxes; X has n readings and Y has m. Each simulated study computes F = sY2/sX2 and rejects H0: σX2 = σY2 at the 5% level when F falls outside the two cut-offs (gold lines) of Theorem 9.3.1. The bottom panel is the histogram of ln F over the studies, with the F density that theory predicts for normal data drawn on top. With normal data the histogram follows the curve and the test rejects 5% of the time when the variances are equal. Change the shape of the data to heavy tails or skew: the curve no longer fits, the histogram is too wide, and the test cries wolf far more often, however large the samples.
code/ch09_two_sample_inference.py (f_test, f_power_normal, sim_f_size, f_size_kurtosis).