Source code

Functions

Base.maximum — Method
maximum(G::Vector{Gauging})

Return the gauging with the highest level.

source
Base.minimum — Method
minimum(G::Vector{Gauging})

Return the gauging with the smallest level.

source
Base.sort — Method
sort(G::Vector{Gauging}; rev::Bool=false)

Sort the gauging according to the level.

Details

Sort in ascending order if rev=false (option by default) and in descending order if rev=true.

source
RatingCurves.cint — Method
cint(crc::CompoundRatingCurve; nboot::Int=100, α::Real=.05)

Compound rating curve parameter confidence intervals of level 1-α obtained by a bootstrap sample of size nboot.

source
RatingCurves.cint — Method
cint(rc::RatingCurve; nboot::Int=1000, α::Real=.05)

Rating curve parameter confidence intervals of level 1-α obtained by a bootstrap sample of size nboot.

source
RatingCurves.crcfit — Method

crcfit(h::AbstractVector{<:Real}, q::AbstractVector{<:Real})

Fit the compound rating curve to the discharges q corresponding to the level h.

source
RatingCurves.crcfit — Method
crcfit(G::Vector{Gauging},k::Real)

Fit the compound rating curve corresponding to the gaugings G using the break-point k.

Details

At least 3 gaugings are necessary by component of the compound rating curve.

source
RatingCurves.discharge — Method
discharge(crc::RatingCurve, h::Real)

Compute the estimated discharge at level h with the compound rating curve crc.

source
RatingCurves.discharge — Method
discharge(rc::RatingCurve, h::Real)

Compute the estimated discharge at level h with the rating curve rc.

source
RatingCurves.level — Method
level(crc::RatingCurve, q::Real)

Compute the level corresponding the the discharge q and the compound rating curve crc.

source
RatingCurves.level — Method
level(rc::RatingCurve, q::Real)

Estimate the level corresponding to the discharge q with the rating curve rc.

source
RatingCurves.logdischarge — Method
logdischarge(crc::RatingCurve, h::Real)

Compute the estimated log discharge at level h with the compound rating curve crc.

source
RatingCurves.logdischarge — Method
logdischarge(rc::RatingCurve, h::Real)

Compute the log of the estimated discharge at level h with the rating curve rc.

source
RatingCurves.pint — Function
pint(crc::CompoundRatingCurve, level::Real, α::Real=0.05, rtol::Real=.05)

1-α confidence interval of the estimated discharge at level h with the compound rating curve crc.

Details

For each segment of the compound rating curve, the confidence intervals are estimated separately. See pint(::RatingCurve, ::Real, ::Real, ::Real) for the details for the estimation on each segment.

source
RatingCurves.pint — Function
pint(rc::RatingCurve, level::Real, α::Real=0.05, rtol::Real=.05)

1-α confidence interval of the estimated discharge at level h with the rating curve rc.

See also pintlog

Details

Estimate the 1-α confidence interval of the estimated discharge corresponding to the rating curve rcat level h with the relative error of the discharge measurement rtol.

Measurement error

It is assumed that $(q_i \pm \operatorname{rtol} \times q_i)$ contains the true discharge 95% of the time. Assuming a Gaussian distribution for the discharge measurement, the discharge $Q_i$ distribution is given as follows:

$Q_i \sim \mathcal{N} \left\{ q_i, \left(\frac{\operatorname{rtol} q_i}{1.96}\right)^2 \right\}.$

The discharge standard variation is therefore $\tau_i = \frac{\operatorname{rtol} q_i}{1.96}.$

Residual error

The estimation error $σ²$ corresponding to the point on the rating curve is estimated with the sum of squared residuals in the log space. Let $qᵢ$ be the observed discharge and $q̂ᵢ$ be the corresponding discharge estimation. For the $n>3$ gaugings, the sum of squared residuals is defined as:

$\operatorname{SSE} = \sum_{i=1}^n ( \log qᵢ - \log q̂ᵢ)^2.$

The variance estimation of the log residuals are therefore:

$σ̂ₑ² = \frac{1}{n-3} \operatorname{SSE}.$

The linear regression prediction variance of the estimated discharge at level h₀ is given by:

$σ̂² = x₀^⊤ (X^\top X)^{-1} x₀$

where $x₀^⊤ = [1 \log (h₀ - b)]$ and $X$ is the structure matrix of the regression model.

Note

The uncertainty on $b$ is neglected in this expression.

Log discharge prediction error

The log prediction variance is assumed to be the sum of the estimation variance and the discharge measurement variance in the log space. It is then assumed that the prediction error in the log space is Gaussian in order to compute the confidence interval bounds.

Discharge prediction error

The confidence interval bounds in the original space are given by the exponential of the bounds in the log space.

source
RatingCurves.pintlog — Function
pintlog(crc::CompoundRatingCurve, level::Real, α::Real=0.05, rtol::Real=.05)

1-α confidence interval of the estimated log discharge at level h with the compound rating curve crc.

Details

rtol represents the relative uncertainty of the dishcarge so that the true discharge is included in the interval q ± 1.96*rtol 95% of the time

source
RatingCurves.pintlog — Function
pintlog(rc::RatingCurve, h₀::Real, α::Real=0.05, rtol::Real=.05)

1-α confidence interval of the estimated log discharge at level h₀ with the rating curve rc.

Details

rtol represents the relative uncertainty of the dishcarge so that the true discharge is included in the interval q ± 1.96*rtol 95% of the time

source
RatingCurves.rcfit — Method
rcfit(h::AbstractVector{<:Real}, q::AbstractVector{<:Real})

Fit the rating curve to the discharges q corresponding to the level h.

source
RatingCurves.rcfit — Method
rcfit(G::Vector{Gauging}, constraint::AbstractVector{<:Real})

Fit the rating curve to the gaugings G passing through the point (h,q) specified in constraint.

source
RatingCurves.rcfit — Method
rcfit(G::Vector{Gauging}, b::Real, constraint::AbstractVector{<:Real})

Fit the rating curve with parameter b to the gaugings G passing through the point (h,q) specified in constraint.

source
RatingCurves.rcfit — Method
rcfit(G::Vector{Gauging}, b::Real)

Fit the rating curve of parameter b to the gaugings G.

source
StatsBase.bic — Method
function bic(crc::CompoundRatingCurve)

BIC of the compound rating curve model.

source

Types