metafunction: Random metafunction based on...

View source: R/test_functions.R

metafunctionR Documentation

Random metafunction based on \insertCiteBecker2020;textualsensobol's metafunction.

Description

Random metafunction based on \insertCiteBecker2020;textualsensobol's metafunction.

Usage

metafunction(data, k_2 = 0.5, k_3 = 0.2, epsilon = NULL)

Arguments

data

A numeric matrix where each column is a model input and each row a sampling point.

k_2

Numeric value indicating the fraction of active pairwise interactions (between 0 and 1). Default is k_2 = 0.5.

k_3

Numeric value indicating the fraction of active three-wise interactions (between 0 and 1). Default is k_2 = 0.2.

epsilon

Integer value. It fixes the seed for the random number generator. The default is epsilon = NULL.

Details

The metafunction randomly combines the following functions in a metafunction of dimension k:

  • f(x) = x ^ 3 (cubic).

  • f(x) = 1~\mbox{if}(x > 0.5), 0~\mbox{otherwise} (discontinuous).

  • f(x) = \frac{e ^ x}{e - 1} (exponential).

  • f(x) = \frac{10 - 1}{1.1} ^ {-1} (x + 0.1) ^ {-1} (inverse).

  • f(x) = x (linear)

  • f(x) = 0 (no effect).

  • f(x) = 4(x - 0.5) ^ 2 (non-monotonic).

  • f(x) = \frac{\sin (2 \pi x)}{2} (periodic).

  • f(x) = x ^ 2 (quadratic).

  • f(x) = \cos(x) (trigonometric).

It is constructed as follows:

y=\sum_{i=1}^{k}\alpha_i f^{u_i}(x_i) \\ + \sum_{i=1}^{k_2}\beta_i f^{u_{V_{i,1}}}(x_{V_{i,1}}) f^{u_{V_{i,2}}} (x_{V_{i,2}}) \\ + \sum_{i=1}^{k_3}\gamma_i f^{u_{W_{i,1}}}(x_{W_{i,1}}) f^{u_{W_{i,2}}}(x_{W_{i,2}}) f^{u_{W_{i,3}}} (x_{W_{i,3}})

where k is the model dimensionality, u is a k-length vector formed by randomly sampling with replacement the ten functions mentioned above, V and W are two matrices specifying the number of pairwise and three-wise interactions given the model dimensionality, and \mathbf{\alpha}, \mathbf{\beta}, \mathbf{\gamma} are three vectors of length k generated by sampling from a mixture of two normal distributions \Psi=0.3\mathcal{N}(0, 5) + 0.7\mathcal{N}(0, 0.5). See \insertCitePuyj;textualsensobol and \insertCiteBecker2020;textualsensobol for a full mathematical description of the metafunction approach.

Value

A numeric vector with the function output.

References

\insertAllCited

Examples

# Define settings (number of model inputs = 86)
N <- 100; params <- paste("X", 1:86, sep = "")

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

# Compute metafunction
Y <- metafunction(mat)

sensobol documentation built on April 6, 2023, 5:22 p.m.