Estimating quantile regression for heteroscedastic models with applications to Ebro basin reservoir management
Abstract
Reservoir inflow forecasting models are often evaluated at the conditional mean, yet water managers care most about extreme quantiles the high flows that trigger flood releases and the low flows that constrain irrigation allocations. This research developed a quantile regression framework for heteroscedastic inflow models and applied it to four reservoirs in the Ebro Basin of northeastern Spain. Monthly inflow records spanning 2005 to 2022 were paired with precipitation, temperature, and snowpack covariates. A location-scale quantile regression was fitted at 19 quantile levels from τ = 0.05 to τ = 0.95, and asymptotic standard errors were obtained via a kernel-based sandwich estimator that accounts for non-constant variance. Model performance was benchmarked against ordinary least squares and a standard quantile regression that ignores heteroscedasticity. The proposed estimator reduced the mean check-loss by 14.7% relative to the homoscedastic quantile regression and by 23.1% relative to OLS across all quantile levels. At the extreme tails (τ = 0.05 and τ = 0.95), improvements reached 31.4% and 27.8% respectively. Coverage probabilities of 90% prediction intervals were closer to the nominal level for the heteroscedastic model (89.3%) than for the homoscedastic alternative (82.6%). The framework gives reservoir operators quantile-specific inflow forecasts that better reflect the true uncertainty of hydrological extremes.
Full Text
Tables and figures are in the full-text PDF.
Introduction
For centuries, the Ebro River has supplied irrigation water to one of the driest agricultural regions in western Europe, and its network of over 100 reservoirs stores roughly 57% of the basin's mean annual runoff [1] . Managing these reservoirs requires inflow forecasts that capture not just the expected value but also the range of plausible outcomes a task for which meanregression methods are poorly suited [2] . Quantile regression, introduced by Koenker and Bassett in 1978, estimates the conditional quantile function Q_Y(τ|X) = X'β(τ) and thereby provides a full distributional picture of the response [3] . However, standard quantile regression assumes that the error distribution, while potentially asymmetric, has a constant scale across the covariate space. In hydrological settings this assumption rarely holds: high-precipitation months produce both higher mean inflows and greater inflow variability, a textbook case of heteroscedasticity [4] . Ignoring this non-constant variance leads to inefficient coefficient estimates and, more critically, to prediction intervals whose coverage deviates from the nominal level [5] . Several remedies exist. He proposed a location-scale quantile regression that simultaneously models the conditional median and the conditional interquartile range, allowing the scale parameter to depend on covariates [6] . Machado and Santos Silva extended this idea to a countable set of quantile levels [7] . But applications to reservoir management remain scarce, and no published work has tested these methods on Ebro Basin inflows. This research addressed that gap by: (a) fitting a location-scale quantile regression to monthly inflows at four Ebro reservoirs; (b) comparing its check-loss and coverage performance with homoscedastic quantile regression and OLS; and (c) evaluating the practical value of quantile-specific forecasts for reservoir release decisions [8] .
Performance Evaluation
Model performance was assessed using three criteria. The check-loss function ρ_τ(u) = u(τ -I(u < 0)) was averaged over all observations and quantile levels to produce a global loss measure. Coverage probability was computed as the fraction of observed inflows falling within the model's 90% prediction interval (τ = 0.05 to τ = 0.95). Interval width was recorded as a secondary measure; a model that achieves correct coverage only by inflating interval width is less useful than one that achieves it with tighter bounds [3] . All comparisons used a rolling five-fold temporal crossvalidation, with each fold comprising a contiguous 43-month test period and the remaining months serving as the training set [9] .
Material and Methods Material
The research was conducted at the Abuja Regional Center for Statistical Methods, Abuja, FCT, Nigeria, between April 2021 and March 2023. Monthly inflow records for four Ebro Basin reservoirs Mequinenza, Ribarroja, Yesa, and El Grado were obtained from the Ebro Hydrographic Confederation opendata portal for the period January 2005 to December 2022 (216 months). Covariates included basin-averaged monthly precipitation and mean temperature from the Spanish Meteorological Agency (AEMET) and April-to-June snowpack water equivalent from ERA5-Land reanalysis at 9 km resolution. All variables were log-transformed where positively skewed and standardised to zero mean and unit variance before model fitting. Analyses were carried out in R 4.2.3 using the quantreg package (version 5.97) [10] .
Methods
A two-stage location-scale quantile regression was implemented. In the first stage, the conditional median (τ = 0.5) was estimated by standard quantile regression: Q_{0.5}(Y|X) = X'β(0.5). In the second stage, the absolute residuals |eᵢ| = |Yᵢ -X'β(0.5)| were regressed on the same covariates to obtain a scale function σ(X). Other quantile levels were then estimated as Q_τ(Y|X) = X'β(0.5) + σ(X)•F⁻¹(τ), where F⁻¹ is the quantile function of the standardised residuals. Asymptotic covariance matrices were computed using Powell's kernel estimator with bandwidth selected by the Hall-Sheather rule [6] . A homoscedastic quantile regression (ignoring the scale function) and OLS with Gaussian prediction intervals served as benchmarks.
System Design
The complete forecasting pipeline consisted of four modules: (i) a data ingestion module that downloaded and formatted monthly inflow and covariate records; (ii) a preprocessing module that handled log-transformation, standardisation, and missing-value imputation via seasonal decomposition; (iii) the quantile regression engine implementing the two-stage location-scale estimator; and (iv) a decision-support dashboard that displayed quantile-specific forecasts alongside reservoir operating rules. The dashboard plotted forecast fans shaded regions spanning the 5th to 95th percentile forecasts for each of the four reservoirs on a 12-month rolling horizon. Reservoir operators could toggle between conservative (τ = 0.05) and aggressive (τ = 0.95) release strategies directly on the interface [11] .
Results
Table 1 presents the mean check-loss across all 19 quantile levels for the three models at each reservoir. The location-scale quantile regression consistently outperformed both alternatives, with improvements ranging from 13.0% to 15.8% over the homoscedastic QR. Figure 1 shows that the OLS coefficient (dashed line) sits near the median QR estimate but fails to capture the rising slope at upper quantiles, confirming that the precipitation-inflow relationship strengthens in the right tail. Table 2 reports coverage probabilities and interval widths.
Comprehensive Interpretation
The location-scale model achieved coverage closest to the nominal 90% at all four reservoirs (mean 89.3%) while maintaining narrower intervals than OLS. This is because the heteroscedastic correction widens intervals during highvariability months and narrows them during stable periods, producing a better-calibrated uncertainty envelope. The scenario analysis (Figure 2) shows that conservative release strategies informed by the τ = 0.05 forecast maintain storage above 55% capacity year-round, while aggressive strategies based on τ = 0.95 can drop below 45% during late summer.
Discussion
The 14.7% mean improvement in check-loss mirrors findings from heteroscedastic quantile regression applications in finance, where similar gains were reported for equity return forecasting [6] . In the reservoir management context, the improvement is most pronounced at the tails (31.4% at τ = 0.05 and 27.8% at τ = 0.95), which are precisely the quantiles that matter most for flood-control and drought-management decisions [1] . The coverage analysis adds a complementary perspective. An 82.6% coverage for a nominal 90% interval means that roughly one in every 12 months, the observed inflow falls outside the predicted range a frequency that could lead to suboptimal release decisions. The location-scale model's 89.3% coverage reduces this to roughly one in every nine months, a meaningful improvement for operational planning [12] . That said, the two-stage estimator assumes a linear scale function, which may not capture abrupt variance changes driven by snowmelt onset or convective storm clusters. A nonparametric scale function estimated by local polynomial regression could improve flexibility at the cost of increased variance in the scale estimate itself. And the monthly temporal resolution smooths out sub-monthly inflow peaks that are relevant for dam safety; extending the framework to daily or weekly data would increase its practical value but also exacerbate the heteroscedasticity and require careful bandwidth selection [13] .
Conclusion
This research demonstrated that a location-scale quantile regression estimator substantially outperforms both standard quantile regression and ordinary least squares for forecasting monthly reservoir inflows at four Ebro Basin sites. The heteroscedastic correction reduced mean check-loss by 14.7% and brought 90% prediction interval coverage within one percentage point of the nominal level. Quantile-specific forecasts translated directly into actionable reservoir operating scenarios, with conservative strategies maintaining storage above critical thresholds throughout the year. Future extensions should explore nonparametric scale functions and finer temporal resolutions to capture sub-monthly inflow variability more faithfully.
Acknowledgement
Acknowledgements Funding SourcesThis research received support through internal departmental funding allocated for mathematical and computational investigations. No external grants were obtained. Institutional SupportThe authors gratefully acknowledge the Abuja Regional Center for Statistical Methods for providing access to computational resources and library facilities throughout this research.
References
- Batalla RJ, Gomez CM, Kondolf GM. Reservoir-induced hydrological changes in the Ebro River basin. J Hydrol. 2004;290(1-2):117-136.
- Renard B, Lang M, Bois P. Statistical analysis of extreme river discharges. J Soc Fr Stat. 2006;147(1):3-33.
- Koenker R, Bassett G. Regression quantiles. Econometrica. 1978;46(1):33-50.
- Breusch TS, Pagan AR. A simple test for heteroscedasticity and random coefficient variation. Econometrica. 1979;47(5):1287-1294.
- Davino C, Furno M, Vistocco D. Quantile Regression: Theory and Applications. Chichester: John Wiley & Sons; 2014. p. 1-262.
- He X. Quantile curves without crossing. Am Stat. 1997;51(2):186-192.
- Machado JAF, Santos Silva JMC. Quantiles via moments. J Econom. 2019;213(1):145-173.
- Lopez-Moreno JI, Begueria S, Garcia-Ruiz JM. Trends in high flows in the central Spanish Pyrenees. Ambio. 2006;35(5):256-263.
- Arlot S, Celisse A. A survey of cross-validation procedures for model selection. Stat Surv. 2010;4:40-79.
- Koenker R. quantreg: Quantile Regression. R package version 5.97. Vienna: R Foundation for Statistical Computing; 2023. p. 1-5.
- Hamlet AF, Lettenmaier DP. Effects of 20th century warming and climate variability on flood risk. Water Resour Res. 2007;43(6):W06427.
- Gneiting T, Raftery AE. Strictly proper scoring rules, prediction, and estimation. J Am Stat Assoc. 2007;102(477):359-378.
- Fan J, Gijbels I. Local Polynomial Modelling and Its Applications. London: Chapman and Hall; 1996. p. 1341.
- Koenker R, Hallock KF. Quantile regression. J Econ Perspect. 2001;15(4):143-156.
- Hao L, Naiman DQ. Quantile Regression. Thousand Oaks (CA): Sage Publications; 2007. Vol. 149. p. 1-126.
- White H. A heteroskedasticity-consistent covariance matrix estimator. Econometrica. 1980;48(4):817-838.
- Powell JL. Least absolute deviations estimation for the censored regression model. J Econom. 1984;25(3):303325.
- Yu K, Lu Z, Stander J. Quantile regression: applications and current research areas. J R Stat Soc Ser D Stat. 2003;52(3):331-350.
- Cannon AJ. Quantile regression neural networks: implementation in R. Comput Geosci. 2011;37(4):453461.
- Chernozhukov V, Fernandez-Val I, Melly B. Inference on counterfactual distributions. Econometrica. 2013;81(6):2205-2268.
- Hendricks W, Koenker R. Hierarchical spline models for conditional quantiles. J Am Stat Assoc. 1992;87(420):1179-1186.
How this paper connects to the literature. Drag to explore, click any node to open that paper.
