You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since the package uses `Rcpp` in the background, it performs slightly faster than base R and other R packages. This is particularly noticeable with large datasets:
76
+
Since the package uses `Rcpp` in the background, it performs slightly faster than base R and other R packages (see [benchmarks](https://atsyplenkov.github.io/tidyhydro/articles/benchmarks.html)). This is particularly noticeable with large datasets:
Since `tidyhydro` uses C++ under the hood, it performs slightly faster than similar R packages (like `hydroGOF`). The results are particularly noticeable in large datasets with $N$ observations exceeding 1000.
The package comes with the mean daily water discharge values (`obs` in m^3/s) measured at the state gauging station Avacha River — Elizovo City (site No. 2090). Alongside with the measured water discharge, the mean water discharge in the last 24 hours derived from the GloFAS-ERA5 v4.0 reanalysis is provided (`sim`).
26
+
In `tidyhydro` v`r packageVersion("tidyhydro")`, `r length(getNamespaceExports("tidyhydro"))/2` metrics are implemented.
| Modified Kling-Gupta Efficiency | $KGE'$ |`kge2012`, `kge_vec`| <spanstyle="font-size: 0.8em;">Kling, H., Fuchs, M., & Paulin, M. (2012). *Journal of Hydrology*, 424–425, 264–277.</span> |
32
+
| Nash-Sutcliffe Efficiency | $NSE$ |`nse`, `nse_vec`| <spanstyle="font-size: 0.8em;">Nash, J. E., & Sutcliffe, J. V. (1970). *Journal of Hydrology*, 10(3), 282–290.</span> |
33
+
| Mean Squared Error | $MSE$ |`mse`, `mse_vec`| <spanstyle="font-size: 0.8em;">Clark, M. P., Vogel, R. M., Lamontagne, J. R., Mizukami, N., Knoben, W. J. M., Tang, G., Gharari, S., Freer, J. E., Whitfield, P. H., Shook, K. R., & Papalexiou, S. M. (2021). The Abuse of Popular Performance Metrics in Hydrologic Modeling. Water Resources Research, 57(9), e2020WR029001.</span> |
34
+
| Percent BIAS | $pBIAS$ |`pbias`, `pbias_vec`| <spanstyle="font-size: 0.8em;">Gupta, H. V., S. Sorooshian, and P. O. Yapo. (1999). Status of automatic calibration for hydrologic models: Comparison with multilevel expert calibration. J. Hydrologic Eng. 4(2): 135-143 </span> |
35
+
| PRediction Error Sum of Squares | $PRESS$ |`press`, `press_vec`| <spanstyle="font-size: 0.8em;"> Rasmussen, P. P., Gray, J. R., Glysson, G. D. & Ziegler, A. C. Guidelines and procedures for computing time-series suspended-sediment concentrations and loads from in-stream turbidity-sensor and streamflow data. in U.S. Geological Survey Techniques and Methods book 3, chap. C4 53 (2009)</span> |
36
+
| Standard Factorial Error | $SFE$ |`sfe`, `sfe_vec`| <spanstyle="font-size: 0.8em;"> Herschy, R.W. 1978: Accuracy. Chapter 10 In: Herschy, R.W. (ed.) Hydrometry - principles and practices. John Wiley and Sons, Chichester, 511 p.</span> |
37
+
38
+
: Metrics currently implemented in `tidyhydro` v`r packageVersion("tidyhydro")`
39
+
40
+
# `avacha` dataset
41
+
42
+
The package includes the mean daily water discharge values (`obs` in m³/s) measured at the state gauging station Avacha River — Elizovo City (site No. 2090). Alongside the measured water discharge, the mean water discharge in the last 24 hours derived from the [GloFAS-ERA5 v4.0](https://confluence.ecmwf.int/display/CEMS/GloFAS+v4.0) reanalysis is provided (`sim`).
23
43
24
44
```{r}
25
45
#| fig-cap: Avacha River - Elizovo City hydrograph
One can estimate the desired metrics using the `tidyverse`[syntax](https://style.tidyverse.org/). For example, to get the Nash-Sutcliffe Efficiency ($NSE$) or Modified Kling-Gupta Efficiency ($KGE'$) for the `avacha` dataset, one can run:
61
+
62
+
```{r}
63
+
nse(avacha, obs, sim)
64
+
kge2012(avacha, obs, sim)
65
+
```
36
66
67
+
Or using the `yardstick` helper functions, one can create a metric set, combining it with other `yardstick` metrics, such as $R^2$:
68
+
69
+
```{r}
70
+
library(yardstick)
71
+
hydro_metrics <- metric_set(kge, pbias, rsq)
72
+
hydro_metrics(avacha, obs, sim)
37
73
```
74
+
75
+
Such syntax is particularly useful when running a group analysis, for example, estimating model performance for different months:
76
+
77
+
```{r}
78
+
library(lubridate)
79
+
library(dplyr)
80
+
81
+
avacha |>
82
+
mutate(month = month(date)) |>
83
+
group_by(month) |>
84
+
nse(obs, sim)
85
+
```
86
+
87
+
Alternatively, one can still use the vectorised versions of the metrics, ending with the `*_vec` suffix:
0 commit comments