Description Usage Arguments Details Value Examples
View source: R/beale_function.R
This function is an R implementation of the code originally written in Fortran. The Beale Ratio Estimator has been shown to provide an unbiased load estimate.
1 | beale(discharge_cms, concentration_mg_L)
|
discharge_cms |
vector of daily discharge values given in cubic meters per second. |
concentration_mg_L |
paired vector of daily concentration values given in mg_L |
Peter Richards, one of the authors of the Fortran implementation, describes it this way:
"The Beale Ratio Estimator is described in Tin (1965). It has been widely used for computation of substance loadings to receiving waters, particularly in the Great Lakes system. The initial code was developed by Ken Baun of Wisconsin DNR (1982). It was subsequently used and developed by Kevin McGunagle at the International Joint Commission (IJC), from whom the current version was received. It was then developed in the 1990<e2><80><99>s by Pete Richards at the National Center for Water Quality Research at Heidelberg University (www.heidelberg.edu/academiclife/distinctive/ncwqr). Peter developed the code to work with the Macintosh computer of the time (<e2><80><9c>Motorola" architecture, which was replaced by Intel architecture ca. 2005), and included a Graphic User Interface (GUI) and an algorithm that objectively and sequentially searched out the best stratification given the data, with <e2><80><9c>best<e2><80><9d> being defined as minimizing the root-mean-square error (RMSE) given the data at hand. This is the current and final version. A Windows version of the code was also developed, with a minimal GUI."
A list with the following items:
Name | Description |
load_total_corrected | bias-corrected load for entire period of calculation |
load_daily_corrected | bias-corrected daily load |
load_mean_daily | mean of daily loads over period of calculation |
load_daily | vector of individual daily loads |
confidence_interval | 95% confidence interval about the total corrected load |
discharge_mean | mean discharge during calculation period |
discharge_mean_sample_days_only | mean discharge, including only days for which concentration data exist |
mse | mean squared error |
rmse | root mean square of errors |
df | number of degrees of freedom |
n_conc | number of concentration data points used in calculation |
n_discharge | number of discharge values used in calculation |
1 2 3 4 5 6 | library(dplyr)
discharge_data <- read.table("ROCKFLOW.DAT", header=TRUE )
concentration_data <- read.table("ROCKNO3.DAT", header=TRUE )
flow_conc_df <- left_join(discharge_data, concentration_data, by=c("date" = "date") )
head( flow_conc_df )
beale( discharge_cms=cfs_to_cms( flow_conc_df$discharge ), concentration_mg_L=flow_conc_df$concentration )
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.