Bayesian Discharge Rating Curves

Fits a discharge rating curve based on the power-law and the generalized power-law from data on paired stage and discharge measurements in a given river using a Bayesian hierarchical model as described in Hrafnkelsson et al. (2022) .


bdrc - Bayesian Discharge Rating Curves

Codecov testcoverage R buildstatus CRAN_Status_Badge

The bdrc package provides tools for fitting discharge rating curves using Bayesian hierarchical models. It implements both the classical power-law and the novel generalized power-law models, offering flexibility in handling various hydrological scenarios.

This package implements four models as described in Hrafnkelsson et al. (2022):

  • plm0() - Power-law model with constant log-error variance.

  • plm() - Power-law model with stage-dependent log-error variance.

  • gplm0() - Generalized power-law model with constant log-error variance.

  • gplm() - Generalized power-law model with stage-dependent log-error variance.

Installation

# Install release version from CRAN
install.packages("bdrc")
# Install development version from GitHub
devtools::install_github("sor16/bdrc")

Usage

Fitting a discharge rating curve with bdrc is straightforward:

library(bdrc)
data(krokfors)
gplm.fit <- gplm(Q ~ W, krokfors)
summary(gplm.fit)
plot(gplm.fit)

Key-features

  • Easy-to-use interface for fitting Bayesian discharge rating curves
  • Features the novel Generalized power-law rating curve model (Hrafnkelsson et al., 2022)
  • Multiple model options to suit different hydrological scenarios
  • Built-in visualization tools for model results and diagnostics
  • Integrates R and C++ for efficient MCMC sampling with parallel processing

Getting started

For a deeper dive into the package’s functionality, visualization options, and the underlying theory of the models, please check out our vignettes:

References

Hrafnkelsson, B., Sigurdarson, H., Rögnvaldsson, S., Jansson, A. Ö., Vias, R. D., and Gardarsson, S. M. (2022). Generalization of the power-law rating curve using hydrodynamic theory and Bayesian hierarchical modeling, Environmetrics, 33(2):e2711. doi: https://doi.org/10.1002/env.2711

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("bdrc")

2.0.1 by Rafael Daníel Vias, 8 months ago


https://sor16.github.io/bdrc/


Report a bug at https://github.com/sor16/bdrc/issues/


Browse source code at https://github.com/cran/bdrc


Authors: Birgir Hrafnkelsson [aut, cph] (ORCID: , Solvi Rognvaldsson [aut] (ORCID: , Rafael Daníel Vias [aut, cre] (ORCID: , Axel Orn Jansson [aut]


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports ggplot2, grid, gridExtra, Rcpp, rlang, scales

Suggests testthat, knitr, rmarkdown, covr, vdiffr

Linking to Rcpp, RcppArmadillo


See at CRAN