Skip to contents

Prediction standard factorial error estimated using standard regression methods (see Herschy, 1978).

Usage

sfe(data, ...)

# S3 method for class 'data.frame'
sfe(data, truth, estimate, na_rm = TRUE, ...)

sfe_vec(truth, estimate, na_rm = TRUE, ...)

Arguments

data

A data.frame containing the columns specified by the truth and estimate arguments.

...

Not currently used.

truth

The column identifier for the true results (that is numeric). This should be an unquoted column name although this argument is passed by expression and supports quasiquotation (you can unquote column names). For _vec() functions, a numeric vector.

estimate

The column identifier for the predicted results (that is also numeric). As with truth this can be specified different ways but the primary method is to use an unquoted variable name. For _vec() functions, a numeric vector.

na_rm

A logical value indicating whether NA values should be stripped before the computation proceeds.

Value

A tibble with columns .metric, .estimator, and .estimate and 1 row of values.

For grouped data frames, the number of rows returned will be the same as the number of groups.

For sfe_vec(), a single numeric value (or NA).

Details

The metric is widely used for assessing Sediment Rating Curves (e.g., Hicks et al. 2020). The model is usually considered 'unacceptable' if the \(SFE > 2\), see Hicks et al. (2011).

It is estimated as follows: $$SFE = \exp\left(\sqrt{\frac{1}{n} \sum_{i=1}^{n} \left( \log\left(\frac{obs_i}{sim_i} \right) \right)^2 }\right)$$ where:

  • \(sim\) defines model simulations at time step \(i\)

  • \(obs\) defines model observations at time step \(i\)

References

Herschy, R.W. 1978: Accuracy. Chapter 10 In: Herschy, R.W. (ed.) Hydrometry - principles and practices. John Wiley and Sons, Chichester, 511 p.

Hicks, D. M., Shankar, U., McKerchar, A. I., Basher, L., Lynn, I., Page, M., & Jessen, M. (2011). Suspended Sediment Yields from New Zealand Rivers. Journal of Hydrology (New Zealand), 50(1), 81–142. doi:10.3316/informit.315190637227597

Hicks, M., Doyle, M., Watson, J., Holwerda, N., Lynch, B., Wyatt, J., Jones, H., & Hill, R. (2020). Measurement of Fluvial Suspended Sediment Load and its Composition (No. 1.0.0; National Environmental Monitoring Standards, p. 138). https://www.nems.org.nz/documents/suspended-sediment

See also

Other numeric metrics: kge(), kge2012(), mse(), nse(), pbias(), press()

Other accuracy metrics: kge(), kge2012(), mse(), nse(), pbias(), press()

Examples

library(tidyhydro)
data(avacha)

# Supply truth and predictions as bare column names
sfe(avacha, obs, sim)
#> # A tibble: 1 × 3
#>   .metric .estimator .estimate
#>   <chr>   <chr>          <dbl>
#> 1 sfe     standard        1.12

# Or as numeric vectors
sfe_vec(avacha$obs, avacha$sim)
#> [1] 1.119667