From b2d2ad63bb4b80398b6f9d31bade9003fba9a5e4 Mon Sep 17 00:00:00 2001 From: Damar Wicaksono Date: Thu, 5 Dec 2024 17:33:02 +0100 Subject: [PATCH] Add linear function with decreasing coefficients The ten-dimensional linear function with decreasing coefficients from Linkletter et al. (2006) has been added to the codebase. The function features eight active variables and was used in the context of sensitivity (screening) analysis. The documentation has been updated accordingly. This issue should resolve Issue #328. --- CHANGELOG.md | 4 + docs/_toc.yml | 4 + docs/fundamentals/metamodeling.md | 93 ++++++------ docs/fundamentals/sensitivity.md | 55 +++---- docs/test-functions/available.md | 147 ++++++++++--------- docs/test-functions/linkletter-dec-coeffs.md | 126 ++++++++++++++++ docs/test-functions/linkletter-linear.md | 13 +- src/uqtestfuns/test_functions/__init__.py | 3 +- src/uqtestfuns/test_functions/linkletter.py | 62 +++++++- 9 files changed, 356 insertions(+), 151 deletions(-) create mode 100644 docs/test-functions/linkletter-dec-coeffs.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e9c378..0441445 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +- The ten-dimensional linear function with decreasing coefficients from + Linkletter et al. (2006) featuring only eight active input variables out of + ten; the function was used in the context of metamodeling and sensitivity + analysis. - The ten-dimensional linear function from Linkletter et al. (2006) featuring only four active input variables out of ten; the function was used in the context of metamodeling and sensitivity analysis. diff --git a/docs/_toc.yml b/docs/_toc.yml index f714cde..5cc6b44 100644 --- a/docs/_toc.yml +++ b/docs/_toc.yml @@ -126,6 +126,10 @@ parts: title: Lim et al. (2002) Non-Polynomial - file: test-functions/lim-poly title: Lim et al. (2002) Polynomial + - file: test-functions/linkletter-dec-coeffs + title: Linkletter et al. (2006) Dec. Coeffs. + - file: test-functions/linkletter-linear + title: Linkletter et al. (2006) Linear - file: test-functions/mclain-s1 title: McLain S1 - file: test-functions/mclain-s2 diff --git a/docs/fundamentals/metamodeling.md b/docs/fundamentals/metamodeling.md index 9636a4f..f45f21c 100644 --- a/docs/fundamentals/metamodeling.md +++ b/docs/fundamentals/metamodeling.md @@ -18,52 +18,53 @@ kernelspec: The table below listed the available test functions typically used in the comparison of metamodeling approaches. -| Name | Input Dimension | Constructor | -|:-------------------------------------------------------------------------:|:---------------:|:----------------------:| -| {ref}`Ackley ` | M | `Ackley()` | -| {ref}`Alemazkoor & Meidani (2018) 2D ` | 2 | `Alemazkoor2D()` | -| {ref}`Alemazkoor & Meidani (2018) 20D ` | 20 | `Alemazkoor20D()` | -| {ref}`Borehole ` | 8 | `Borehole()` | -| {ref}`Cheng and Sandu (2010) 2D ` | 2 | `Cheng2D` | -| {ref}`Coffee Cup Model ` | 2 | `CoffeeCup()` | -| {ref}`Currin et al. (1988) Sine ` | 1 | `CurrinSine()` | -| {ref}`Damped Cosine ` | 1 | `DampedCosine()` | -| {ref}`Damped Oscillator ` | 7 | `DampedOscillator()` | -| {ref}`Dette & Pepelyshev (2010) 8D ` | 3 | `Dette8D()` | -| {ref}`Dette & Pepelyshev (2010) Curved ` | 3 | `DetteCurved()` | -| {ref}`Dette & Pepelyshev (2010) Exponential ` | 3 | `DetteExp()` | -| {ref}`Flood ` | 8 | `Flood()` | -| {ref}`Forrester et al. (2008) ` | 1 | `Forrester2008()` | -| {ref}`(1st) Franke ` | 2 | `Franke1()` | -| {ref}`(2nd) Franke ` | 2 | `Franke2()` | -| {ref}`(3rd) Franke ` | 2 | `Franke3()` | -| {ref}`(4th) Franke ` | 2 | `Franke4()` | -| {ref}`(5th) Franke ` | 2 | `Franke5()` | -| {ref}`(6th) Franke ` | 2 | `Franke6()` | -| {ref}`Friedman (6D) ` | 6 | `Friedman6D()` | -| {ref}`Friedman (10D) ` | 10 | `Friedman10D()` | -| {ref}`Genz (Corner Peak) ` | M | `GenzCornerPeak()` | -| {ref}`Gramacy (2007) 1D Sine ` | 1 | `Gramacy1DSine()` | -| {ref}`Higdon (2002) Sine ` | 1 | `HigdonSine()` | -| {ref}`Holsclaw et al. (2013) Sine ` | 1 | `HolsclawSine()` | -| {ref}`Lim et al. (2002) Non-Polynomial ` | 2 | `LimNonPoly()` | -| {ref}`Lim et al. (2002) Polynomial ` | 2 | `LimPoly()` | -| {ref}`Linkletter et al. (2006) Linear ` | 10 | `LinkletterLinear()` | -| {ref}`McLain S1 ` | 2 | `McLainS1()` | -| {ref}`McLain S2 ` | 2 | `McLainS2()` | -| {ref}`McLain S3 ` | 2 | `McLainS3()` | -| {ref}`McLain S4 ` | 2 | `McLainS4()` | -| {ref}`McLain S5 ` | 2 | `McLainS5()` | -| {ref}`Oakley & O'Hagan (2002) 1D ` | 1 | `Oakley1D()` | -| {ref}`OTL Circuit ` | 6 / 20 | `OTLCircuit()` | -| {ref}`Piston Simulation ` | 7 / 20 | `Piston()` | -| {ref}`Robot Arm ` | 8 | `RobotArm()` | -| {ref}`Solar Cell Model ` | 5 | `SolarCell()` | -| {ref}`Sulfur ` | 9 | `Sulfur()` | -| {ref}`Undamped Oscillator ` | 6 | `UndampedOscillator()` | -| {ref}`Webster et al. (1996) 2D ` | 2 | `Webster2D()` | -| {ref}`Welch et al. (1992) ` | 20 | `Welch1992()` | -| {ref}`Wing Weight ` | 10 | `WingWeight()` | +| Name | Input Dimension | Constructor | +|:-----------------------------------------------------------------------------------------------:|:---------------:|:-----------------------:| +| {ref}`Ackley ` | M | `Ackley()` | +| {ref}`Alemazkoor & Meidani (2018) 2D ` | 2 | `Alemazkoor2D()` | +| {ref}`Alemazkoor & Meidani (2018) 20D ` | 20 | `Alemazkoor20D()` | +| {ref}`Borehole ` | 8 | `Borehole()` | +| {ref}`Cheng and Sandu (2010) 2D ` | 2 | `Cheng2D` | +| {ref}`Coffee Cup Model ` | 2 | `CoffeeCup()` | +| {ref}`Currin et al. (1988) Sine ` | 1 | `CurrinSine()` | +| {ref}`Damped Cosine ` | 1 | `DampedCosine()` | +| {ref}`Damped Oscillator ` | 7 | `DampedOscillator()` | +| {ref}`Dette & Pepelyshev (2010) 8D ` | 3 | `Dette8D()` | +| {ref}`Dette & Pepelyshev (2010) Curved ` | 3 | `DetteCurved()` | +| {ref}`Dette & Pepelyshev (2010) Exponential ` | 3 | `DetteExp()` | +| {ref}`Flood ` | 8 | `Flood()` | +| {ref}`Forrester et al. (2008) ` | 1 | `Forrester2008()` | +| {ref}`(1st) Franke ` | 2 | `Franke1()` | +| {ref}`(2nd) Franke ` | 2 | `Franke2()` | +| {ref}`(3rd) Franke ` | 2 | `Franke3()` | +| {ref}`(4th) Franke ` | 2 | `Franke4()` | +| {ref}`(5th) Franke ` | 2 | `Franke5()` | +| {ref}`(6th) Franke ` | 2 | `Franke6()` | +| {ref}`Friedman (6D) ` | 6 | `Friedman6D()` | +| {ref}`Friedman (10D) ` | 10 | `Friedman10D()` | +| {ref}`Genz (Corner Peak) ` | M | `GenzCornerPeak()` | +| {ref}`Gramacy (2007) 1D Sine ` | 1 | `Gramacy1DSine()` | +| {ref}`Higdon (2002) Sine ` | 1 | `HigdonSine()` | +| {ref}`Holsclaw et al. (2013) Sine ` | 1 | `HolsclawSine()` | +| {ref}`Lim et al. (2002) Non-Polynomial ` | 2 | `LimNonPoly()` | +| {ref}`Lim et al. (2002) Polynomial ` | 2 | `LimPoly()` | +| {ref}`Linkletter et al. (2006) Decreasing Coefficients ` | 10 | `LinkletterDecCoeffs()` | +| {ref}`Linkletter et al. (2006) Linear ` | 10 | `LinkletterLinear()` | +| {ref}`McLain S1 ` | 2 | `McLainS1()` | +| {ref}`McLain S2 ` | 2 | `McLainS2()` | +| {ref}`McLain S3 ` | 2 | `McLainS3()` | +| {ref}`McLain S4 ` | 2 | `McLainS4()` | +| {ref}`McLain S5 ` | 2 | `McLainS5()` | +| {ref}`Oakley & O'Hagan (2002) 1D ` | 1 | `Oakley1D()` | +| {ref}`OTL Circuit ` | 6 / 20 | `OTLCircuit()` | +| {ref}`Piston Simulation ` | 7 / 20 | `Piston()` | +| {ref}`Robot Arm ` | 8 | `RobotArm()` | +| {ref}`Solar Cell Model ` | 5 | `SolarCell()` | +| {ref}`Sulfur ` | 9 | `Sulfur()` | +| {ref}`Undamped Oscillator ` | 6 | `UndampedOscillator()` | +| {ref}`Webster et al. (1996) 2D ` | 2 | `Webster2D()` | +| {ref}`Welch et al. (1992) ` | 20 | `Welch1992()` | +| {ref}`Wing Weight ` | 10 | `WingWeight()` | In a Python terminal, you can list all the available functions relevant for metamodeling applications using ``list_functions()`` diff --git a/docs/fundamentals/sensitivity.md b/docs/fundamentals/sensitivity.md index f96d9ba..20df329 100644 --- a/docs/fundamentals/sensitivity.md +++ b/docs/fundamentals/sensitivity.md @@ -18,33 +18,34 @@ kernelspec: The table below listed the available test functions typically used in the comparison of sensitivity analysis methods. -| Name | Input Dimension | Constructor | -|:--------------------------------------------------------------------------:|:---------------:|:----------------------:| -| {ref}`Borehole ` | 8 | `Borehole()` | -| {ref}`Bratley et al. (1992) A ` | M | `Bratley1992a()` | -| {ref}`Bratley et al. (1992) B ` | M | `Bratley1992b()` | -| {ref}`Bratley et al. (1992) C ` | M | `Bratley1992c()` | -| {ref}`Bratley et al. (1992) D ` | M | `Bratley1992d()` | -| {ref}`Damped Oscillator ` | 7 | `DampedOscillator()` | -| {ref}`Flood ` | 8 | `Flood()` | -| {ref}`Friedman (6D) ` | 6 | `Friedman6D()` | -| {ref}`Genz (Corner Peak) ` | M | `GenzCornerPeak()` | -| {ref}`Genz (Discontinuous) ` | M | `GenzDiscontinuous()` | -| {ref}`Ishigami ` | 3 | `Ishigami()` | -| {ref}`Linkletter et al. (2006) Linear ` | 10 | `LinkletterLinear()` | -| {ref}`Moon (2010) 3D ` | 3 | `Moon3D()` | -| {ref}`Morris et al. (2006) ` | M | `Morris2006()` | -| {ref}`OTL Circuit ` | 6 / 20 | `OTLCircuit()` | -| {ref}`Piston Simulation ` | 7 / 20 | `Piston()` | -| {ref}`Simple Portfolio Model ` | 3 | `Portfolio3D()` | -| {ref}`SaltelliLinear ` | M | `SaltelliLinear()` | -| {ref}`Sobol'-G ` | M | `SobolG()` | -| {ref}`Sobol'-G* ` | M | `SobolGStar()` | -| {ref}`Sobol'-Levitan ` | M | `SobolLevitan()` | -| {ref}`Solar Cell Model ` | 5 | `SolarCell()` | -| {ref}`Sulfur ` | 9 | `Sulfur()` | -| {ref}`Welch et al. (1992) ` | 20 | `Welch1992()` | -| {ref}`Wing Weight ` | 10 | `WingWeight()` | +| Name | Input Dimension | Constructor | +|:-----------------------------------------------------------------------------------------------:|:---------------:|:------------------------:| +| {ref}`Borehole ` | 8 | `Borehole()` | +| {ref}`Bratley et al. (1992) A ` | M | `Bratley1992a()` | +| {ref}`Bratley et al. (1992) B ` | M | `Bratley1992b()` | +| {ref}`Bratley et al. (1992) C ` | M | `Bratley1992c()` | +| {ref}`Bratley et al. (1992) D ` | M | `Bratley1992d()` | +| {ref}`Damped Oscillator ` | 7 | `DampedOscillator()` | +| {ref}`Flood ` | 8 | `Flood()` | +| {ref}`Friedman (6D) ` | 6 | `Friedman6D()` | +| {ref}`Genz (Corner Peak) ` | M | `GenzCornerPeak()` | +| {ref}`Genz (Discontinuous) ` | M | `GenzDiscontinuous()` | +| {ref}`Ishigami ` | 3 | `Ishigami()` | +| {ref}`Linkletter et al. (2006) Decreasing Coefficients ` | 10 | `LinkletterDecCoeffs()` | +| {ref}`Linkletter et al. (2006) Linear ` | 10 | `LinkletterLinear()` | +| {ref}`Moon (2010) 3D ` | 3 | `Moon3D()` | +| {ref}`Morris et al. (2006) ` | M | `Morris2006()` | +| {ref}`OTL Circuit ` | 6 / 20 | `OTLCircuit()` | +| {ref}`Piston Simulation ` | 7 / 20 | `Piston()` | +| {ref}`Simple Portfolio Model ` | 3 | `Portfolio3D()` | +| {ref}`SaltelliLinear ` | M | `SaltelliLinear()` | +| {ref}`Sobol'-G ` | M | `SobolG()` | +| {ref}`Sobol'-G* ` | M | `SobolGStar()` | +| {ref}`Sobol'-Levitan ` | M | `SobolLevitan()` | +| {ref}`Solar Cell Model ` | 5 | `SolarCell()` | +| {ref}`Sulfur ` | 9 | `Sulfur()` | +| {ref}`Welch et al. (1992) ` | 20 | `Welch1992()` | +| {ref}`Wing Weight ` | 10 | `WingWeight()` | In a Python terminal, you can list all the available functions relevant for metamodeling applications using ``list_functions()`` diff --git a/docs/test-functions/available.md b/docs/test-functions/available.md index 64da08c..c9eee7d 100644 --- a/docs/test-functions/available.md +++ b/docs/test-functions/available.md @@ -19,79 +19,80 @@ The table below lists all the test functions available in UQTestFuns from the uncertainty quantification (UQ) literature, regardless of their typical applications. -| Name | Input Dimension | Constructor | -|:-----------------------------------------------------------------------------------:|:---------------:|:-------------------------------:| -| {ref}`Ackley ` | M | `Ackley()` | -| {ref}`Alemazkoor & Meidani (2018) 2D ` | 2 | `Alemazkoor2D()` | -| {ref}`Alemazkoor & Meidani (2018) 20D ` | 20 | `Alemazkoor20D()` | -| {ref}`Borehole ` | 8 | `Borehole()` | -| {ref}`Bratley et al. (1992) A ` | M | `Bratley1992a()` | -| {ref}`Bratley et al. (1992) B ` | M | `Bratley1992b()` | -| {ref}`Bratley et al. (1992) C ` | M | `Bratley1992c()` | -| {ref}`Bratley et al. (1992) D ` | M | `Bratley1992d()` | -| {ref}`Cantilever Beam (2D) ` | 2 | `CantileverBeam2D ` | -| {ref}`Cheng and Sandu (2010) 2D ` | 2 | `Cheng2D ` | -| {ref}`Circular Pipe Crack ` | 2 | `CircularPipeCrack()` | -| {ref}`Coffee Cup Model ` | 2 | `CoffeeCup()` | -| {ref}`Currin et al. (1988) Sine ` | 1 | `CurrinSine()` | -| {ref}`Convex Failure Domain ` | 2 | `ConvexFailDomain()` | -| {ref}`Damped Cosine ` | 1 | `DampedCosine()` | -| {ref}`Damped Oscillator ` | 7 | `DampedOscillator()` | -| {ref}`Damped Oscillator Reliability ` | 8 | `DampedOscillatorReliability()` | -| {ref}`Dette & Pepelyshev (2010) 8D ` | 3 | `Dette8D()` | -| {ref}`Dette & Pepelyshev (2010) Curved ` | 3 | `DetteCurved()` | -| {ref}`Dette & Pepelyshev (2010) Exponential ` | 3 | `DetteExp()` | -| {ref}`Flood ` | 8 | `Flood()` | -| {ref}`Forrester et al. (2008) ` | 1 | `Forrester2008()` | -| {ref}`Four-branch ` | 2 | `FourBranch()` | -| {ref}`(1st) Franke ` | 2 | `Franke1()` | -| {ref}`(2nd) Franke ` | 2 | `Franke2()` | -| {ref}`(3rd) Franke ` | 2 | `Franke3()` | -| {ref}`(4th) Franke ` | 2 | `Franke4()` | -| {ref}`(5th) Franke ` | 2 | `Franke5()` | -| {ref}`(6th) Franke ` | 2 | `Franke6()` | -| {ref}`Friedman (6D) ` | 6 | `Friedman6D()` | -| {ref}`Friedman (10D) ` | 10 | `Friedman10D()` | -| {ref}`Gayton Hat ` | 2 | `GaytonHat()` | -| {ref}`Genz (Continuous) ` | M | `GenzContinuous()` | -| {ref}`Genz (Corner Peak) ` | M | `GenzCornerPeak()` | -| {ref}`Genz (Discontinuous) ` | M | `GenzDiscontinuous()` | -| {ref}`Genz (Gaussian) ` | M | `GenzGaussian()` | -| {ref}`Genz (Oscillatory) ` | M | `GenzOscillatory()` | -| {ref}`Genz (Product Peak) ` | M | `GenzProductPeak()` | -| {ref}`Gramacy (2007) 1D Sine ` | 1 | `Gramacy1DSine()` | -| {ref}`Higdon (2002) Sine ` | 1 | `HigdonSine()` | -| {ref}`Holsclaw et al. (2013) Sine ` | 1 | `HolsclawSine()` | -| {ref}`Hyper-sphere Bound ` | 2 | `HyperSphere()` | -| {ref}`Ishigami ` | 3 | `Ishigami()` | -| {ref}`Lim et al. (2002) Non-Polynomial ` | 2 | `LimNonPoly()` | -| {ref}`Lim et al. (2002) Polynomial ` | 2 | `LimPoly()` | -| {ref}`Linkletter et al. (2006) Linear ` | 10 | `LinkletterLinear()` | -| {ref}`McLain S1 ` | 2 | `McLainS1()` | -| {ref}`McLain S2 ` | 2 | `McLainS2()` | -| {ref}`McLain S3 ` | 2 | `McLainS3()` | -| {ref}`McLain S4 ` | 2 | `McLainS4()` | -| {ref}`McLain S5 ` | 2 | `McLainS5()` | -| {ref}`Moon (2010) 3D ` | 3 | `Moon3D()` | -| {ref}`Morris et al. (2006) ` | M | `Morris2006()` | -| {ref}`Oakley & O'Hagan (2002) 1D ` | 1 | `Oakley1D()` | -| {ref}`OTL Circuit ` | 6 / 20 | `OTLCircuit()` | -| {ref}`Piston Simulation ` | 7 / 20 | `Piston()` | -| {ref}`Simple Portfolio Model ` | 3 | `Portfolio3D()` | -| {ref}`Robot Arm ` | 8 | `RobotArm()` | -| {ref}`RS - Circular Bar ` | 2 | `RSCircularBar()` | -| {ref}`RS - Quadratic ` | 2 | `RSQuadratic()` | -| {ref}`SaltelliLinear ` | M | `SaltelliLinear()` | -| {ref}`Sobol'-G ` | M | `SobolG()` | -| {ref}`Sobol'-G* ` | M | `SobolGStar()` | -| {ref}`Sobol'-Levitan ` | M | `SobolLevitan()` | -| {ref}`Solar Cell Model ` | 5 | `SolarCell()` | -| {ref}`Speed Reducer Shaft ` | 5 | `SpeedReducerShaft()` | -| {ref}`Sulfur ` | 9 | `Sulfur()` | -| {ref}`Undamped Oscillator ` | 6 | `UndampedOscillator()` | -| {ref}`Webster et al. (1996) 2D ` | 2 | `Webster2D()` | -| {ref}`Welch et al. (1992) ` | 20 | `Welch1992()` | -| {ref}`Wing Weight ` | 10 | `WingWeight()` | +| Name | Input Dimension | Constructor | +|:----------------------------------------------------------------------------------------------:|:---------------:|:-------------------------------:| +| {ref}`Ackley ` | M | `Ackley()` | +| {ref}`Alemazkoor & Meidani (2018) 2D ` | 2 | `Alemazkoor2D()` | +| {ref}`Alemazkoor & Meidani (2018) 20D ` | 20 | `Alemazkoor20D()` | +| {ref}`Borehole ` | 8 | `Borehole()` | +| {ref}`Bratley et al. (1992) A ` | M | `Bratley1992a()` | +| {ref}`Bratley et al. (1992) B ` | M | `Bratley1992b()` | +| {ref}`Bratley et al. (1992) C ` | M | `Bratley1992c()` | +| {ref}`Bratley et al. (1992) D ` | M | `Bratley1992d()` | +| {ref}`Cantilever Beam (2D) ` | 2 | `CantileverBeam2D ` | +| {ref}`Cheng and Sandu (2010) 2D ` | 2 | `Cheng2D ` | +| {ref}`Circular Pipe Crack ` | 2 | `CircularPipeCrack()` | +| {ref}`Coffee Cup Model ` | 2 | `CoffeeCup()` | +| {ref}`Currin et al. (1988) Sine ` | 1 | `CurrinSine()` | +| {ref}`Convex Failure Domain ` | 2 | `ConvexFailDomain()` | +| {ref}`Damped Cosine ` | 1 | `DampedCosine()` | +| {ref}`Damped Oscillator ` | 7 | `DampedOscillator()` | +| {ref}`Damped Oscillator Reliability ` | 8 | `DampedOscillatorReliability()` | +| {ref}`Dette & Pepelyshev (2010) 8D ` | 3 | `Dette8D()` | +| {ref}`Dette & Pepelyshev (2010) Curved ` | 3 | `DetteCurved()` | +| {ref}`Dette & Pepelyshev (2010) Exponential ` | 3 | `DetteExp()` | +| {ref}`Flood ` | 8 | `Flood()` | +| {ref}`Forrester et al. (2008) ` | 1 | `Forrester2008()` | +| {ref}`Four-branch ` | 2 | `FourBranch()` | +| {ref}`(1st) Franke ` | 2 | `Franke1()` | +| {ref}`(2nd) Franke ` | 2 | `Franke2()` | +| {ref}`(3rd) Franke ` | 2 | `Franke3()` | +| {ref}`(4th) Franke ` | 2 | `Franke4()` | +| {ref}`(5th) Franke ` | 2 | `Franke5()` | +| {ref}`(6th) Franke ` | 2 | `Franke6()` | +| {ref}`Friedman (6D) ` | 6 | `Friedman6D()` | +| {ref}`Friedman (10D) ` | 10 | `Friedman10D()` | +| {ref}`Gayton Hat ` | 2 | `GaytonHat()` | +| {ref}`Genz (Continuous) ` | M | `GenzContinuous()` | +| {ref}`Genz (Corner Peak) ` | M | `GenzCornerPeak()` | +| {ref}`Genz (Discontinuous) ` | M | `GenzDiscontinuous()` | +| {ref}`Genz (Gaussian) ` | M | `GenzGaussian()` | +| {ref}`Genz (Oscillatory) ` | M | `GenzOscillatory()` | +| {ref}`Genz (Product Peak) ` | M | `GenzProductPeak()` | +| {ref}`Gramacy (2007) 1D Sine ` | 1 | `Gramacy1DSine()` | +| {ref}`Higdon (2002) Sine ` | 1 | `HigdonSine()` | +| {ref}`Holsclaw et al. (2013) Sine ` | 1 | `HolsclawSine()` | +| {ref}`Hyper-sphere Bound ` | 2 | `HyperSphere()` | +| {ref}`Ishigami ` | 3 | `Ishigami()` | +| {ref}`Lim et al. (2002) Non-Polynomial ` | 2 | `LimNonPoly()` | +| {ref}`Lim et al. (2002) Polynomial ` | 2 | `LimPoly()` | +| {ref}`Linkletter et al. (2006) Decreasing Coefficients ` | 10 | `LinkletterDecCoeffs()` | +| {ref}`Linkletter et al. (2006) Linear ` | 10 | `LinkletterLinear()` | +| {ref}`McLain S1 ` | 2 | `McLainS1()` | +| {ref}`McLain S2 ` | 2 | `McLainS2()` | +| {ref}`McLain S3 ` | 2 | `McLainS3()` | +| {ref}`McLain S4 ` | 2 | `McLainS4()` | +| {ref}`McLain S5 ` | 2 | `McLainS5()` | +| {ref}`Moon (2010) 3D ` | 3 | `Moon3D()` | +| {ref}`Morris et al. (2006) ` | M | `Morris2006()` | +| {ref}`Oakley & O'Hagan (2002) 1D ` | 1 | `Oakley1D()` | +| {ref}`OTL Circuit ` | 6 / 20 | `OTLCircuit()` | +| {ref}`Piston Simulation ` | 7 / 20 | `Piston()` | +| {ref}`Simple Portfolio Model ` | 3 | `Portfolio3D()` | +| {ref}`Robot Arm ` | 8 | `RobotArm()` | +| {ref}`RS - Circular Bar ` | 2 | `RSCircularBar()` | +| {ref}`RS - Quadratic ` | 2 | `RSQuadratic()` | +| {ref}`SaltelliLinear ` | M | `SaltelliLinear()` | +| {ref}`Sobol'-G ` | M | `SobolG()` | +| {ref}`Sobol'-G* ` | M | `SobolGStar()` | +| {ref}`Sobol'-Levitan ` | M | `SobolLevitan()` | +| {ref}`Solar Cell Model ` | 5 | `SolarCell()` | +| {ref}`Speed Reducer Shaft ` | 5 | `SpeedReducerShaft()` | +| {ref}`Sulfur ` | 9 | `Sulfur()` | +| {ref}`Undamped Oscillator ` | 6 | `UndampedOscillator()` | +| {ref}`Webster et al. (1996) 2D ` | 2 | `Webster2D()` | +| {ref}`Welch et al. (1992) ` | 20 | `Welch1992()` | +| {ref}`Wing Weight ` | 10 | `WingWeight()` | In a Python terminal, you can list all the available functions along with the corresponding constructor using ``list_functions()`` diff --git a/docs/test-functions/linkletter-dec-coeffs.md b/docs/test-functions/linkletter-dec-coeffs.md new file mode 100644 index 0000000..0224783 --- /dev/null +++ b/docs/test-functions/linkletter-dec-coeffs.md @@ -0,0 +1,126 @@ +--- +jupytext: + formats: ipynb,md:myst + text_representation: + extension: .md + format_name: myst + format_version: 0.13 + jupytext_version: 1.14.1 +kernelspec: + display_name: Python 3 (ipykernel) + language: python + name: python3 +--- + +(test-functions:linkletter-dec-coeffs)= +# Linear Function with Decreasing Coefficients from Linkletter et al. (2006) + +```{code-cell} ipython3 +import numpy as np +import matplotlib.pyplot as plt +import uqtestfuns as uqtf +``` + +The linear function is a ten-dimensional, scalar-valued function whose +coefficients are decreasing. Only the first eight input variables are active, +while the rest is inert. +The function was used in {cite}`Linkletter2006` to demonstrate a variable +selection method (i.e., sensitivity analysis) +in the context of Gaussian process metamodeling: + +```{note} +Linkletter et al. {cite}`Linkletter2006` introduced four ten-dimensional +analytical test functions with some of the input variables inert. +They are used to demonstrate a variable selection method (i.e., screening) +in the context of Gaussian process metamodeling: + +- {ref}`Linear ` function features + a simple function with four active input variables (out of 10). +- {ref}`Linear with decreasing coefficients ` + function features a slightly more complex linear function with eight active + input variables (out of 10). (_this function_) +``` + + +## Test function instance + +To create a default instance of the test function: + +```{code-cell} ipython3 +my_testfun = uqtf.LinkletterDecCoeffs() +``` + +Check if it has been correctly instantiated: + +```{code-cell} ipython3 +print(my_testfun) +``` + +## Description + +The test function is defined as[^location]: + +$$ +\mathcal{M}(\boldsymbol{x}) = 0.2 \sum_{i = 1}^8 \frac{x_i}{2^{(i - 1)}} +$$ + +where $\boldsymbol{x} = \left( x_1, \ldots x_{10} \right)$ +is the ten-dimensional vector of input variables further defined below. +Notice that only eight out of ten input variables are active. + +```{note} +In the original paper, the function was added with an independent identically +distributed (i.i.d) noise from $\mathcal{N}(0, \sigma)$ +with a standard deviation $\sigma = 0.05$. + +Furthermore, also in the original paper, a batch of data is generated from +the function and then standardized to have mean $0.0$ and standard deviation +$1.0$. + +The implementation of UQTestFuns does not include any error addition +or standardization. However, these processes can be done manually +after the data is generated. +``` + +## Probabilistic input + +The probabilistic input model for the test function is shown below. + +```{code-cell} ipython3 +:tags: [hide-input] + +print(my_testfun.prob_input) +``` + +## 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: + +```{code-cell} ipython3 +:tags: [hide-input] + +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, bins="auto", color="#8da0cb"); +plt.grid(); +plt.ylabel("Counts [-]"); +plt.xlabel("$\mathcal{M}(X)$"); +plt.gcf().tight_layout(pad=3.0) +plt.gcf().set_dpi(150); +``` + +## References + +```{bibliography} +:style: unsrtalpha +:filter: docname in docnames +``` + +[^location]: see Eq. (6), Example 1, in {cite}`Linkletter2006`. diff --git a/docs/test-functions/linkletter-linear.md b/docs/test-functions/linkletter-linear.md index 33ccb85..addae96 100644 --- a/docs/test-functions/linkletter-linear.md +++ b/docs/test-functions/linkletter-linear.md @@ -36,6 +36,9 @@ in the context of Gaussian process metamodeling: - {ref}`Linear ` function features a simple function with four active input variables (out of 10). (_this function_) +- {ref}`Linear with decreasing coefficients ` + function features a slightly more complex linear function with eight active + input variables (out of 10). ``` @@ -58,7 +61,7 @@ print(my_testfun) The test function is defined as[^location]: $$ -\mathcal{M}(\boldsymbol{x}) = 0.2 (x_1 + x_2 + x_3 + x_4), +\mathcal{M}(\boldsymbol{x}) = 0.2 \sum_{i = 1}^4 x_i, $$ where $\boldsymbol{x} = \left( x_1, \ldots x_{10} \right)$ @@ -69,6 +72,14 @@ Notice that only four out of ten input variables are active. In the original paper, the function was added with an independent identically distributed (i.i.d) noise from $\mathcal{N}(0, \sigma)$ with a standard deviation $\sigma = 0.05$. + +Furthermore, also in the original paper, a batch of data is generated from +the function and then standardized to have mean $0.0$ and standard deviation +$1.0$. + +The implementation of UQTestFuns does not include any error addition +or standardization. However, these processes can be done manually +after the data is generated. ``` ## Probabilistic input diff --git a/src/uqtestfuns/test_functions/__init__.py b/src/uqtestfuns/test_functions/__init__.py index f85cbc5..bc2cec8 100644 --- a/src/uqtestfuns/test_functions/__init__.py +++ b/src/uqtestfuns/test_functions/__init__.py @@ -35,7 +35,7 @@ from .hyper_sphere import HyperSphere from .ishigami import Ishigami from .lim import LimPoly, LimNonPoly -from .linkletter import LinkletterLinear +from .linkletter import LinkletterLinear, LinkletterDecCoeffs from .oakley2002 import Oakley1D from .otl_circuit import OTLCircuit from .mclain import McLainS1, McLainS2, McLainS3, McLainS4, McLainS5 @@ -105,6 +105,7 @@ "Ishigami", "LimNonPoly", "LimPoly", + "LinkletterDecCoeffs", "LinkletterLinear", "Oakley1D", "OTLCircuit", diff --git a/src/uqtestfuns/test_functions/linkletter.py b/src/uqtestfuns/test_functions/linkletter.py index 25e3724..d1aa41e 100644 --- a/src/uqtestfuns/test_functions/linkletter.py +++ b/src/uqtestfuns/test_functions/linkletter.py @@ -8,7 +8,8 @@ Available functions are: -- Linear function with four active input variables (out of 10). +- Linear function with four active input variables.. +- Linear function with decreasing coefficients, eight active input variables. References ---------- @@ -24,11 +25,11 @@ from uqtestfuns.core.custom_typing import ProbInputSpecs from uqtestfuns.core.uqtestfun_abc import UQTestFunFixDimABC -__all__ = ["LinkletterLinear"] +__all__ = ["LinkletterLinear", "LinkletterDecCoeffs"] def evaluate_linear(xx: np.ndarray) -> np.ndarray: - """Evaluate the linear function from Linkletter et al. (2006). + """Evaluate the linear function from Linkletter et al. (2006). Parameters ---------- @@ -47,6 +48,29 @@ def evaluate_linear(xx: np.ndarray) -> np.ndarray: return yy +def evaluate_dec_coeffs(xx: np.ndarray) -> np.ndarray: + """Evaluate the linear function with decreasing coefficients. + + Parameters + ---------- + xx : np.ndarray + M-Dimensional input values given by an N-by-10 array where + N is the number of input values. + + Returns + ------- + np.ndarray + The output of the test function evaluated on the input values. + The output is a 1-dimensional array of length N. + """ + exps = np.arange(8) # 8 input variables are active + coeffs = 0.2 / 2**exps + + yy = np.sum(coeffs * xx[:, :8], axis=1) + + return yy + + class LinkletterLinear(UQTestFunFixDimABC): """A concrete implementation of the linear function.""" @@ -74,3 +98,35 @@ class LinkletterLinear(UQTestFunFixDimABC): _available_parameters = None evaluate = staticmethod(evaluate_linear) # type: ignore + + +class LinkletterDecCoeffs(UQTestFunFixDimABC): + """A concrete implementation of the linear with decreasing coefficients.""" + + _tags = ["metamodeling", "sensitivity"] + _description = ( + "Linear function with decreasing coefficients from Linkletter et al. " + "(2006)" + ) + _available_inputs: ProbInputSpecs = { + "Linkletter2006": { + "function_id": "LinkletterLinear", + "description": ( + "Input specification for the linear test function with " + "decreasing coefficients Eq. (6) from Linkletter et al. (2006)" + ), + "marginals": [ + { + "name": f"x_{i + 1}", + "distribution": "uniform", + "parameters": [0, 1], + "description": None, + } + for i in range(10) + ], + "copulas": None, + }, + } + _available_parameters = None + + evaluate = staticmethod(evaluate_dec_coeffs) # type: ignore