discrepancy_ersatz: Computation of the S-ersatz discrepancy.

View source: R/discrepancy_ersatz.R

discrepancy_ersatzR Documentation

Computation of the S-ersatz discrepancy.

Description

It allows to use the S-ersatz discrepancy measure by \insertCitepuy2023_discrepancy;textualsensobol as a sensitivity measure.

Usage

discrepancy_ersatz(mat, Y, params)

Arguments

mat

A numeric matrix created with sobol_matrices and matrices = "A", where each column represents an uncertain model input and each row a model simulation.

Y

A numeric vector with the model output obtained from the matrix created with sobol_matrices. The numeric vector should not contain any NA or NaN values.

params

A character vector with the name of the model inputs.

Details

It is recommended to define mat using a power of 2 as a sample size.

Value

A data.table object.

References

\insertAllCited

Examples

# Define settings
N <- 2^9; params <- paste("X", 1:8, sep = "")

# Create sample matrix
mat <- sobol_matrices(N = N, params = params, matrices = "A")

# Compute the Sobol' G function
Y <- sobol_Fun(mat)

# Compute the S-ersatz discrepancy values
ind <- discrepancy_ersatz(mat = mat, Y = Y, params = params)

arnaldpuy/sensobol documentation built on Feb. 24, 2024, 12:32 a.m.