One-dimensional (1D) Damped Cosine Function#
The 1D damped cosine function from Santner et al. [SWN18] is a scalar-valued test function for metamodeling exercises.
import numpy as np
import matplotlib.pyplot as plt
import uqtestfuns as uqtf
A plot of the function is shown below for \(x \in [0, 1]\).
Test function instance#
To create a default instance of the test function:
my_testfun = uqtf.DampedCosine()
Check if it has been correctly instantiated:
print(my_testfun)
Function ID : DampedCosine
Input Dimension : 1 (fixed)
Output Dimension : 1
Parameterized : False
Description : One-dimensional damped cosine from Santner et al. (2018)
Applications : metamodeling
Description#
The test function is analytically defined as follows[1]:
where \(x\) is defined below.
Probabilistic input#
Based on [SWN18], the domain of the function is in \([0, 1]\). In UQTestFuns, this domain can be represented as a probabilistic input model using the uniform distribution shown in the table below.
Function ID : DampedCosine
Input ID : Santner2018
Input Dimension : 1
Description : Input model for the one-dimensional damped cosine from
Santner et al. (2018)
Marginals :
No. Name Distribution Parameters Description
----- ------ -------------- ------------ -------------
1 x uniform [0. 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:
Moment estimations#
Shown below is the convergence of a direct Monte-Carlo estimation of the output mean and variance with increasing sample sizes.
The tabulated results for each sample size is shown below.
| Sample size | Mean | Mean error | Variance | Variance error | Remark |
|---|---|---|---|---|---|
| 10 | -7.1324e-02 | 2.7675e-01 | 1.1090e-01 | 1.2665e-01 | Monte-Carlo |
| 100 | 4.5017e-02 | 8.5058e-02 | 1.9454e-01 | 4.4512e-02 | Monte-Carlo |
| 1000 | -2.5314e-02 | 2.5099e-02 | 1.6208e-01 | 1.2621e-02 | Monte-Carlo |
| 10000 | -1.8074e-02 | 9.6450e-03 | 1.6928e-01 | 3.8623e-03 | Monte-Carlo |
| 100000 | -9.4371e-03 | 2.4299e-03 | 1.7134e-01 | 1.3109e-03 | Monte-Carlo |
| 1000000 | -1.0507e-02 | 8.1401e-04 | 1.7073e-01 | 3.7487e-04 | Monte-Carlo |
References#
Thomas J. Santner, Brian J. Williams, and William I. Notz. The design and analysis of computer experiments. Springer New York, 2018. doi:10.1007/978-1-4939-8847-1.