setup_genz_function

pyapprox.benchmarks.benchmarks.setup_genz_function(nvars, test_name, coefficients=None)[source]

Setup the Genz Benchmarks.

For example, the two-dimensional oscillatory Genz problem can be defined using

>>> from pyapprox.benchmarks.benchmarks import setup_benchmark
>>> benchmark=setup_benchmark('genz',nvars=2,test_name='oscillatory')
>>> print(benchmark.keys())
dict_keys(['fun', 'mean', 'variable'])
Parameters
nvarsinteger

The number of variables of the Genz function

test_namestring

The test_name of the specific Genz function. See notes for options the string needed is given in brackets e.g. (‘oscillatory’)

coefficientstuple (ndarray (nvars), ndarray (nvars))

The coefficients \(c_i\) and \(w_i\) If None (default) then \(c_j = \hat{c}_j\left(\sum_{i=1}^d \hat{c}_i\right)^{-1}\) where \(\hat{c}_i=(10^{-15\left(\frac{i}{d}\right)^2)})\)

Returns
benchmarkpya.Benchmark

Object containing the benchmark attributes

Notes

Corner Peak (‘corner-peak’)

\[f(z)=\left( 1+\sum_{i=1}^d c_iz_i\right)^{-(d+1)}\]

Oscillatory (‘oscillatory’)

\[f(z) = \cos\left(2\pi w_1 + \sum_{i=1}^d c_iz_i\right) \]

Gaussian Peak (‘gaussian-peak’)

\[f(z) = \exp\left( -\sum_{i=1}^d c_i^2(z_i-w_i)^2\right)\]

Continuous (‘continuous’)

\[f(z) = \exp\left( -\sum_{i=1}^d c_i\lvert z_i-w_i\rvert\right)\]

Product Peak (‘product-peak’)

\[f(z) = \prod_{i=1}^d \left(c_i^{-2}+(z_i-w_i)^2\right)^{-1}\]

Discontinuous (‘discontinuous’)

\[\begin{split}f(z) = \begin{cases}0 & x_1>u_1 \;\mathrm{or}\; x_2>u_2\\\exp\left(\sum_{i=1}^d c_iz_i\right) & \mathrm{otherwise}\end{cases}\end{split}\]

References

Genz1984

Genz, A. Testing multidimensional integration routines. In Proc. of international conference on Tools, methods and languages for scientific and engineering computation (pp. 81-94), 1984