Genz Corner Peak Function#
import numpy as np
import matplotlib.pyplot as plt
import uqtestfuns as uqtf
The Genz corner peak function is an \(M\)-dimensional scalar-valued function commonly used to assess the accuracy of numerical integration routines. It is one of six functions introduced by Genz [Gen84]; see the box below.
The function was later featured in [ZP14] as a test function for a global sensitivity analysis method and in [JES15] for metamodeling applications.
The function features a prominent peak in one corner of the multidimensional space. The plots for one-dimensional and two-dimensional Genz corner peak function with the default parameters can be seen below.
Note
Genz [Gen84] introduced six challenging parameterized \(M\)-dimensional functions designed to test the performance of numerical integration routines:
Oscillatory function features an oscillating shape in the multidimensional space.
Product peak function features a prominent peak at the center of the multidimensional space.
Corner peak function features a prominent peak in one corner of the multidimensional space. (this function)
Gaussian function features a bell-shaped peak at the center of the multidimensional space.
Continuous function features an exponential decay from the center of the multidimensional space. The function is continuous everywhere, but non-differentiable at the center.
Discontinuous function features an exponential rise from corner of the multidimensional space up to the offset parameter value, after which the function value drops to zero everywhere, creating discontinuity.
The functions are further characterized by offset (shift) and shape parameters. While the offset parameter has minimal impact on the integral’s value, the shape parameter significantly affects the difficulty of the integration problem.
Test function instance#
To create a default instance of the test function:
my_testfun = uqtf.GenzCornerPeak()
Check if it has been correctly instantiated:
print(my_testfun)
Function ID : GenzCornerPeak
Input Dimension : 2 (variable)
Output Dimension : 1
Parameterized : True
Description : Corner peak integrand from Genz (1984)
Applications : integration, metamodeling, sensitivity
By default, the input dimension is set to \(2\)[1].
To create an instance with another value of input dimension,
pass an integer to the parameter input_dimension (the first parameter).
For example, to create an instance of the test function in six dimensions,
type:
my_testfun = uqtf.GenzCornerPeak(input_dimension=6)
Description#
The Genz corner peak function is defined as:
where \(\boldsymbol{x} = \left( x_1, \ldots, x_M \right)\) is the \(M\)-dimensional vector of input variables and \(\boldsymbol{a} = \left( a_1, \ldots, a_M \right)\) is the \(M\)-dimensional vector of (fixed) shape parameters. Further details about these parameters are provided below.
Probabilistic input#
The input specification for the Genz corner peak function is shown below.
Show code cell source
print(my_testfun.prob_input)
Function ID : GenzCornerPeak
Input ID : Genz1984
Input Dimension : 2
Description : Input specification for the Genz family of integrand
Marginals :
No. Name Distribution Parameters Description
----- ------ -------------- ------------ -------------
1 X1 uniform [0. 1.] -
2 X2 uniform [0. 1.] -
Copulas : Independence
Parameters#
The parameters of the Genz corner peak function consists of the vector of shape (scale) parameters \(\boldsymbol{a}\), which determine the extent of the corner peaking. Larger values of \(\boldsymbol{a}\) increase the prominence of the peak, making the integration problem more challenging.
The available parameters for the Genz corner peak function are shown in the table below.
No. |
\(\boldsymbol{a}\) |
Keyword |
Source |
Remark |
|---|---|---|---|---|
1. |
\(a_1 = \ldots = a_M = 5\) |
|
[Gen84] |
— |
2. |
\(a_i = 0.02 + 0.03 \times (i - 1),\, i = 1, \ldots, M\) |
|
[ZP14] (Section 4.4) |
Originally, 3 dimensions |
3. |
\(a_i = 0.01 \times i,\, i = 1, \ldots, M\) |
|
[ZP14] (Section 4.4) |
Originally, 10 dimensions |
The default parameter is shown below.
Show code cell source
print(my_testfun.parameters)
Function ID : GenzCornerPeak
Parameter ID : Genz1984
Description : Parameter set for the corner peak function from Genz
(1984); constant shape and offset values
No. Keyword Value Type Description
----- --------- ---------- ------- ---------------
1 aa (2,) array ndarray Shape parameter
Note
To create an instance of the Genz corner peak function with different built-in
parameter values, pass the corresponding keyword to the parameter parameters_id.
For example, to use the parameters from [ZP14],
type:
my_testfun = uqtf.GenzCornerPeak(parameters_id="Zhang2014-1")
Reference results#
This section provides several reference results of typical UQ analyses involving the test function.
Sample histogram#
Shown below is the histogram of the output based on \(100'000\) random points:
Show code cell source
my_testfun.prob_input.reset_rng(42)
xx_test = my_testfun.prob_input.get_sample(100000)
yy_test = my_testfun(xx_test)
plt.hist(yy_test, color="#8da0cb");
plt.grid();
plt.ylabel("Counts [-]");
plt.xlabel("$\mathcal{M}(\mathbf{X})$");
plt.gcf().set_dpi(150);
Notice that the values are indeed mostly zeros.
References#
Alan Genz. Testing multidimensional integration routines. In Proceeding of International Conference on Tools, Methods and Languages for Scientific and Engineering Computation, 81–94. Elsevier North-Holland, Inc., 1984.
J. D. Jakeman, M. S. Eldred, and K. Sargsyan. Enhancingℓ1-minimization estimates of polynomial chaos expansions using basis selection. Journal of Computational Physics, 289:18–34, 2015. doi:10.1016/j.jcp.2015.02.025.
Xufang Zhang and Mahesh D. Pandey. An effective approximation for variance-based global sensitivity analysis. Reliability Engineering & System Safety, 121:164–174, January 2014. doi:10.1016/j.ress.2013.07.010.