From any result parameter and its corresponding cfp_run_map calculate
first-order and total sobol indices using the Azzini (2021) method.
Usage
sobol_calc_indices(Y, effect_cols, id_cols = character(), run_map)Arguments
- Y
A data.frame with the desired effect parameter(s) of the model output, e.g.
efflux(). The output should come from a list of model results produced by a call toalternate()with a validcfp_run_mapproduced bysobol_run_map().- effect_cols
character vector of the column names in
Yfor which sobol indices should be calculated, e.g.'efflux'.- id_cols
character vector of column names in
Yspecifying grouping variables. Indices are then calculated for each group individually.- run_map
The
cfp_run_mapused for the calculation of Y produced by a call tosobol_run_map().
Value
A data.frame with the following columns
...Any
id_colsspecifiedparam_id, param, pmapParameter identificators from the
cfp_run_mapused.effect_paramThe parameter for which the effect was calculated.
Vt, Vi, VYInternal parameters for the indice calculation.
SiFirst order sobol indice.
STTotal order sobol indice.
References
Azzini, Ivano; Mara, Thierry A.; Rosati, Rossana: Comparison of two sets of Monte Carlo estimators of Sobol’ indices, Environmental Modelling & Software, Volume 144, 2021, 105167, ISSN 1364-8152, https://doi.org/10.1016/j.envsoft.2021.105167
See also
Other sobol:
sobol_run_map()
Examples
if (FALSE) { # interactive()
PROFLUX <- pro_flux(base_dat)
sobol_map <- sobol_run_map(PROFLUX,
params = list("TPS" = c(0.9, 1.1),
"t" = c(0.9, 1.1)),
type = c("factor", "factor"),
n_runs = 10)
PF_sobol <-
alternate(
PROFLUX,
\(x) complete_soilphys(x, DSD0_formula = "a*AFPS^b", quiet = TRUE),
sobol_map)
sobol_calc_indices(efflux(PF_sobol), "efflux", c("site"), sobol_map)
}