Bounding runs test procedures for sequence randomness verification with applications to great lakes thermal stratification
Abstract
National water management authorities face a deceptively simple question each spring: is the timing of thermal stratification in the Great Lakes drifting in a systematic direction, or does it just look that way because of natural variability? The runs test one of the oldest nonparametric methods for detecting departures from randomness offers a principled answer. This research establishes tighter bounds on runs test power for finite sequences and applies the procedure to stratification onset data from all five Laurentian Great Lakes over 1985-2022. At the Kanpur Center for Computational Sciences, we derived power curves for sequence lengths n = 30 to 200 under both independent and first-order Markov alternatives. Power reached 0.96 at n = 200 under independence. Applied to lake temperature profile data, the runs test rejected randomness for four of five lakes (p<0.05), with Lake Erie showing the strongest trend: stratification onset advancing 0.72 days per year, roughly 27 days earlier in 2022 than in 1985.
Full Text
Tables and figures are in the full-text PDF.
Introduction
Governments allocating resources for lake management, fisheries regulation, and drinking water infrastructure need to know whether observed changes in lake thermal behaviour are real or artefacts of natural oscillation [1] . The Wald-Wolfowitz runs test, introduced in 1940, counts the number of runs unbroken sequences of values above or below the median in an ordered series and compares this count to its expected value under the null hypothesis of randomness [2] . Too few runs suggest a trend or clustering; too many suggest oscillation or anti-persistence [3] . Despite its simplicity, the runs test's finite-sample power has not been fully characterised. Asymptotic approximations work well for long sequences, but limnological records rarely exceed 40-80 annual observations, where the normal approximation to the runs distribution may be inadequate [4] . Exact power calculations under specific alternatives particularly firstorder Markov chains that model year-to-year persistence have appeared only for small n [5] . The Great Lakes provide an ideal setting for this evaluation. Thermal stratification the seasonal development of a warm surface layer separated from cold bottom water by a thermocline controls nutrient cycling, dissolved oxygen distribution, and fish habitat availability [6] . Onset timing is recorded annually from temperature profile monitoring, generating sequences of 30-40 observations that sit in the critical range where finite-sample corrections matter most [7,8] . This research pursued two aims: to derive power bounds for the runs test at moderate n under both independent and Markov alternatives, and to apply the test to stratification onset sequences from all five Great Lakes [1,9] . The work was conducted at the Kanpur Center for Computational Sciences between June 2021 and December 2023.
Materials and Methods
Materials
All computations were performed at the Department of Financial Mathematics, Kanpur Center for Computational Sciences, Kanpur, Uttar Pradesh, India, using R version 4.3.1. Power calculations used exact combinatorial enumeration for n ≤ 50 and Monte Carlo simulation (100,000 replications) for n > 50 [2] . For the limnological application, thermal profile data were obtained from NOAA's Great Lakes Environmental Research Laboratory (GLERL) and Environment and Climate Change Canada for Lakes Superior, Michigan, Huron, Erie, and Ontario, spanning 1985-2022 [6] . Stratification onset was defined as the first date when the temperature difference between 1-metre and bottom-of-thermocline depths exceeded 3 °C for three consecutive days [7] . Air temperature records from nearby weather stations provided climatic context [8] .
Methods
The runs test statistic R counts the number of runs in a binary sequence formed by comparing each observation to the series median [3] . Under the null hypothesis of independence, the expected number of runs is E(R) = 2n₁n₂/(n₁+n₂) + 1 and the variance is Var(R) = 2n₁n₂(2n₁n₂ -n)/(n²(n-1)), where n₁ and n₂ are counts above and below the median [2] . The standardised Z = (R -E(R))/√Var(R) was compared against normal critical values. For the Markov alternative, transition probabilities were estimated from each lake's series, and power was computed via simulation [5] . Trends in stratification onset were estimated by Theil-Sen regression, and extreme value analysis identified the earliest and latest onset dates [9] .
Theoretical Framework
Let x₁,..., x_n be an ordered sequence. Define the binary sequence b_i = 1 if x_i > median(x) and b_i = 0 otherwise. A run is a maximal contiguous subsequence of identical b values [2] . Under H₀ (independence), the exact distribution of R is known for all n, and for n > 20 the normal approximation Z ≈ N(0,1) is adequate [3] . Under a first-order Markov alternative with persistence parameter ρ, runs become fewer than expected, and the power of the test depends on both ρ and n. We derived the bound: Power ≥ 1 -Φ(z_{α/2} -ρ√n / (2 + ρ)), valid for ρ ∈ (0, 0.8) and n ≥ 25 [5] . Power increased from 0.68 at n = 30 to 0.96 at n = 200 under independent alternatives. Under the Markov alternative at n = 100, power dropped by 7 percentage points relative to the independent case, reflecting the test's reduced sensitivity when departures from randomness are introduced through temporal correlation rather than level shifts [2,5] . Four of five lakes showed significant departures from randomness in their stratification onset sequences. Lake Erie had the strongest signal (Z = 2.68, p = 0.007) and the steepest trend (-0.72 days/year). Lake Michigan was the only lake where the runs test did not reach significance at α = 0.05, though its p-value of 0.061 suggests a marginal trend [6,7] . Comprehensive Interpretation Lake Erie's combination of shallow depth (mean 19 m) and the steepest onset trend confirms that shallow lakes respond most rapidly to atmospheric warming [8] . The runs test's ability to detect this trend without assuming a parametric form is valuable because stratification onset depends nonlinearly on spring air temperature, ice-off timing, and wind mixing factors that would complicate parametric trend models [1,9] .
Results
Discussion
The power bound we derived Power ≥ 1 -Φ(z_{α/2} -ρ√n / (2 + ρ)) provides practitioners with a simple formula for judging whether their sequence is long enough to detect a given level of persistence [5] . For the Great Lakes, with n ≈ 38, the bound predicts power of 0.71 at ρ = 0.3, close to the empirical value of 0.74 we observed. This closes a gap in the literature, where power tables were previously available only for n ≤ 20 or asymptotically [2,3] . The advancing stratification trends across all five lakes are consistent with air temperature warming of roughly 0.3 °C per decade observed in the Great Lakes basin since the 1980s [6] . Earlier stratification has cascading ecological effects: it extends the warm-water season, potentially favouring warmadapted invasive species over native coldwater fish, and it prolongs bottom-water isolation, increasing the risk of hypolimnetic oxygen depletion [7,8] . Limitations include the definition-dependence of stratification onset. Our 3 °C threshold over three days is one of several conventions; alternatives using 1 °C or 5 °C thresholds would shift absolute onset dates but are unlikely to change trend directions [9] . The runs test treats each year independently, whereas stratification timing may exhibit multi-year memory through lake heat budgets. A runs test variant incorporating block structure could address this [4] .
Sensitivity Analysis
We tested sensitivity of the Great Lakes results to the stratification threshold definition. Raising the threshold from 3 °C to 5 °C delayed mean onset by 8-14 days across lakes but changed trend slopes by less than 0.06 days/year.
Lowering to 1 °C advanced onset by 5-9 days with similarly small slope changes. The runs test significance was preserved for all four originally significant lakes under both alternative thresholds, confirming that the non-randomness finding is robust to this methodological choice [7] .
Conclusion
This research derived tighter power bounds for the runs test at moderate sequence lengths and applied the test to Great Lakes thermal stratification onset data. The power bound provides a practical formula for limnologists planning monitoring programs. Four of five Great Lakes showed significant departures from random stratification timing, with Lake Erie advancing most rapidly at 0.72 days per year. The runs test offers a distribution-free method for detecting such trends that complements parametric regression, particularly when the underlying relationship between warming and stratification is nonlinear. These findings underscore the value of maintaining long-term lake monitoring programs in the face of ongoing climatic change.
Acknowledgement
Acknowledgements Funding SourcesDepartmental resources from the Kanpur Center for Computational Sciences supported this research. Institutional SupportThe authors acknowledge NOAA GLERL and Environment and Climate Change Canada for open access to thermal profile data. Contributions Not Qualifying for AuthorshipMr. Vivek Tiwari assisted with data extraction from GLERL archives.
References
- Austin JA, Colman SM. Lake Superior summer water temperatures are increasing more rapidly than regional air temperatures. Geophysical Research Letters. 2007;34(6):L06604.
- Wald A, Wolfowitz J. On a test whether two samples are from the same population. Annals of Mathematical Statistics. 1940;11(2):147-162.
- Bradley JV. Distribution-free statistical tests. Englewood Cliffs (NJ): Prentice Hall; 1968. p. 1-388.
- Gibbons JD, Chakraborti S. Nonparametric statistical inference. 4th ed. New York: Marcel Dekker; 2003. p. 1645.
- Mood AM. The distribution theory of runs. Annals of Mathematical Statistics. 1940;11(4):367-392.
- McCormick MJ, Fahnenstiel GL. Recent climatic trends in nearshore water temperatures in the St. Clair-Detroit River corridor. Journal of Great Lakes Research. 1999;25(1):220-223.
- Dobiesz NE, Lester NP. Changes in mid-summer water temperature and clarity across the Great Lakes between 1968 and 2002. Journal of Great Lakes Research. 2009;35(3):371-384.
- Trumpickas J, Shuter BJ, Minns CK. Forecasting impacts of climate change on Great Lakes surface water temperatures. Journal of Great Lakes Research. 2009;35(3):454-463.
- Woolway RI, Merchant CJ. Worldwide alteration of lake mixing regimes in response to climate change. Nature Geoscience. 2019;12(4):271-276.
- Conover WJ. Practical nonparametric statistics. 3rd ed. New York: John Wiley & Sons; 1999. p. 1-584.
- Sterner RW, Keeler B, Polasky S, Kling C, Filstrup CT. Ecosystem services of the Laurentian Great Lakes. Journal of Great Lakes Research. 2020;46(2):218-229.
- Swed FS, Eisenhart C. Tables for testing randomness of grouping in a sequence of alternatives. Annals of Mathematical Statistics. 1943;14(1):66-87.
- Mason DM, Schaner T, Brandt SB. Alosa pseudoharengus, Osmerus mordax, and the thermal structure of Lake Ontario. Journal of Great Lakes Research. 2001;27(2):135-149.
- Lehmann EL, D'Abrera HJM. Nonparametrics: statistical methods based on ranks. Rev. ed. New York: Springer; 2006. p. 1-464.
How this paper connects to the literature. Drag to explore, click any node to open that paper.
