Uncertainty quantification

We provide a host of models and functions that are often used for testing and benchmarking exercises in the uncertainty quantification literature.


temfpy.uncertainty_quantification.borehole(x)[source]

Borehole function.

\[f(x) = \frac{2 \pi x_1 (x_2 - x_3)}{\ln{\left(x_4/x_5\right)} \left(1 + \frac{2 x_1 x_6}{\ln{(x_4/x_5)}x_5^2 x_7} + \frac{x_1}{x_8}\right)}\]
Parameters

x (array_like) – Core parameters of the model with dimension 8.

Returns

Flow rate in \(m^3/yr\).

Return type

float

Notes

The Borehole function was developed by Harper and Gupta [H1983] to model steady state flow through a hypothetical borehole. It is widely used as a testing function for a variety of methods due to its simplicity and quick evaluation (e.g. [X2013]). Harper and Gupta used the function originally to compare the results of a sensitivity analysis to results based on Latin hypercube sampling.

References

H1983

Harper, W. V., and Gupta, S. K. (1983). Sensitivity/uncertainty analysis of a borehole scenario comparing Latin hypercube sampling and deterministc sensitivity approaches. Office of Nuclear Waste Isolation, Battelle Memorial Institute.

X2013

Xiong, S., Qian, P. Z., and Wu, C. J. (2013). Sequential design and analysis of high-accuracy and low-accuracy computer codes. Technometrics, 55(1): 37-46.

Examples

>>> from temfpy.uncertainty_quantification import borehole
>>> import numpy as np
>>>
>>> x = [1, 2, 3, 4, 5, 6, 7, 8]
>>> y = borehole(x)
>>> np.testing.assert_almost_equal(y, 34.43500403827335)
temfpy.uncertainty_quantification.eoq_model(x, r=0.1)[source]

Economic order quantity model.

\[y = \sqrt{\frac{24 x_0 x_2}{r x_1}}\]
Parameters
  • x (array_like) – Core parameters of the model.

  • r (float, optional) – Annual interest rate (default value is 0.1).

Returns

y – Optimal order quantity.

Return type

float

Notes

This function computes the optimal economic order quantity (EOQ) based on the model presented in [H1990]. The EOQ minimizes holding as well as ordering costs. The core parameters of the model are the units per month \(x_0\), the unit price of items in stock \(x_1\), and the setup costs of an order \(x_2\). The annual interest rate r is treated as an additional parameter. A historical perspective on the model is provided by [E1990]. A brief description with the core equations is available in [W2020]. The figure below illustrates the core trade-off in the model. Holding \(x_1\) and \(x_2\) constant, an increase in \(x_0\) results in a decrease in the setup cost per unit, but an increase in capital cost increases as the stock of inventory.

_images/fig-eoq-tradeoff.png

References

H1990

Harris, F. W. (1990). How many parts to make at once. Operations Research, 38(6): 947-950.

E1990

Erlenkotter, D. (1990). Ford Whitman Harris and the economic order quantity model. Operations Research, 38(6): 937-946.

W2020

Economic order quantity. (2020, April 3). In Wikipedia. Retrieved from https://en.wikipedia.org/w/index.php?title=Economic_order_quantity&oldid=948881557.

Examples

>>> from temfpy.uncertainty_quantification import eoq_model
>>> import numpy as np
>>>
>>> x = [1, 2, 3]
>>> y = eoq_model(x, r=0.1)
>>> np.testing.assert_almost_equal(y, 18.973665961010276)
temfpy.uncertainty_quantification.ishigami(x, a=7, b=0.05)[source]

Ishigami function.

\[f(x) = \sin(x_1) + a \sin^2(x_2) + b x_3^4 \sin(x_1)\]
Parameters
  • x (array_like) – Core parameters of the model with dimension 3.

  • a (float, optional) – The default value is 7, as used by Sobol’ and Levitan in [S1999].

  • b (float, optional) – The default value is 0.05, as used by Sobol’ and Levitan.

Returns

Output domain

Return type

float

Notes

This function was specifically developed by Ishigami and Homma [I1990] as a test function used for uncertainty analysis. It is characterized by its strong nonlinearity and nonmonotonicity. Sobol’ and Levitan note that the Ishigami function has a strong dependence on \(x_2\).

References

I1990

Ishigami, T., and Homma, T. (1990). An importance quantification technique in uncertainty analysis for computer models. In Uncertainty Modeling and Analysis. Proceedings., First International Symposium on Uncertainty Modeling and Analysis (pp. 398-403).

S1999

Sobol’, I. M., and Levitan, Y. L. (1999). On the use of variance reducing multipliers in Monte Carlo computations of a global sensitivity index. Computer Physics Communications, 117(1): 52-61.

Examples

>>> from temfpy.uncertainty_quantification import ishigami
>>> import numpy as np
>>>
>>> x = [1, 2, 3]
>>> y = ishigami(x)
>>> np.testing.assert_almost_equal(y, 10.037181146302519)
temfpy.uncertainty_quantification.simple_linear_function(x)[source]

Uncomplicated linear function.

\[y = \sum_{i = 1}^p x_i\]
Parameters

x (array_like) – Array of summands.

Returns

y – Sum of all array elements.

Return type

float

Notes

This function computes the sum of all elements of a given \(p\) - dimensional array.

Examples

>>> from temfpy.uncertainty_quantification import simple_linear_function
>>> import numpy as np
>>>
>>> x = [1, 2, 3]
>>> y = simple_linear_function(x)
>>> np.testing.assert_almost_equal(y, 6)