(Cmd/Ctrl + Click to open in a new tab)
An interactive R Shiny toy model for exploring the statistical properties of hydrologic stress as defined by Nathan et al. (2019).
This tool shows that "stress" is not simply a measure of physical flow alteration — it is a statistical relationship between the magnitude of alteration and the natural variability of the system over a specific timeframe.
Nathan et al. (2019) suggest one way to calculate hydrological "stress" from flow alteration is to compare the distribution of system behaviour under baseline conditions against altered conditions:
The key concept involved is to characterise "hydrologic stress" relative to the range of behaviour encountered under baseline conditions [...] If the range of future behaviour lies largely within the range encountered under baseline conditions, then it can be concluded that the additional stress on the system due to climate change is low.
However, implementations of Nathan et al.'s "stress score" (e.g. John et al., 2023; Morden et al., 2025) often apply a sliding window to calculate the relevant indicator of hydrological alteration (e.g. mean annual flows) through time. This introduces a statistical artefact that this model explores: window dependency.
Users should be aware of a mathematical property of this score: the stress score is dependent on the window length used to calculate the flow metric.
It is important to distinguish between two different “n” effects:
A. Increasing the number of independent samples from the same distribution. With more observations, estimates become more precise, but the underlying distribution does not change.
B. Changing the variance of the metric itself through temporal averaging.
When indicators are calculated over rolling windows (e.g. 5-, 10-, or 30-year means), the variability of the metric decreases as window length increases (approximately proportional to
| Window length | Variance (noise) | Distribution overlap | Stress score |
|---|---|---|---|
| Short (e.g. 5 years) | Higher | Higher | Lower |
| Long (e.g. 30 years) | Lower | Lower | Higher |
The window dependency demonstrated in this model arises from (B), not (A). The issue is not that more data are being used, but that averaging changes the variance of the indicator itself.
Nathan et al.’s stress formulation compares the distribution of an indicator under baseline and altered conditions. In practice, this means stress depends on the ratio:
where:
-
$\Delta$ is the shift between baseline and scenario, -
$\sigma$ is the variability of the indicator.
When rolling windows are used,
This behaviour is not specific to any single test. Whether overlap-based metrics, rank-based measures, or distributional distances (e.g. Kuiper’s statistic) are used, all depend in some way on the relative separation of distributions. If averaging reduces variability, apparent separation increases.
The underlying issue is therefore not the choice of metric, but the temporal aggregation applied to the indicator.
The key point is not that the stress metric is “wrong,” but that it is sensitive to analyst-defined temporal aggregation. Window length changes the statistical lens through which alteration is viewed, and this can materially alter the interpretation of stress.
Studies using this metric shoukd align the window length with a biological or engineering reality, rather than choosing it arbitrarily.
Nathan et al. (2019) explicitly note the need for a "characteristic period":
The relevant period for some short-lived fish might be 1 year while that for long-lived fish, or riparian wetland systems, may be 15 years or longer.
John et al. (2023) mathematically confirm the impact of shorter windows:
Metrics calculated over shorter hydroclimatic sequences are inherently more variable than those calculated over longer sequences [...] This suggests that a larger climate-induced change may be required for shorter sequences before the signal becomes dominant.
This feature allows you to visualise the sensitivity of the stress score to the window length.
- Set the Rolling Window to 5 years (high variability).
- Click Ghost Current View. A dashed line will freeze this "high noise" state.
- Move the Rolling Window to 30 years.
- Compare: Observe how the solid lines (30-year) narrow and pull apart compared to the ghosted lines (5-year). The jump in the stress score shows the emergence of the signal from noise.
The simulation generates synthetic river data using an additive noise model with linear non-stationarity.
The "baseline" and "post-withdrawal" time series are constructed as:
where:
-
Base flow (
$\mu_{\text{base}}$ ) — fixed at 60 units. - Trend — linear gain or loss (−0.5 to +0.5 units/month) representing non-stationarity (e.g. climate drying or wetting).
- Gap — constant subtraction representing the signal (human withdrawal).
The noise term
This ensures that changing the distribution shape does not accidentally change the magnitude of the variance, allowing for a fair comparison of how skewness affects signal detection.
Users can toggle the underlying probability distribution of the noise to test robustness:
- Normal (Gaussian) — symmetric noise; the baseline for standard signal processing.
- Log-normal — right-skewed; representative of real-world river flows where flows cannot be negative but can have high outliers.
- Weibull — simulates regimes driven by extreme events or "fat tails."
- Overlap — the area shared by the baseline and impacted distributions. An overlap of 1.0 indicates the impact is indistinguishable from natural variability.
-
Stress score — calculated as
$1 - \text{Overlap}$ (signed by direction of change). A score of$\pm 1.0$ is taken to indicate that the altered flow regime is entirely novel — a "new normal" completely outside the historical range.
However, if a change in window length can move the stress score from -0.2 to -1.0 for a relatively small constant change, does -1.0 always reflect a "new regime"?
The lower panel displays kernel density estimates of the rolling-window mean annual flow values computed from the simulated monthly time series after aggregation to annual means. For a selected window length (e.g., 5, 10, 20, or 30 years), the model first converts monthly flows to one mean value per year, then calculates a moving average across that many years, producing one windowed value per year once the window is full. The density curves therefore approximate the probability distribution of the rolling-window mean annual-flow metric across the full simulated record. Each curve integrates to one. The shaded overlap area represents the shared probability mass between the baseline and post-withdrawal distributions of that rolling mean annual statistic. Because adjacent rolling windows share most of the same years, the values contributing to the density are serially dependent; the chart represents the marginal distribution of the windowed annual-flow metric, not a set of independent multi-year samples.
- Nathan, R.J. et al. (2019). Assessing the degree of hydrologic stress due to climate change. Climatic Change, 156(1–2):87–104.
- John, A. et al. (2023). The time of emergence of climate-induced hydrologic change in Australian rivers. Journal of Hydrology, 619:129371.
- Morden, R. et al. (2025). Mitigating impacts of climate change on flow regimes through management of small dams and abstractions. Journal of Hydrology, 661:133583.