approxP: Interpolate and Extrapolate Streamflows along Flow Duration...

Description Usage Arguments Details Value Examples

View source: R/approxP.R

Description

The function approxP interpolates and extrapolates a time series of streamflows along a given set of quantiles from a flow duration curve to produce streamflow probabilities.

Usage

1
approxP(qts, fdc)

Arguments

qts

A numerical vector containing a time series of streamflows. Probabilities will not be estimated for non-positive values.

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; the output will be of the same nature. 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 function is used to then linearly interpolate the standard normal quantiles against the common logarithms of streamflow.

Streamflows in qts that are beyond the maximum value in fdc$q are extrapolated by extending the line between the two greatest quantiles of the flow duration curve.

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

Value

A list of three elements:

qts

The input time series of streamflows.

fdc

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

targetP

The resulting conversion of qts into streamflow probabilities by interpolating and extrapolating along the given flow duration curve.

Examples

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

result <- approxP(qts = qts, fdc = fdc)

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