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://github.com/sor16/bdrc

Science Score: 36.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
    Found 2 DOI reference(s) in README
  • Academic publication links
  • Committers with academic emails
    1 of 13 committers (7.7%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (19.1%) to scientific vocabulary

Keywords

bayesian-inference cran-r power-law r r-package rivers
Last synced: 6 months ago · JSON representation

Repository

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)

Basic Info
Statistics
  • Stars: 12
  • Watchers: 3
  • Forks: 2
  • Open Issues: 4
  • Releases: 2
Topics
bayesian-inference cran-r power-law r r-package rivers
Created over 10 years ago · Last pushed about 1 year ago
Metadata Files
Readme Changelog License

README.Rmd

---
output: github_document
---



```{r, echo = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/"
)
```

## bdrc - Bayesian Discharge Rating Curves 

[![Codecov test coverage](https://codecov.io/gh/sor16/bdrc/branch/master/graph/badge.svg)](https://app.codecov.io/gh/sor16/bdrc?branch=master)
[![R build status](https://github.com/sor16/bdrc/workflows/R-CMD-check/badge.svg)](https://github.com/sor16/bdrc/actions)
[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/bdrc)](https://cran.r-project.org/package=bdrc)


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

```{r, eval = FALSE}
# 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:

```{r,eval=F}
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:

* [Background](https://sor16.github.io/bdrc/articles/background.html)
* [Introduction](https://sor16.github.io/bdrc/articles/introduction.html)
* [Power-law tournament (model selection)](https://sor16.github.io/bdrc/articles/tournament.html)


## 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

Owner

  • Name: Sölvi Rögnvaldsson
  • Login: sor16
  • Kind: user

GitHub Events

Total
  • Watch event: 2
  • Push event: 4
Last Year
  • Watch event: 2
  • Push event: 4

Committers

Last synced: over 1 year ago

All Time
  • Total Commits: 720
  • Total Committers: 13
  • Avg Commits per committer: 55.385
  • Development Distribution Score (DDS): 0.489
Past Year
  • Commits: 3
  • Committers: 1
  • Avg Commits per committer: 3.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Sölvi Rögnvaldsson s****6@h****s 368
sor16 s****o@g****m 128
RafaelVias r****s@p****m 98
Rafael Daniel Vias V****s@t****s 42
Rafael Daníel Vias 7****s 29
axelornj a****8@h****s 20
axelornj a****4@g****m 11
Rafael Daniel Vias V****s@R****l 9
axelornj a****3@c****u 6
Rafael y****u@e****m 4
rcapell r****l@g****m 3
Rafael Daniel Vias V****s@h****s 1
Rafael Daniel Vias V****s@r****s 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: over 1 year ago

All Time
  • Total issues: 10
  • Total pull requests: 5
  • Average time to close issues: about 1 month
  • Average time to close pull requests: about 8 hours
  • Total issue authors: 3
  • Total pull request authors: 2
  • Average comments per issue: 0.9
  • Average comments per pull request: 0.2
  • Merged pull requests: 5
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 9
  • Pull requests: 4
  • Average time to close issues: about 1 month
  • Average time to close pull requests: about 4 hours
  • Issue authors: 2
  • Pull request authors: 1
  • Average comments per issue: 1.0
  • Average comments per pull request: 0.0
  • Merged pull requests: 4
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • RafaelVias (8)
  • sor16 (1)
  • thodson-usgs (1)
Pull Request Authors
  • RafaelVias (7)
  • rcapell (1)
Top Labels
Issue Labels
enhancement (5) bug (1)
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • cran 294 last-month
  • Total docker downloads: 21,613
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 2
  • Total maintainers: 1
cran.r-project.org: bdrc

Bayesian Discharge Rating Curves

  • Versions: 2
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 294 Last month
  • Docker Downloads: 21,613
Rankings
Forks count: 17.8%
Stargazers count: 19.8%
Average: 28.8%
Dependent packages count: 29.8%
Dependent repos count: 35.5%
Downloads: 41.2%
Maintainers (1)
Last synced: 7 months ago

Dependencies

DESCRIPTION cran
  • R >= 3.5.0 depends
  • ggplot2 * imports
  • grid * imports
  • gridExtra * imports
  • rlang * imports
  • scales * imports
  • covr * suggests
  • knitr * suggests
  • rmarkdown * suggests
  • testthat * suggests
  • vdiffr * suggests
.github/workflows/R-CMD-check.yaml actions
  • actions/checkout v2 composite
  • r-lib/actions/check-r-package v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/pkgdown.yaml actions
  • actions/cache v2 composite
  • actions/checkout v2 composite
  • r-lib/actions/setup-pandoc v1 composite
  • r-lib/actions/setup-r v1 composite
.github/workflows/pr-commands.yaml actions
  • actions/checkout v2 composite
  • r-lib/actions/pr-fetch v1 composite
  • r-lib/actions/pr-push v1 composite
  • r-lib/actions/setup-r v1 composite
.github/workflows/test-coverage.yaml actions
  • actions/cache v2 composite
  • actions/checkout v2 composite
  • r-lib/actions/setup-pandoc v1 composite
  • r-lib/actions/setup-r v1 composite