Quiz: simulation envelopes and global tests
Before this unit: Ripley’s K, the L function and the pair correlation (previous unit); Day 16: Measurements.
See also: Day 20: Point detection; Day 38: Evaluation and statistics; Day 48: Colocalisation.
Short questions to test your understanding. Try each on paper first, then open the answer.
Q1. To test an observed L(r) - r against CSR by simulation, what must the simulated patterns have in common with the observed one?
Four things.
The same number of points, the same window (tissue mask), and the curve must be computed the same way (same function, same edge correction, same radii).
Q2. The observed L(5) − 5 is larger than 97 of 99 simulated values and smaller than 2. What is the one-sided Monte Carlo p-value?
Count the observed itself.
(1 + 2)/(1 + 99) = 0.03.
Q3. Why can a curve that leaves a 39-simulation pointwise envelope at one of 25 radii not be called significant at 5 %?
How many tests were made?
The 5 % holds for one pre-chosen r. Looking at 25 radii is 25 tests; the chance that a random pattern leaves the band somewhere is much higher (about 37 % in the simulations of the lecture).
Q4. How does the MAD test avoid the problem?
One number per curve.
It reduces every curve (observed and simulated) to one number, the largest absolute deviation from the CSR curve over a range of r fixed in advance, and ranks the observed number among the simulated ones: a single test with the right level.
Q5. A colleague widens the r range, changes from L to g and from 39 to 99 simulations until p < 0.05. What is wrong?
Recall tuning on the test set.
Each choice is another test; picking the one that “works” inflates the false positive rate, exactly like tuning a classifier on its test set. Fix function, range, correction and number of simulations before looking.
Q6. Is the grey pointwise envelope a confidence band for the observed curve?
What was simulated?
No. It shows how curves of CSR patterns vary: it describes the null hypothesis. The uncertainty of the observed curve itself needs replicate images (or resampling of images).
Q7. Three experiments, two conditions, five images each, 200 cells per image. What is n for the comparison of the conditions, and what goes into the test?
Unit of replication.
n = 3 experiments per condition. Compute one summary per image (e.g. L(r₀) − r₀ at a pre-chosen r₀), average the 5 images of each experiment and condition, and test the 3 vs 3 experiment means (paired by experiment if both conditions were run in each).
Q8. (math) Why is the rank of the observed statistic among s simulations uniform under the null hypothesis?
Exchangeability.
Under H_0 the observed pattern is one more draw from the same process, so T_0, \dots, T_s are exchangeable: every ordering is equally likely, and T_0 takes each of the s + 1 ranks with probability 1/(s + 1).