sor16 / bdrc

Fits a discharge rating curve based on the power-law and the generalized power-law from data on paired water elevation and discharge measurements in a given river using a Bayesian hierarchical model as described in Hrafnkelsson et al. (2022)
https://sor16.github.io/bdrc/
Other
12 stars 2 forks source link
bayesian-inference cran-r power-law r r-package rivers

bdrc - Bayesian Discharge Rating Curves

Codecov test
coverage R build
status 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):

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

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