Wilcoxon + FDR superposed-epoch demo

Interactive companion to Constraints on the interpretation of atmospheric potential gradient anomalies associated with earthquakes: Evidence from Peru and ArgentinaRomero et al. (2026).

This simulator reproduces the statistical framework of Section 4.3 of the paper. It generates synthetic earthquake-centered PG' data with parameters matched to the observed CAS / ICA backgrounds and shows how the Wilcoxon signed-rank test combined with BH-FDR correction detects (or fails to detect) injected anomalies of varying amplitude, duration, and lag.

Quick orientation. Each row of the heatmap = one earthquake (n events total). Each column = one relative day from −90 to +15 (106 days). The colour shows the event-level daily median PG' (red = positive, blue = negative). The Wilcoxon test runs independently at each of the 106 days. Day 0 is highlighted because it is the focal lag in the precursor literature, but a real anomaly at any day would be flagged.

1. Controls

117
14.0
42
0.0
-2
3
100
0.05

Run a simulation to see results.

2. Heatmap (events × relative day)

3. Composite day-level median + Wilcoxon significance

4. −log10(p) per day with FDR threshold

5. How to interpret

6. Pedagogical exercises

  1. Run Preset 1 (null): confirm that q < 0.05 occurs at zero or very few days (false positives). Repeat with different seeds — the false-positive count fluctuates.
  2. Run Preset 2 (weak pre-seismic): at amplitude near MDE the FDR may or may not catch the anomaly. Increase amplitude until detection becomes consistent.
  3. Run Preset 3 (strong pre-seismic): detection is now robust. Try lowering the "fraction of events showing anomaly" — what fraction is needed for detection?
  4. Run Preset 4 (single-day shift): a brief 1-day shift is detectable if amplitude is high enough. Try varying the shift amplitude to find the practical detection threshold.
  5. Try a positive amplitude to confirm the test is two-sided.
  6. Set duration = 30 days at amplitude = −2 V/m: a sustained but small shift may be detected by FDR even though no single day is dramatic.
Connection to Section 4.3 of P04_EQK: in our real CAS / ICA data, no configuration showed FDR-significant day 0 across 20 stratified subsets. This simulator shows you what a real signal would have looked like.