Ten-dimensional (10D) Friedman Function#

The 10D Friedman function (or Friedman6D function for short) is a ten-dimensional (including five dummy variables) scalar-valued function. The function features a combination of non-linearity and variable interaction.

It was originally used in [Fri91] as a test function for testing a regression spline method.

Note

The function was an extension of the six-dimensional version introduced in [FGS83] by adding four additional dummy variables (for a total of five); the function is also available in UQTestFuns.

import numpy as np
import matplotlib.pyplot as pltx
import uqtestfuns as uqtf

Test function instance#

To create a default instance of the test function:

my_testfun = uqtf.Friedman10D()

Check if it has been correctly instantiated:

print(my_testfun)
Function ID      : Friedman10D
Input Dimension  : 10 (fixed)
Output Dimension : 1
Parameterized    : False
Description      : Ten-dimensional function from Friedman (1991)
Applications     : metamodeling

Description#

The test function is analytically defined as follows:

\[ \mathcal{M}(\boldsymbol{x}) = 10 \sin{(\pi x_1 x_2)} + 20 (x_3 - 0.5)^2 + 10 x_4 + 5 x_5 + 0 x_6 + 0 x_7 + 0 x_8 + 0 x_9 + 0 x_{10}, \]

where \(x\) is defined below. Notice that the last five input variables are inert.

Probabilistic input#

Based on [Fri91], the probabilistic input model for the function consists of two independent random variables as shown below.

Hide code cell source
print(my_testfun.prob_input)
Function ID     : Friedman10D
Input ID        : Friedman1983
Input Dimension : 10
Description     : Input specification for the 6D test function from
                  Friedman (1991)
Marginals       :

 No.    Name    Distribution    Parameters    Description
-----  ------  --------------  ------------  -------------
  1     x_1       uniform         [0 1]            -
  2     x_2       uniform         [0 1]            -
  3     x_3       uniform         [0 1]            -
  4     x_4       uniform         [0 1]            -
  5     x_5       uniform         [0 1]            -
  6     x_6       uniform         [0 1]            -
  7     x_7       uniform         [0 1]            -
  8     x_8       uniform         [0 1]            -
  9     x_9       uniform         [0 1]            -
 10     x_10      uniform         [0 1]            -

Copulas         : Independence

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:

Hide code cell source
xx_test = my_testfun.prob_input.get_sample(100000)
yy_test = my_testfun(xx_test)

plt.hist(yy_test, bins="auto", color="#8da0cb");
plt.grid();
plt.ylabel("Counts [-]");
plt.xlabel("$\mathcal{M}(\mathbf{X})$");
plt.gcf().set_dpi(150);
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
Cell In[5], line 4
      1 xx_test = my_testfun.prob_input.get_sample(100000)
      2 yy_test = my_testfun(xx_test)
----> 4 plt.hist(yy_test, bins="auto", color="#8da0cb");
      5 plt.grid();
      6 plt.ylabel("Counts [-]");

NameError: name 'plt' is not defined

References#

[Fri91] (1,2)

J. H. Friedman. Multivariate adaptive regression splines. The Annals of Statistics, 1991. doi:10.1214/aos/1176347963.

[FGS83]

J. H. Friedman, E. Grosse, and W. Stuetzle. Multidimensional additive spline approximation. SIAM Journal on Scientific and Statistical Computing, 1983.