From 09c197b209f111093a3a2c4014f834c29b7344c0 Mon Sep 17 00:00:00 2001 From: Julien Schueller Date: Tue, 8 Oct 2024 18:35:11 +0200 Subject: [PATCH] Split examples --- README.md | 81 ++----------------- .../README.txt | 0 .../plot_compute_reference_rp55_pf.py | 0 .../plot_print_reliability_benchmark.py | 0 .../methods}/plot_reliability_benchmark.py | 0 .../plot_reliability_benchmark_table.py | 0 ...lot_reliability_compute_reference_proba.py | 0 .../problems}/plot_case_rs.py | 0 .../plot_four_branch_serial_system_waarts.py | 0 .../problems}/plot_rp110.py | 0 .../problems}/plot_rp111.py | 0 .../problems}/plot_rp22.py | 0 .../problems}/plot_rp24.py | 0 .../problems}/plot_rp25.py | 0 .../problems}/plot_rp28.py | 0 .../problems}/plot_rp31.py | 0 .../problems}/plot_rp33.py | 0 .../problems}/plot_rp35.py | 0 .../problems}/plot_rp53.py | 0 .../problems}/plot_rp55.py | 0 .../problems}/plot_rp57.py | 0 .../problems}/plot_rp75.py | 0 .../problems}/plot_rp8.py | 0 .../problems}/plot_rp89.py | 0 .../README.txt | 0 .../plot_benchmark_sensitivity_methods.py | 0 .../methods}/plot_convergence_ishigami.py | 0 .../methods}/plot_print_problems.py | 0 .../plot_sensitivity_distribution_ishigami.py | 0 .../problems}/plot_borehole_sensitivity.py | 0 .../problems}/plot_borgonovo_sensitivity.py | 0 .../problems}/plot_dirichlet_sensitivity.py | 0 .../problems}/plot_flood_sensitivity.py | 0 .../plot_gaussian_product_sensitivity.py | 0 .../problems}/plot_gaussian_sum.py | 0 .../problems}/plot_gsobol_sensitivity.py | 0 .../problems}/plot_ishigami_sensitivity.py | 0 .../problems}/plot_morris_sensitivity.py | 0 .../plot_nloscillator_sensitivity.py | 0 .../plot_oakleyohagan_sensitivity.py | 0 otbenchmark/_AxialStressedBeamReliability.py | 6 -- otbenchmark/_DirichletSensitivity.py | 12 +-- otbenchmark/_OakleyOHaganSensitivity.py | 4 +- otbenchmark/_ReliabilityProblem33.py | 11 +-- 44 files changed, 19 insertions(+), 95 deletions(-) rename doc/examples/{reliability_problems => reliability}/README.txt (100%) rename doc/examples/{reliability_problems => reliability/methods}/plot_compute_reference_rp55_pf.py (100%) rename doc/examples/{reliability_problems => reliability/methods}/plot_print_reliability_benchmark.py (100%) rename doc/examples/{reliability_problems => reliability/methods}/plot_reliability_benchmark.py (100%) rename doc/examples/{reliability_problems => reliability/methods}/plot_reliability_benchmark_table.py (100%) rename doc/examples/{reliability_problems => reliability/methods}/plot_reliability_compute_reference_proba.py (100%) rename doc/examples/{reliability_problems => reliability/problems}/plot_case_rs.py (100%) rename doc/examples/{reliability_problems => reliability/problems}/plot_four_branch_serial_system_waarts.py (100%) rename doc/examples/{reliability_problems => reliability/problems}/plot_rp110.py (100%) rename doc/examples/{reliability_problems => reliability/problems}/plot_rp111.py (100%) rename doc/examples/{reliability_problems => reliability/problems}/plot_rp22.py (100%) rename doc/examples/{reliability_problems => reliability/problems}/plot_rp24.py (100%) rename doc/examples/{reliability_problems => reliability/problems}/plot_rp25.py (100%) rename doc/examples/{reliability_problems => reliability/problems}/plot_rp28.py (100%) rename doc/examples/{reliability_problems => reliability/problems}/plot_rp31.py (100%) rename doc/examples/{reliability_problems => reliability/problems}/plot_rp33.py (100%) rename doc/examples/{reliability_problems => reliability/problems}/plot_rp35.py (100%) rename doc/examples/{reliability_problems => reliability/problems}/plot_rp53.py (100%) rename doc/examples/{reliability_problems => reliability/problems}/plot_rp55.py (100%) rename doc/examples/{reliability_problems => reliability/problems}/plot_rp57.py (100%) rename doc/examples/{reliability_problems => reliability/problems}/plot_rp75.py (100%) rename doc/examples/{reliability_problems => reliability/problems}/plot_rp8.py (100%) rename doc/examples/{reliability_problems => reliability/problems}/plot_rp89.py (100%) rename doc/examples/{sensitivity_problems => sensitivity}/README.txt (100%) rename doc/examples/{sensitivity_problems => sensitivity/methods}/plot_benchmark_sensitivity_methods.py (100%) rename doc/examples/{sensitivity_problems => sensitivity/methods}/plot_convergence_ishigami.py (100%) rename doc/examples/{sensitivity_problems => sensitivity/methods}/plot_print_problems.py (100%) rename doc/examples/{sensitivity_problems => sensitivity/methods}/plot_sensitivity_distribution_ishigami.py (100%) rename doc/examples/{sensitivity_problems => sensitivity/problems}/plot_borehole_sensitivity.py (100%) rename doc/examples/{sensitivity_problems => sensitivity/problems}/plot_borgonovo_sensitivity.py (100%) rename doc/examples/{sensitivity_problems => sensitivity/problems}/plot_dirichlet_sensitivity.py (100%) rename doc/examples/{sensitivity_problems => sensitivity/problems}/plot_flood_sensitivity.py (100%) rename doc/examples/{sensitivity_problems => sensitivity/problems}/plot_gaussian_product_sensitivity.py (100%) rename doc/examples/{sensitivity_problems => sensitivity/problems}/plot_gaussian_sum.py (100%) rename doc/examples/{sensitivity_problems => sensitivity/problems}/plot_gsobol_sensitivity.py (100%) rename doc/examples/{sensitivity_problems => sensitivity/problems}/plot_ishigami_sensitivity.py (100%) rename doc/examples/{sensitivity_problems => sensitivity/problems}/plot_morris_sensitivity.py (100%) rename doc/examples/{sensitivity_problems => sensitivity/problems}/plot_nloscillator_sensitivity.py (100%) rename doc/examples/{sensitivity_problems => sensitivity/problems}/plot_oakleyohagan_sensitivity.py (100%) diff --git a/README.md b/README.md index 710868a..87db679 100644 --- a/README.md +++ b/README.md @@ -17,27 +17,12 @@ the output of a function is less than a threshold, * sensitivity problems, i.e. estimating sensitivity indices, for example Sobol' indices. -Most of the reliability problems were adapted from the RPRepo : +Most of the reliability problems were adapted from the RPRepo: https://rprepo.readthedocs.io/en/latest/ This module allows you to create a problem, run an algorithm and compare the computed probability with a reference probability: - -``` -problem = otb.RminusSReliability() -event = problem.getEvent() -pfReference = problem.getProbability() # exact probability -# Create the Monte-Carlo algorithm -algoProb = ot.ProbabilitySimulationAlgorithm(event) -algoProb.setMaximumOuterSampling(1000) -algoProb.setMaximumCoefficientOfVariation(0.01) -algoProb.run() -resultAlgo = algoProb.getResult() -pf = resultAlgo.getProbabilityEstimate() -absoluteError = abs(pf - pfReference) -``` - Moreover, we can loop over all problems and run several methods on these problems. @@ -50,71 +35,15 @@ problems. ## Installation -To install the module, we can use the "git clone" command: +To install the module, we can use either pip or conda: ``` -git clone https://github.com/mbaudin47/otbenchmark.git -cd otbenchmark -python setup.py install +pip install otbenchmark ``` -## Getting help - -The code has docstrings. Hence, using the "help" statement will help. Another way of getting help is to read the examples, which are presented in the next section. - -## Overview of the benchmark problems - -[Analysis of the R-S case]: https://github.com/mbaudin47/otbenchmark/blob/master/examples/reliability_problems/Cas-R-S.ipynb - -[Benchmark the G-Sobol test function]: https://github.com/mbaudin47/otbenchmark/blob/master/examples/sensitivity_problems/GSobolSensitivity.ipynb - -[Reliability factories]: https://github.com/mbaudin47/otbenchmark/blob/master/examples/methodFactory.ipynb - -[Benchmark on a given set of problems]: https://github.com/mbaudin47/otbenchmark/blob/master/examples/reliability_benchmark.ipynb - -[Benchmark the reliability solvers on the problems]: https://github.com/mbaudin47/otbenchmark/blob/master/examples/reliability_benchmark_table.ipynb - -[Check reference probabilities with Monte-Carlo]: https://github.com/mbaudin47/otbenchmark/blob/master/examples/reliability_compute_reference_proba.ipynb - -The simplest use cas of the library is in [Analysis of the R-S case], which shows how to use this problem with two variables to estimate its failure probability. In the [Benchmark the G-Sobol test function] problem, we show how to estimate sensitivity indices on the G-Sobol' test function. When using a reliability problem, it is convenient to create a given algorithm, e.g. Subset sampling, based on a given problem: the [Reliability factories] shows how to do this for Monte-Carlo, FORM, SORM, Subset and FORM-importance sampling. - -The library currently has: -* 26 reliability problems, -* 11 sensitivity problems. - -One of the most useful feature of the library is to perform a benchmark that is, loop over the problems. In [Benchmark on a given set of problems], we run several algorithms on all the problems. The associated statistics are gathered in table, presented in [Benchmark the reliability solvers on the problems]. In [Check reference probabilities with Monte-Carlo], we compare the exact (reference) probability with a Monte-Carlo estimate with a large sample. - -[Draw events]: https://github.com/mbaudin47/otbenchmark/blob/master/examples/DrawEvent_demo.ipynb -[Draw cross cut of functions]: https://github.com/mbaudin47/otbenchmark/blob/master/examples/CrossCutFunction_Demo.ipynb -[Draw cross cuts of distributions]: https://github.com/mbaudin47/otbenchmark/blob/master/examples/CrossCutDistribution-3D_Demo.ipynb -[Draw conditional distributions]: https://github.com/mbaudin47/otbenchmark/blob/master/examples/ConditionalDistribution_Demo.ipynb - -It is often useful to draw a sensitivity or reliability problem. Since many of these problems have dimensions larger than two, this raises a number of practical issues. -* Event: [Draw events] shows how to draw an multidimensional event, -* Function: [Draw cross cut of functions] shows how to draw cross cuts of functions, -* Distribution: [Draw cross cuts of distributions] shows how to draw cross cuts of distributions and [Draw conditional distributions] plots conditional distributions. - -The "DrawEvent" class that the module provides typically plots the following figure for the RP57. - -![limit_state_surface_RP57.png](figures/limit_state_surface_RP57.png) - -The following figure plots cross-cuts of the limit state function for the RP8. - -![cross_cut_function_RP8.png](figures/cross_cut_function_RP8.png) - -[Examples]: https://github.com/mbaudin47/otbenchmark/tree/master/examples - -[BBRC]: https://github.com/mbaudin47/otbenchmark/blob/master/examples-on-server/BBRC.ipynb - -[Convergence of Monte-Carlo to estimate the probability in a reliability problem]: https://github.com/mbaudin47/otbenchmark/blob/master/examples/convergence-reliability-Monte-Carlo.ipynb - -The [Convergence of Monte-Carlo to estimate the probability in a reliability problem] example might be interesting for those who want to plot convergence graphics. - -![convergence_montecarlo.png](figures/convergence_montecarlo.png) - -We provide in [BBRC] an example which shows how to use the "evaluate" function that the module provides to evaluate a function which is available in the remote BBRC server. +## Documentation -The [Examples] directory has many other examples: please read the notebooks and see if one of the examples fits your needs. +The documentation is available here: https://openturns.github.io/otbenchmark/master/ ## TODO-List diff --git a/doc/examples/reliability_problems/README.txt b/doc/examples/reliability/README.txt similarity index 100% rename from doc/examples/reliability_problems/README.txt rename to doc/examples/reliability/README.txt diff --git a/doc/examples/reliability_problems/plot_compute_reference_rp55_pf.py b/doc/examples/reliability/methods/plot_compute_reference_rp55_pf.py similarity index 100% rename from doc/examples/reliability_problems/plot_compute_reference_rp55_pf.py rename to doc/examples/reliability/methods/plot_compute_reference_rp55_pf.py diff --git a/doc/examples/reliability_problems/plot_print_reliability_benchmark.py b/doc/examples/reliability/methods/plot_print_reliability_benchmark.py similarity index 100% rename from doc/examples/reliability_problems/plot_print_reliability_benchmark.py rename to doc/examples/reliability/methods/plot_print_reliability_benchmark.py diff --git a/doc/examples/reliability_problems/plot_reliability_benchmark.py b/doc/examples/reliability/methods/plot_reliability_benchmark.py similarity index 100% rename from doc/examples/reliability_problems/plot_reliability_benchmark.py rename to doc/examples/reliability/methods/plot_reliability_benchmark.py diff --git a/doc/examples/reliability_problems/plot_reliability_benchmark_table.py b/doc/examples/reliability/methods/plot_reliability_benchmark_table.py similarity index 100% rename from doc/examples/reliability_problems/plot_reliability_benchmark_table.py rename to doc/examples/reliability/methods/plot_reliability_benchmark_table.py diff --git a/doc/examples/reliability_problems/plot_reliability_compute_reference_proba.py b/doc/examples/reliability/methods/plot_reliability_compute_reference_proba.py similarity index 100% rename from doc/examples/reliability_problems/plot_reliability_compute_reference_proba.py rename to doc/examples/reliability/methods/plot_reliability_compute_reference_proba.py diff --git a/doc/examples/reliability_problems/plot_case_rs.py b/doc/examples/reliability/problems/plot_case_rs.py similarity index 100% rename from doc/examples/reliability_problems/plot_case_rs.py rename to doc/examples/reliability/problems/plot_case_rs.py diff --git a/doc/examples/reliability_problems/plot_four_branch_serial_system_waarts.py b/doc/examples/reliability/problems/plot_four_branch_serial_system_waarts.py similarity index 100% rename from doc/examples/reliability_problems/plot_four_branch_serial_system_waarts.py rename to doc/examples/reliability/problems/plot_four_branch_serial_system_waarts.py diff --git a/doc/examples/reliability_problems/plot_rp110.py b/doc/examples/reliability/problems/plot_rp110.py similarity index 100% rename from doc/examples/reliability_problems/plot_rp110.py rename to doc/examples/reliability/problems/plot_rp110.py diff --git a/doc/examples/reliability_problems/plot_rp111.py b/doc/examples/reliability/problems/plot_rp111.py similarity index 100% rename from doc/examples/reliability_problems/plot_rp111.py rename to doc/examples/reliability/problems/plot_rp111.py diff --git a/doc/examples/reliability_problems/plot_rp22.py b/doc/examples/reliability/problems/plot_rp22.py similarity index 100% rename from doc/examples/reliability_problems/plot_rp22.py rename to doc/examples/reliability/problems/plot_rp22.py diff --git a/doc/examples/reliability_problems/plot_rp24.py b/doc/examples/reliability/problems/plot_rp24.py similarity index 100% rename from doc/examples/reliability_problems/plot_rp24.py rename to doc/examples/reliability/problems/plot_rp24.py diff --git a/doc/examples/reliability_problems/plot_rp25.py b/doc/examples/reliability/problems/plot_rp25.py similarity index 100% rename from doc/examples/reliability_problems/plot_rp25.py rename to doc/examples/reliability/problems/plot_rp25.py diff --git a/doc/examples/reliability_problems/plot_rp28.py b/doc/examples/reliability/problems/plot_rp28.py similarity index 100% rename from doc/examples/reliability_problems/plot_rp28.py rename to doc/examples/reliability/problems/plot_rp28.py diff --git a/doc/examples/reliability_problems/plot_rp31.py b/doc/examples/reliability/problems/plot_rp31.py similarity index 100% rename from doc/examples/reliability_problems/plot_rp31.py rename to doc/examples/reliability/problems/plot_rp31.py diff --git a/doc/examples/reliability_problems/plot_rp33.py b/doc/examples/reliability/problems/plot_rp33.py similarity index 100% rename from doc/examples/reliability_problems/plot_rp33.py rename to doc/examples/reliability/problems/plot_rp33.py diff --git a/doc/examples/reliability_problems/plot_rp35.py b/doc/examples/reliability/problems/plot_rp35.py similarity index 100% rename from doc/examples/reliability_problems/plot_rp35.py rename to doc/examples/reliability/problems/plot_rp35.py diff --git a/doc/examples/reliability_problems/plot_rp53.py b/doc/examples/reliability/problems/plot_rp53.py similarity index 100% rename from doc/examples/reliability_problems/plot_rp53.py rename to doc/examples/reliability/problems/plot_rp53.py diff --git a/doc/examples/reliability_problems/plot_rp55.py b/doc/examples/reliability/problems/plot_rp55.py similarity index 100% rename from doc/examples/reliability_problems/plot_rp55.py rename to doc/examples/reliability/problems/plot_rp55.py diff --git a/doc/examples/reliability_problems/plot_rp57.py b/doc/examples/reliability/problems/plot_rp57.py similarity index 100% rename from doc/examples/reliability_problems/plot_rp57.py rename to doc/examples/reliability/problems/plot_rp57.py diff --git a/doc/examples/reliability_problems/plot_rp75.py b/doc/examples/reliability/problems/plot_rp75.py similarity index 100% rename from doc/examples/reliability_problems/plot_rp75.py rename to doc/examples/reliability/problems/plot_rp75.py diff --git a/doc/examples/reliability_problems/plot_rp8.py b/doc/examples/reliability/problems/plot_rp8.py similarity index 100% rename from doc/examples/reliability_problems/plot_rp8.py rename to doc/examples/reliability/problems/plot_rp8.py diff --git a/doc/examples/reliability_problems/plot_rp89.py b/doc/examples/reliability/problems/plot_rp89.py similarity index 100% rename from doc/examples/reliability_problems/plot_rp89.py rename to doc/examples/reliability/problems/plot_rp89.py diff --git a/doc/examples/sensitivity_problems/README.txt b/doc/examples/sensitivity/README.txt similarity index 100% rename from doc/examples/sensitivity_problems/README.txt rename to doc/examples/sensitivity/README.txt diff --git a/doc/examples/sensitivity_problems/plot_benchmark_sensitivity_methods.py b/doc/examples/sensitivity/methods/plot_benchmark_sensitivity_methods.py similarity index 100% rename from doc/examples/sensitivity_problems/plot_benchmark_sensitivity_methods.py rename to doc/examples/sensitivity/methods/plot_benchmark_sensitivity_methods.py diff --git a/doc/examples/sensitivity_problems/plot_convergence_ishigami.py b/doc/examples/sensitivity/methods/plot_convergence_ishigami.py similarity index 100% rename from doc/examples/sensitivity_problems/plot_convergence_ishigami.py rename to doc/examples/sensitivity/methods/plot_convergence_ishigami.py diff --git a/doc/examples/sensitivity_problems/plot_print_problems.py b/doc/examples/sensitivity/methods/plot_print_problems.py similarity index 100% rename from doc/examples/sensitivity_problems/plot_print_problems.py rename to doc/examples/sensitivity/methods/plot_print_problems.py diff --git a/doc/examples/sensitivity_problems/plot_sensitivity_distribution_ishigami.py b/doc/examples/sensitivity/methods/plot_sensitivity_distribution_ishigami.py similarity index 100% rename from doc/examples/sensitivity_problems/plot_sensitivity_distribution_ishigami.py rename to doc/examples/sensitivity/methods/plot_sensitivity_distribution_ishigami.py diff --git a/doc/examples/sensitivity_problems/plot_borehole_sensitivity.py b/doc/examples/sensitivity/problems/plot_borehole_sensitivity.py similarity index 100% rename from doc/examples/sensitivity_problems/plot_borehole_sensitivity.py rename to doc/examples/sensitivity/problems/plot_borehole_sensitivity.py diff --git a/doc/examples/sensitivity_problems/plot_borgonovo_sensitivity.py b/doc/examples/sensitivity/problems/plot_borgonovo_sensitivity.py similarity index 100% rename from doc/examples/sensitivity_problems/plot_borgonovo_sensitivity.py rename to doc/examples/sensitivity/problems/plot_borgonovo_sensitivity.py diff --git a/doc/examples/sensitivity_problems/plot_dirichlet_sensitivity.py b/doc/examples/sensitivity/problems/plot_dirichlet_sensitivity.py similarity index 100% rename from doc/examples/sensitivity_problems/plot_dirichlet_sensitivity.py rename to doc/examples/sensitivity/problems/plot_dirichlet_sensitivity.py diff --git a/doc/examples/sensitivity_problems/plot_flood_sensitivity.py b/doc/examples/sensitivity/problems/plot_flood_sensitivity.py similarity index 100% rename from doc/examples/sensitivity_problems/plot_flood_sensitivity.py rename to doc/examples/sensitivity/problems/plot_flood_sensitivity.py diff --git a/doc/examples/sensitivity_problems/plot_gaussian_product_sensitivity.py b/doc/examples/sensitivity/problems/plot_gaussian_product_sensitivity.py similarity index 100% rename from doc/examples/sensitivity_problems/plot_gaussian_product_sensitivity.py rename to doc/examples/sensitivity/problems/plot_gaussian_product_sensitivity.py diff --git a/doc/examples/sensitivity_problems/plot_gaussian_sum.py b/doc/examples/sensitivity/problems/plot_gaussian_sum.py similarity index 100% rename from doc/examples/sensitivity_problems/plot_gaussian_sum.py rename to doc/examples/sensitivity/problems/plot_gaussian_sum.py diff --git a/doc/examples/sensitivity_problems/plot_gsobol_sensitivity.py b/doc/examples/sensitivity/problems/plot_gsobol_sensitivity.py similarity index 100% rename from doc/examples/sensitivity_problems/plot_gsobol_sensitivity.py rename to doc/examples/sensitivity/problems/plot_gsobol_sensitivity.py diff --git a/doc/examples/sensitivity_problems/plot_ishigami_sensitivity.py b/doc/examples/sensitivity/problems/plot_ishigami_sensitivity.py similarity index 100% rename from doc/examples/sensitivity_problems/plot_ishigami_sensitivity.py rename to doc/examples/sensitivity/problems/plot_ishigami_sensitivity.py diff --git a/doc/examples/sensitivity_problems/plot_morris_sensitivity.py b/doc/examples/sensitivity/problems/plot_morris_sensitivity.py similarity index 100% rename from doc/examples/sensitivity_problems/plot_morris_sensitivity.py rename to doc/examples/sensitivity/problems/plot_morris_sensitivity.py diff --git a/doc/examples/sensitivity_problems/plot_nloscillator_sensitivity.py b/doc/examples/sensitivity/problems/plot_nloscillator_sensitivity.py similarity index 100% rename from doc/examples/sensitivity_problems/plot_nloscillator_sensitivity.py rename to doc/examples/sensitivity/problems/plot_nloscillator_sensitivity.py diff --git a/doc/examples/sensitivity_problems/plot_oakleyohagan_sensitivity.py b/doc/examples/sensitivity/problems/plot_oakleyohagan_sensitivity.py similarity index 100% rename from doc/examples/sensitivity_problems/plot_oakleyohagan_sensitivity.py rename to doc/examples/sensitivity/problems/plot_oakleyohagan_sensitivity.py diff --git a/otbenchmark/_AxialStressedBeamReliability.py b/otbenchmark/_AxialStressedBeamReliability.py index 51d19bd..9b95e88 100644 --- a/otbenchmark/_AxialStressedBeamReliability.py +++ b/otbenchmark/_AxialStressedBeamReliability.py @@ -14,12 +14,6 @@ def __init__(self, threshold=0.0): Create a axial stressed beam reliability problem. The inputs are R, the Yield strength, and F, the traction load. - The event is {g(X) < threshold} where - - .. math:: - - g(R, F) = R - F/(\pi * 100.0) - We have R ~ LogNormalMuSigma() and F ~ Normal(). Parameters diff --git a/otbenchmark/_DirichletSensitivity.py b/otbenchmark/_DirichletSensitivity.py index 1ffc833..92d0d98 100644 --- a/otbenchmark/_DirichletSensitivity.py +++ b/otbenchmark/_DirichletSensitivity.py @@ -25,7 +25,7 @@ def __init__(self, alpha=ot.Point([1.0 / 2.0, 1.0 / 3.0, 1.0 / 4.0])): Parameters ---------- - alpha : ot.Point(p), optional + alpha : sequence of float, optional The coefficients of the model. Returns @@ -100,7 +100,7 @@ def ComputeIndices(alpha): return exact def __init__(self, alpha=ot.Point([1.0 / 2.0, 1.0 / 3.0, 1.0 / 4.0])): - """ + r""" Create a Dirichlet sensitivity problem. The function is defined by the equation: @@ -111,19 +111,19 @@ def __init__(self, alpha=ot.Point([1.0 / 2.0, 1.0 / 3.0, 1.0 / 4.0])): where: .. math:: - g_i(x) = alpha_i * d_i(x) + g_i(x) = \alpha_i * d_i(x) for any x in [0, 1], where d_i is the Dirichlet kernel: .. math:: - d_i(x) = (1 / sqrt(2i)) * (sin((2i + 1) pi x) / sin(pi x) - 1) + d_i(x) = \frac{1}{\sqrt(2i)} \frac{\sin((2i + 1) \pi x}{\sin(\pi x) - 1} for i=1, 2, ..., p. By continuity, we set: .. math:: - d_i(0) = 1 / sqrt(2i) for i=1, 2, ..., p. + d_i(0) = i\frac{1}{\sqrt(2i)} for i=1, 2, ..., p. The Dirichlet kernel has the properties: @@ -135,7 +135,7 @@ def __init__(self, alpha=ot.Point([1.0 / 2.0, 1.0 / 3.0, 1.0 / 4.0])): Parameters ---------- - alpha : ot.Point(p) + alpha : sequence of float The vector of coefficients. Examples diff --git a/otbenchmark/_OakleyOHaganSensitivity.py b/otbenchmark/_OakleyOHaganSensitivity.py index 2e33752..d67e15f 100644 --- a/otbenchmark/_OakleyOHaganSensitivity.py +++ b/otbenchmark/_OakleyOHaganSensitivity.py @@ -12,7 +12,7 @@ class OakleyOHaganSensitivity(SensitivityBenchmarkProblem): """Class to define a Oakley-O'Hagan sensitivity benchmark problem.""" def __init__(self): - """ + r""" Create a Oakley-O'Hagan sensitivity problem. The function is defined by the equation: @@ -20,7 +20,7 @@ def __init__(self): .. math:: g(x) = x'Mx+a1'x + a2' sin(x) + a3'cos(x) - where x1, ..., x15 ~ N(0, 1). + where :math:`x_1, \hdots, x_{15} \tilde N(0, 1)` The input random variables are independent. diff --git a/otbenchmark/_ReliabilityProblem33.py b/otbenchmark/_ReliabilityProblem33.py index 28de850..19ce486 100644 --- a/otbenchmark/_ReliabilityProblem33.py +++ b/otbenchmark/_ReliabilityProblem33.py @@ -20,15 +20,16 @@ def __init__( """ Creates a reliability problem RP33. - The event is {g(X) < threshold} where + The limit-state g is defined by: - g(x1, x2, x3) = min(g1, g2) with + g(x1, x2, x3) = min(g1, g2) with - g1 = -x1 - x2 - x3 + 3 * sqrt(3) + g1 = -x1 - x2 - x3 + 3 * sqrt(3) - g2 = -x3 + 3 + g2 = -x3 + 3 + + We have: - We have : x1 ~ Normal(mu[0], sigma[0]) x2 ~ Normal(mu[1], sigma[1])