2 Copyright (C) 2008-2024 EDF R&D
4 This file is part of SALOME ADAO module.
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with this library; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D
24 .. index:: single: SamplingTest
25 .. _section_ref_algorithm_SamplingTest:
27 Checking algorithm "*SamplingTest*"
28 -----------------------------------
30 .. ------------------------------------ ..
31 .. include:: snippets/Header2Algo01.rst
33 This algorithm establishes the collection of values for any :math:`J` error
34 functional of type :math:`L^1`, :math:`L^2` or :math:`L^{\infty}`, with or
35 without weights, as described in the section for
36 :ref:`section_theory_optimization`. Each :math:`J` calculation is conducted
37 using the :math:`\mathcal{H}` observation operator and :math:`\mathbf{y}^o`
38 observations for a :math:`\mathbf{x}` state. The :math:`\mathbf{x}` states come
39 from a sample of states defined *a priori*. The default error functional is the
40 augmented weighted least squares functional, classically used in data
43 This test is useful for explicitly analyzing the sensitivity of the functional
44 :math:`J` to variations in the state :math:`\mathbf{x}`.
46 The sampling of the states :math:`\mathbf{x}` can be given explicitly or under
47 form of hypercubes, explicit or sampled according to classic distributions, or
48 using Latin hypercube sampling (LHS) or Sobol sequences. The computations are
49 optimized according to the computer resources available and the options
50 requested by the user. You can refer to the
51 :ref:`section_ref_sampling_requirements` for an illustration of sampling.
52 Beware of the size of the hypercube (and then to the number of computations)
53 that can be reached, it can grow quickly to be quite large. When a state is not
54 observable, a "*NaN*" value is returned.
56 It is also possible to supply a set of simulations :math:`\mathbf{y}` already
57 established elsewhere (so there's no explicit need for an operator
58 :math:`\mathcal{H}`), which are implicitly associated with a set of state
59 samples :math:`\mathbf{x}`. In this case where the set of simulations is
60 provided, it is imperative to also provide the set of states :math:`\mathbf{x}`
61 by explicit sampling, whose state order corresponds to the order of the
62 simulations :math:`\mathbf{y}`.
64 To access the calculated information, the results of the sampling or
65 simulations must be requested **explicitly** to avoid storage difficulties (if
66 no results are requested, nothing is available). One use for that, on the
67 desired variable, the final saving through "*UserPostAnalysis*" or the
68 treatment during the calculation by well suited "*observer*".
70 Note: in cases where sampling is generated, it may be useful to explicitly
71 obtain the collection of states :math:`\mathbf{x}` according to the definition
72 *a priori* without necessarily performing time-consuming calculations for the
73 functional :math:`J`. To do this, simply use this algorithm with simplified
74 calculations. For example, we can define a matrix observation operator equal to
75 the identity (square matrix of the state size), a draft and an observation
76 equal, worth 1 (vectors of the state size). Next, we set up the ADAO case with
77 this algorithm to recover the set of sampled states using the usual
78 “*CurrentState*” variable.
80 .. ------------------------------------ ..
81 .. include:: snippets/Header2Algo12.rst
83 .. include:: snippets/FeaturePropDerivativeFree.rst
85 .. include:: snippets/FeaturePropParallelAlgorithm.rst
87 .. ------------------------------------ ..
88 .. include:: snippets/Header2Algo02.rst
90 .. include:: snippets/CheckingPoint.rst
92 .. include:: snippets/BackgroundError.rst
94 .. include:: snippets/Observation.rst
96 .. include:: snippets/ObservationError.rst
98 .. include:: snippets/ObservationOperator.rst
100 .. ------------------------------------ ..
101 .. include:: snippets/Header2Algo03Chck.rst
103 .. include:: snippets/EnsembleOfSnapshots.rst
105 .. include:: snippets/QualityCriterion.rst
107 .. include:: snippets/SampleAsExplicitHyperCube.rst
109 .. include:: snippets/SampleAsIndependantRandomVariables.rst
111 .. include:: snippets/SampleAsMinMaxLatinHyperCube.rst
113 .. include:: snippets/SampleAsMinMaxSobolSequence.rst
115 .. include:: snippets/SampleAsMinMaxStepHyperCube.rst
117 .. include:: snippets/SampleAsnUplet.rst
119 .. include:: snippets/SetDebug.rst
121 .. include:: snippets/SetSeed.rst
123 StoreSupplementaryCalculations
124 .. index:: single: StoreSupplementaryCalculations
126 *List of names*. This list indicates the names of the supplementary
127 variables, that can be available during or at the end of the algorithm, if
128 they are initially required by the user. Their availability involves,
129 potentially, costly calculations or memory consumptions. The default is then
130 a void list, none of these variables being calculated and stored by default
131 (excepted the unconditional variables). The possible names are in the
132 following list (the detailed description of each named variable is given in
133 the following part of this specific algorithmic documentation, in the
134 sub-section "*Information and variables available at the end of the
140 "EnsembleOfSimulations",
143 "InnovationAtCurrentState",
144 "SimulatedObservationAtCurrentState",
148 ``{"StoreSupplementaryCalculations":["CurrentState", "Residu"]}``
150 .. ------------------------------------ ..
151 .. include:: snippets/Header2Algo04.rst
153 .. include:: snippets/CostFunctionJ.rst
155 .. include:: snippets/CostFunctionJb.rst
157 .. include:: snippets/CostFunctionJo.rst
159 .. ------------------------------------ ..
160 .. include:: snippets/Header2Algo05.rst
162 .. include:: snippets/CostFunctionJ.rst
164 .. include:: snippets/CostFunctionJb.rst
166 .. include:: snippets/CostFunctionJo.rst
168 .. include:: snippets/CurrentState.rst
170 .. include:: snippets/EnsembleOfSimulations.rst
172 .. include:: snippets/EnsembleOfStates.rst
174 .. include:: snippets/Innovation.rst
176 .. include:: snippets/InnovationAtCurrentState.rst
178 .. include:: snippets/SimulatedObservationAtCurrentState.rst
180 .. ------------------------------------ ..
181 .. _section_ref_algorithm_SamplingTest_examples:
183 .. include:: snippets/Header2Algo06.rst
185 - :ref:`section_ref_algorithm_FunctionTest`
186 - :ref:`section_ref_algorithm_LocalSensitivityTest`
188 .. ------------------------------------ ..
189 .. include:: snippets/Header2Algo08.rst
191 - OPENTURNS, see the *User guide of OPENTURNS module* in the main "*Help*" menu of SALOME platform