approxQ: Interpolate and Extrapolate Streamflow Probabilities along...

Description Usage Arguments Details Value Examples

View source: R/approxQ.R

Description

The function approxQ interpolates and extrapolates a time series of probabilities along a given set of quantiles from a flow duration curve.

Usage

1
approxQ(pts, fdc)

Arguments

pts

A numerical vector containing a time series of streamflow probabilities. The probabilities can be either nonexceedance or exceedance probabilities, as long as they correspond to the probabilities in fdc$p described below.

fdc

A data frame of two numerical variables. The first, p, contains streamflow probabilities corresponding to the streamflow values in the second, q. The probabilities can be either nonexceedance or exceedance probabilities, as long as they correspond to the probabilities in pts described above. Non-positive values of q will be removed because of the conversion to common logarithms.

Details

The interpolation is accomplished by converting streamflows to the common logarithms of streamflow and converting the probabilites to standard normal quantlies. The approx is used to then linearly interpolate the standard normal quantiles against the common logarithms of streamflow.

Probabilites in pts that are beyond the maximum value in fdc$p are extrapolated by extending the line between the two greatest quantiles of the flow duration curve.

Similarly, probabilites in pts that are below the minimum value in fdc$p are extrapolated by extending the line between the two smallest quantiles of the flow duration curve.

Value

A list of three elements:

pts

The input time series of streamflow probabilites.

fdc

The input flow duration curve, with addition of the common logarithm of streamflow (ql) and the standard nomral quantiles of the probabilities (z).

targetFlow

The resulting conversion of pts into streamflows by interpolating and extrapolating along the given flow duration curve.

Examples

1
2
3
4
5
6
7
8
set.seed(1)
pts <- runif(100)
fdc <- data.frame(
  p = seq(from = 0.01, to = 0.99, by = 0.01)
)
fdc$q <- qnorm(fdc$p, mean = 5, sd = 2)

result <- approxQ(pts = pts, fdc = fdc)

wfarmer-usgs/PUBAD documentation built on May 4, 2019, 5:21 a.m.