Skip to contents

A set of functions that can be called on an cfp_pfres object (the result of a call to pro_flux) to assess the quality of the model.

Usage

error_concentration(x, param_cols = NULL, normer = "sd")

# S3 method for class 'cfp_pfres'
error_concentration(x, param_cols = NULL, normer = "sd")

# S3 method for class 'cfp_fgres'
error_concentration(x, param_cols = NULL, normer = "sd")

# S3 method for class 'cfp_altres'
error_concentration(x, param_cols = NULL, normer = "sd")

error_efflux(x, param_cols, EFFLUX, normer = "sd", ...)

# S3 method for class 'cfp_pfres'
error_efflux(x, param_cols, EFFLUX, normer = "sd", ...)

# S3 method for class 'cfp_fgres'
error_efflux(x, param_cols, EFFLUX, normer = "sd", ...)

# S3 method for class 'cfp_altres'
error_efflux(x, param_cols, EFFLUX, normer = "sd", ...)

Arguments

x

A cfp_pfres object, that is returned by a call to pro_flux()

param_cols

The columns that, together, define different parameters (e.g. different gases) for which NRMSEs should be calculated separately (e.g. "gas"). Defaults to the id_cols of layers_map. If no such distinction is wished, set to character()

normer

a character string defining the type of normalization to be applied. Can be one of

mean

the arithmetic mean of a

sd

the standard deviation of a (default).

range

the difference between the range of a

IQR

the difference between the interquantile range of a

EFFLUX

A data.frame with (at most) one value of efflux per profile of x. Must contain any id_cols of x needed.

...

Further arguments passed to efflux

Value

The calculated error estimate for a single model, a list of models (cfp_altres) and for each parameter combination in param_cols

Details

For error_concentration, the way the error parameter is calculated for cfp_fgres and cfp_pfres objects is entirely different and should not be used in comparison between the two. NRMSE of cfp_pfres objects are calculated as the mean of depth-wise NRMSEs of modelled versus input gas concentrations. 'NRMSE's of cfp_fgres objects simply calculate the mean of (dcdz_sd / dcdz_ppm) per group described in param_cols.

Examples

PROFLUX <- pro_flux(base_dat)

error_concentration(PROFLUX)
#> # A tibble: 2 × 3
#> # Groups:   site [2]
#>   site   gas   NRMSE
#>   <chr>  <chr> <dbl>
#> 1 site_a CO2   0.209
#> 2 site_b CO2   0.237
error_efflux(
  PROFLUX,
  EFFLUX = data.frame(efflux = 1),
  param_cols = c("site"))
#> # A tibble: 2 × 2
#>   site   NRMSE
#>   <chr>  <dbl>
#> 1 site_a  1.45
#> 2 site_b  1.39