Skip to content

Commit

Permalink
Merge pull request #378 from damar-wicaksono/dev-354
Browse files Browse the repository at this point in the history
Add Saltelli Linear function for sensitivity analysis
  • Loading branch information
damar-wicaksono authored Nov 11, 2024
2 parents 72b8be7 + 301e4a2 commit 25f61f7
Show file tree
Hide file tree
Showing 12 changed files with 624 additions and 31 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- The M-dimensional linear function from Saltelli et al. (2008) for sensitivity
analysis.
- The two-dimensional non-polynomial test function for metamodeling from

Lim et al. (2002).
- The two-dimensional polynomial test function for metamodeling from
Lim et al. (2002).
- The three-dimensional sensitivity test function from Moon (2010).
Expand Down
2 changes: 2 additions & 0 deletions docs/_toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ parts:
title: RS - Circular Bar
- file: test-functions/rs-quadratic
title: RS - Quadratic
- file: test-functions/saltelli-linear
title: Saltelli Linear
- file: test-functions/sobol-g
title: Sobol'-G
- file: test-functions/speed-reducer-shaft
Expand Down
39 changes: 20 additions & 19 deletions docs/fundamentals/sensitivity.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,26 @@ kernelspec:
The table below listed the available test functions typically used
in the comparison of sensitivity analysis methods.

| Name | Input Dimension | Constructor |
|:------------------------------------------------------------:|:---------------:|:--------------------:|
| {ref}`Borehole <test-functions:borehole>` | 8 | `Borehole()` |
| {ref}`Bratley et al. (1992) A <test-functions:bratley1992a>` | M | `Bratley1992a()` |
| {ref}`Bratley et al. (1992) B <test-functions:bratley1992b>` | M | `Bratley1992b()` |
| {ref}`Bratley et al. (1992) C <test-functions:bratley1992c>` | M | `Bratley1992c()` |
| {ref}`Bratley et al. (1992) D <test-functions:bratley1992d>` | M | `Bratley1992d()` |
| {ref}`Damped Oscillator <test-functions:damped-oscillator>` | 7 | `DampedOscillator()` |
| {ref}`Flood <test-functions:flood>` | 8 | `Flood()` |
| {ref}`Friedman (6D) <test-functions:friedman-6d>` | 6 | `Friedman6D()` |
| {ref}`Ishigami <test-functions:ishigami>` | 3 | `Ishigami()` |
| {ref}`Moon (2010) 3D <test-functions:moon3d>` | 3 | `Moon3D()` |
| {ref}`OTL Circuit <test-functions:otl-circuit>` | 6 / 20 | `OTLCircuit()` |
| {ref}`Piston Simulation <test-functions:piston>` | 7 / 20 | `Piston()` |
| {ref}`Simple Portfolio Model <test-functions:portfolio-3d>` | 3 | `Portfolio3D()` |
| {ref}`Sobol'-G <test-functions:sobol-g>` | M | `SobolG()` |
| {ref}`Sulfur <test-functions:sulfur>` | 9 | `Sulfur()` |
| {ref}`Welch et al. (1992) <test-functions:welch1992>` | 20 | `Welch1992()` |
| {ref}`Wing Weight <test-functions:wing-weight>` | 10 | `WingWeight()` |
| Name | Input Dimension | Constructor |
|:-----------------------------------------------------------------------------:|:---------------:|:--------------------:|
| {ref}`Borehole <test-functions:borehole>` | 8 | `Borehole()` |
| {ref}`Bratley et al. (1992) A <test-functions:bratley1992a>` | M | `Bratley1992a()` |
| {ref}`Bratley et al. (1992) B <test-functions:bratley1992b>` | M | `Bratley1992b()` |
| {ref}`Bratley et al. (1992) C <test-functions:bratley1992c>` | M | `Bratley1992c()` |
| {ref}`Bratley et al. (1992) D <test-functions:bratley1992d>` | M | `Bratley1992d()` |
| {ref}`Damped Oscillator <test-functions:damped-oscillator>` | 7 | `DampedOscillator()` |
| {ref}`Flood <test-functions:flood>` | 8 | `Flood()` |
| {ref}`Friedman (6D) <test-functions:friedman-6d>` | 6 | `Friedman6D()` |
| {ref}`Ishigami <test-functions:ishigami>` | 3 | `Ishigami()` |
| {ref}`Moon (2010) 3D <test-functions:moon3d>` | 3 | `Moon3D()` |
| {ref}`OTL Circuit <test-functions:otl-circuit>` | 6 / 20 | `OTLCircuit()` |
| {ref}`Piston Simulation <test-functions:piston>` | 7 / 20 | `Piston()` |
| {ref}`Simple Portfolio Model <test-functions:portfolio-3d>` | 3 | `Portfolio3D()` |
| {ref}`SaltelliLinear <test-functions:saltelli-linear>` | M | `SaltelliLinear()` |
| {ref}`Sobol'-G <test-functions:sobol-g>` | M | `SobolG()` |
| {ref}`Sulfur <test-functions:sulfur>` | 9 | `Sulfur()` |
| {ref}`Welch et al. (1992) <test-functions:welch1992>` | 20 | `Welch1992()` |
| {ref}`Wing Weight <test-functions:wing-weight>` | 10 | `WingWeight()` |

In a Python terminal, you can list all the available functions relevant
for metamodeling applications using ``list_functions()`` and filter the results
Expand Down
10 changes: 10 additions & 0 deletions docs/references.bib
Original file line number Diff line number Diff line change
Expand Up @@ -823,4 +823,14 @@ @Article{Lim2002
doi = {10.2307/3315868},
}

@Book{Saltelli2008,
editor = {Andrea Saltelli and Karen Chan and Evelyn Marian Scott},
publisher = {John Wiley & Sons},
title = {Sensitivity analysis},
year = {2008},
address = {Hoboken, NJ},
isbn = {9780470743829},
series = {Wiley Series in Probability and Statistics},
}

@Comment{jabref-meta: databaseType:bibtex;}
1 change: 1 addition & 0 deletions docs/test-functions/available.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ regardless of their typical applications.
| {ref}`Simple Portfolio Model <test-functions:portfolio-3d>` | 3 | `Portfolio3D()` |
| {ref}`RS - Circular Bar <test-functions:rs-circular-bar>` | 2 | `RSCircularBar()` |
| {ref}`RS - Quadratic <test-functions:rs-quadratic>` | 2 | `RSQuadratic()` |
| {ref}`SaltelliLinear <test-functions:saltelli-linear>` | M | `SaltelliLinear()` |
| {ref}`Sobol'-G <test-functions:sobol-g>` | M | `SobolG()` |
| {ref}`Speed Reducer Shaft <test-functions:speed-reducer-shaft>` | 5 | `SpeedReducerShaft()` |
| {ref}`Sulfur <test-functions:sulfur>` | 9 | `Sulfur()` |
Expand Down
6 changes: 3 additions & 3 deletions docs/test-functions/ishigami.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ analytical values.
:tags: [hide-input]
# --- Compute the mean and variance estimate
np.random.seed(42)
my_testfun.prob_input.reset_rng(42)
sample_sizes = np.array([1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7], dtype=int)
mean_estimates = np.empty(len(sample_sizes))
var_estimates = np.empty(len(sample_sizes))
Expand All @@ -160,7 +160,7 @@ ax_1.errorbar(
label="Mean"
)
# Plot the analytical mean
a = my_testfun.parameters[0]
a = my_testfun.parameters["a"]
mean_analytical = a / 2.0
ax_1.plot(
sample_sizes,
Expand All @@ -185,7 +185,7 @@ ax_2.errorbar(
label="Variance",
)
# Plot the analytical variance
b = my_testfun.parameters[1]
b = my_testfun.parameters["b"]
var_analytical = a**2 / 8 + b * np.pi**4 / 5 + b**2 * np.pi**8 / 18 + 0.5
ax_2.plot(
sample_sizes,
Expand Down
Loading

0 comments on commit 25f61f7

Please sign in to comment.