Skip to contents

[Experimental]

Modify an existing cfp_run_map for sobol indice estimation or create a new one from scratch.

Usage

sobol_run_map(x, ...)

# S3 method for class 'cfp_dat'
sobol_run_map(x, ...)

# S3 method for class 'cfp_run_map'
sobol_run_map(x, ...)

Arguments

x

Either an object of class cfp_run_map created by a call to cfp_run_map() with method = 'random', or a cfp_pfres or cfp_fgres model result.

...

Arguments passed on to run_map

params

A named list of numeric vectors. Names indicate column names in soilphys, vectors either distinct values (method permutation) or limits (method random).

type

A vector of length param indicating what the values in params represent. One of

abs

Absolute values that are applied as-is.

factor

Factors to be multiplied with the original values.

addition

Factors to be added to the original values.

method

Either 'random', where a random value is chosen within the bounds set in params or 'permutation', where every permutation of the values in params is added.

n_runs

Integer value of the number of alterations to be done for method = 'random'.

layers_different

Should layers from layers_map be changed individually? If TRUE this allows for different changes at different depths.

layers_from

(character) If layers_different is TRUE, from which source should the layers be created? One of:

layers_map

(default) Use the layers that are defined in layers_map.

soilphys

Use the layers as defined in soilphys

layers_altmap

Use the layers as defined in the provided layers_altmap object.

layers_altmap

An optional layers_map created using layers_map() that defines the layers to be used if layers_different = TRUE.

topheight_adjust

(logical) If the proposed change in topheight is larger than the highest layer in soilphys, should the limits be automatically adjusted per id_cols individually? Default is FALSE, which leads to an error in that case.

Value

A cfp_run_map to be used in alternate for sensitivity analysis.

See also

Other sobol: sobol_calc_indices()

Examples

# \donttest{
PROFLUX <- pro_flux(base_dat)

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)
#> 
#> A cfp_run_map to be used in alternate(). 
#> number of runs:  30 
#> parameters to alternate:
#>   param param_id
#> 1   TPS        1
#> 2     t        2
#>    param     value   type gas param_id run_id_og run_id_sobol sobol_mat
#> 1    TPS 1.0386410 factor CO2        1         1            1         A
#> 2      t 0.9481089 factor CO2        2         1            1         A
#> 3    TPS 0.9085978 factor CO2        1         2            2         A
#> 4      t 0.9280958 factor CO2        2         2            2         A
#> 5    TPS 0.9432771 factor CO2        1         3            3         A
#> 6      t 0.9958797 factor CO2        2         3            3         A
#> 7    TPS 0.9394821 factor CO2        1         4            4         A
#> 8      t 1.0438712 factor CO2        2         4            4         A
#> 9    TPS 0.9015769 factor CO2        1         5            5         A
#> 10     t 0.9750980 factor CO2        2         5            5         A
#> 11   TPS 1.0028815 factor CO2        1         6            1         B
#> 12     t 0.9003141 factor CO2        2         6            1         B
#> 13   TPS 1.0163208 factor CO2        1         7            2         B
#> 14     t 0.9315810 factor CO2        2         7            2         B
#> 15   TPS 0.9718057 factor CO2        1         8            3         B
#> 16     t 1.0291264 factor CO2        2         8            3         B
#> 17   TPS 1.0551647 factor CO2        1         9            4         B
#> 18     t 1.0127294 factor CO2        2         9            4         B
#> 19   TPS 0.9467407 factor CO2        1        10            5         B
#> 20     t 0.9179961 factor CO2        2        10            5         B
#> 21     t 0.9003141 factor CO2        2         6            1        BA
#> 22     t 0.9315810 factor CO2        2         7            2        BA
#> 23     t 1.0291264 factor CO2        2         8            3        BA
#> 24     t 1.0127294 factor CO2        2         9            4        BA
#> 25     t 0.9179961 factor CO2        2        10            5        BA
#> 26   TPS 1.0386410 factor CO2        1         1            1        BA
#> 27   TPS 0.9085978 factor CO2        1         2            2        BA
#> 28   TPS 0.9432771 factor CO2        1         3            3        BA
#> 29   TPS 0.9394821 factor CO2        1         4            4        BA
#> 30   TPS 0.9015769 factor CO2        1         5            5        BA
#> 31   TPS 1.0028815 factor CO2        1         6            1        BA
#> 32   TPS 1.0163208 factor CO2        1         7            2        BA
#> 33   TPS 0.9718057 factor CO2        1         8            3        BA
#> 34   TPS 1.0551647 factor CO2        1         9            4        BA
#> 35   TPS 0.9467407 factor CO2        1        10            5        BA
#> 36     t 0.9481089 factor CO2        2         1            1        BA
#> 37     t 0.9280958 factor CO2        2         2            2        BA
#> 38     t 0.9958797 factor CO2        2         3            3        BA
#> 39     t 1.0438712 factor CO2        2         4            4        BA
#> 40     t 0.9750980 factor CO2        2         5            5        BA
#> 41   TPS 1.0028815 factor CO2        1         6            1        AB
#> 42   TPS 1.0163208 factor CO2        1         7            2        AB
#> 43   TPS 0.9718057 factor CO2        1         8            3        AB
#> 44   TPS 1.0551647 factor CO2        1         9            4        AB
#> 45   TPS 0.9467407 factor CO2        1        10            5        AB
#> 46     t 0.9481089 factor CO2        2         1            1        AB
#> 47     t 0.9280958 factor CO2        2         2            2        AB
#> 48     t 0.9958797 factor CO2        2         3            3        AB
#> 49     t 1.0438712 factor CO2        2         4            4        AB
#> 50     t 0.9750980 factor CO2        2         5            5        AB
#> 51     t 0.9003141 factor CO2        2         6            1        AB
#> 52     t 0.9315810 factor CO2        2         7            2        AB
#> 53     t 1.0291264 factor CO2        2         8            3        AB
#> 54     t 1.0127294 factor CO2        2         9            4        AB
#> 55     t 0.9179961 factor CO2        2        10            5        AB
#> 56   TPS 1.0386410 factor CO2        1         1            1        AB
#> 57   TPS 0.9085978 factor CO2        1         2            2        AB
#> 58   TPS 0.9432771 factor CO2        1         3            3        AB
#> 59   TPS 0.9394821 factor CO2        1         4            4        AB
#> 60   TPS 0.9015769 factor CO2        1         5            5        AB
#>    param_id_main run_id
#> 1              1      1
#> 2              2      1
#> 3              1      2
#> 4              2      2
#> 5              1      3
#> 6              2      3
#> 7              1      4
#> 8              2      4
#> 9              1      5
#> 10             2      5
#> 11             1      6
#> 12             2      6
#> 13             1      7
#> 14             2      7
#> 15             1      8
#> 16             2      8
#> 17             1      9
#> 18             2      9
#> 19             1     10
#> 20             2     10
#> 21             1     11
#> 22             1     12
#> 23             1     13
#> 24             1     14
#> 25             1     15
#> 26             1     11
#> 27             1     12
#> 28             1     13
#> 29             1     14
#> 30             1     15
#> 31             2     16
#> 32             2     17
#> 33             2     18
#> 34             2     19
#> 35             2     20
#> 36             2     16
#> 37             2     17
#> 38             2     18
#> 39             2     19
#> 40             2     20
#> 41             1     21
#> 42             1     22
#> 43             1     23
#> 44             1     24
#> 45             1     25
#> 46             1     21
#> 47             1     22
#> 48             1     23
#> 49             1     24
#> 50             1     25
#> 51             2     26
#> 52             2     27
#> 53             2     28
#> 54             2     29
#> 55             2     30
#> 56             2     26
#> 57             2     27
#> 58             2     28
#> 59             2     29
#> 60             2     30
 # }