Skip to contents

Computes the percent bias between simulated and observed flows in a specified segment of their flow duration curves (FDC), delimited by exceedance probability (EP) thresholds. Both curves are interpolated onto a common EP grid (defined by `resolution`), ensuring that simulated and observed flows are compared at exactly the same probabilities. Facilitates evaluation of model performance across flow regimes (e.g., peak, high, or low flows).

Usage

pbias_fdc_target_segment(
  sim,
  obs,
  lowQ_EP,
  highQ_EP,
  resolution = 1e-04,
  na.rm = TRUE,
  plot = FALSE,
  ...
)

Arguments

sim

numeric. Simulated flow values.

obs

numeric. Observed flow values.

lowQ_EP

numeric. Upper EP bound of the segment (e.g., 0.2 for 20%).

highQ_EP

numeric. Lower EP bound of the segment (e.g., 0 for 0%).

resolution

numeric. Resolution for EP interpolation, defining the common grid where simulated and observed flows are compared. Default: 0.0001.

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().

Value

numeric. Percent bias for the specified FDC segment.

Details

The EP thresholds must satisfy \(1 \ge lowQ\_EP > highQ\_EP \ge 0\).

Percent bias is calculated as: $$ pbiasFDC_{\text{segment}} = \frac{\sum_{p=1}^P (S_p - O_p)}{\sum_{p=1}^P O_p} \times 100 $$ where \(S_p\) and \(O_p\) are simulated and observed flows at EP \(p\) on the interpolated grid.

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 peak flows (0–2% EP)
pbias_fdc_target_segment(sim, obs, lowQ_EP = 0.02, highQ_EP = 0)

# Percent bias for high flows (2–20% EP)
pbias_fdc_target_segment(sim, obs, lowQ_EP = 0.2, highQ_EP = 0.02)

# Percent bias for low flows (70–100% EP)
pbias_fdc_target_segment(sim, obs, lowQ_EP = 1, highQ_EP = 0.7)

# Plot selected segment
pbias_fdc_target_segment(sim, obs, lowQ_EP = 0.2, highQ_EP = 0.02,
                         plot = TRUE)