Percent bias in the midsegment slope of a Flow Duration Curve (FDC)
Source:R/performance-03-fdc.R
pbias_fdc_midsegment.RdComputes the percent bias for the midsegment slope of the flow duration curves (FDC) between simulated and observed flows, delimited by exceedance probability (EP) thresholds, useful for evaluating model performance in intermediate flow regimes.
Usage
pbias_fdc_midsegment(
sim,
obs,
lowQ_EP = 0.7,
highQ_EP = 0.2,
na.rm = TRUE,
plot = FALSE,
...
)Arguments
- sim
numeric. Simulated flow values.
- obs
numeric. Observed flow values.
- lowQ_EP
numeric. Upper EP bound of the midsegment (e.g., 0.7 for 70%).
- highQ_EP
numeric. Lower EP bound of the midsegment (e.g., 0.2 for 20%).
- na.rm
logical. Whether to remove NA values before computation. Default: TRUE.
- plot
logical. Whether to generate a log-scale plot highlighting the selected segment. Default: FALSE.
- ...
additional arguments passed to
plot().
Details
The EP thresholds must satisfy \(1 \ge lowQ\_EP > highQ\_EP \ge 0\).
Percent bias for the midsegment slope is calculated as: $$ pbiasFDC_{\text{midsegment}} = \frac{\big[(S_{m1} - S_{m2}) - (O_{m1} - O_{m2})\big]} {(O_{m1} - O_{m2})} \times 100 $$ where \(S_{m1}\), \(S_{m2}\) and \(O_{m1}\), \(O_{m2}\) are the simulated and observed flows at the EP thresholds defining the segment.
See also
Other Performance evaluation:
evaluate_swat(),
fdc_signature(),
gof_metrics(),
pbias_fdc_target_segment(),
plot_fdc(),
plot_mean_annual_cycle(),
plot_timeseries()
Examples
# Synthetic daily flow data
set.seed(123)
obs <- abs(rnorm(730, mean = 50, sd = 20))
sim <- obs * runif(730, min = 0.8, max = 1.5)
# Percent bias for midsegment slope (20–70% EP)
pbias_fdc_midsegment(sim, obs, lowQ_EP = 0.7, highQ_EP = 0.2)
# Plot selected segment
pbias_fdc_midsegment(sim, obs, lowQ_EP = 0.7, highQ_EP = 0.2,
plot = TRUE)