Two-Dimensional Function from Webster et al. (1996)

Two-Dimensional Function from Webster et al. (1996)#

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

The 2D function introduced in [WTM96] is a polynomial function. It was used to illustrate the construction of a polynomial chaos expansion metamodel (via stochastic collocation) having uncertain (random) input variables.

../_images/0c74ef8425b5fcb3484ee406e71ca22898abbdb492efb4bef518b08d8a536fd2.png

Test function instance#

To create a default instance of the test function:

my_testfun = uqtf.Webster2D()

Check if it has been correctly instantiated:

print(my_testfun)
Function ID      : Webster2D
Input Dimension  : 2 (fixed)
Output Dimension : 1
Parameterized    : False
Description      : 2D polynomial function from Webster et al. (1996).
Applications     : metamodeling

Description#

The Webster 2D function is defined as follows[1]:

\[ \mathcal{M}(\boldsymbol{x}) = A^2 + B^3, \]

where \(\boldsymbol{x} = \{ A, B \}\) is the two-dimensional vector of input variables further defined below.

Probabilistic input#

Based on [WTM96], 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     : Webster2D
Input ID        : Webster1996
Input Dimension : 2
Description     : Input specification for the 2D function from Webster et
                  al. (1996)
Marginals       :

 No.    Name    Distribution    Parameters    Description
-----  ------  --------------  ------------  -------------
  1      A        uniform       [ 1. 10.]          -
  2      B         normal        [2. 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);
../_images/36ce1df3a04de1709dc55de30988bbab31ddfd0d9c71057411323ea6667d3859.png

References#

[WTM96] (1,2,3)

M. D. Webster, M. A. Tatang, and G. J. McRae. Application of the probabilistic collocation method for an uncertainty analysis of a simple ocean model. Technical Report Joint Program Report Series No. 4, Massachusetts Institute of Technology, Cambridge, MA, 1996. URL: http://globalchange.mit.edu/publication/15670.