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 ci and wi If None (default) then cj=ˆcj(di=1ˆci)1 where ˆci=(1015(id)2))

Returns
benchmarkpya.Benchmark

Object containing the benchmark attributes

Notes

Corner Peak (‘corner-peak’)

f(z)=(1+di=1cizi)(d+1)

Oscillatory (‘oscillatory’)

f(z)=cos(2πw1+di=1cizi)

Gaussian Peak (‘gaussian-peak’)

f(z)=exp(di=1c2i(ziwi)2)

Continuous (‘continuous’)

f(z)=exp(di=1ci|ziwi|)

Product Peak (‘product-peak’)

f(z)=di=1(c2i+(ziwi)2)1

Discontinuous (‘discontinuous’)

f(z)={0x1>u1orx2>u2exp(di=1cizi)otherwise

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