Salome HOME
Documentation and source correction and improvements for DFO
[modules/adao.git] / doc / en / ref_algorithm_DerivativeFreeOptimization.rst
1 ..
2    Copyright (C) 2008-2015 EDF R&D
3
4    This file is part of SALOME ADAO module.
5
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.
10
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.
15
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
19
20    See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21
22    Author: Jean-Philippe Argaud, jean-philippe.argaud@edf.fr, EDF R&D
23
24 .. index:: single: DerivativeFreeOptimization
25 .. _section_ref_algorithm_DerivativeFreeOptimization:
26
27 Calculation algorithm "*DerivativeFreeOptimization*"
28 ----------------------------------------------------
29
30 .. warning::
31
32   in its present version, this algorithm is experimental, and so changes can be
33   required in forthcoming versions.
34
35 Description
36 +++++++++++
37
38 This algorithm realizes an estimation of the state of a dynamic system by
39 minimization of a cost function :math:`J` without gradient. It is a method that
40 doesn't use the derivatives of the cost function. It fall in the same category
41 then the :ref:`section_ref_algorithm_ParticleSwarmOptimization`.
42
43 This is an optimization method allowing for global minimum search of a general
44 error function :math:`J` of type :math:`L^1`, :math:`L^2` or :math:`L^{\infty}`,
45 with or without weights. The default error function is the augmented weighted
46 least squares function, classicaly used in data assimilation.
47
48 Optional and required commands
49 ++++++++++++++++++++++++++++++
50
51 .. index:: single: AlgorithmParameters
52 .. index:: single: Background
53 .. index:: single: BackgroundError
54 .. index:: single: Observation
55 .. index:: single: ObservationError
56 .. index:: single: ObservationOperator
57 .. index:: single: Minimizer
58 .. index:: single: MaximumNumberOfSteps
59 .. index:: single: MaximumNumberOfFunctionEvaluations
60 .. index:: single: StateVariationTolerance
61 .. index:: single: CostDecrementTolerance
62 .. index:: single: QualityCriterion
63 .. index:: single: StoreSupplementaryCalculations
64
65 The general required commands, available in the editing user interface, are the
66 following:
67
68   Background
69     *Required command*. This indicates the background or initial vector used,
70     previously noted as :math:`\mathbf{x}^b`. Its value is defined as a
71     "*Vector*" or a *VectorSerie*" type object.
72
73   BackgroundError
74     *Required command*. This indicates the background error covariance matrix,
75     previously noted as :math:`\mathbf{B}`. Its value is defined as a "*Matrix*"
76     type object, a "*ScalarSparseMatrix*" type object, or a
77     "*DiagonalSparseMatrix*" type object.
78
79   Observation
80     *Required command*. This indicates the observation vector used for data
81     assimilation or optimization, previously noted as :math:`\mathbf{y}^o`. It
82     is defined as a "*Vector*" or a *VectorSerie* type object.
83
84   ObservationError
85     *Required command*. This indicates the observation error covariance matrix,
86     previously noted as :math:`\mathbf{R}`. It is defined as a "*Matrix*" type
87     object, a "*ScalarSparseMatrix*" type object, or a "*DiagonalSparseMatrix*"
88     type object.
89
90   ObservationOperator
91     *Required command*. This indicates the observation operator, previously
92     noted :math:`H`, which transforms the input parameters :math:`\mathbf{x}` to
93     results :math:`\mathbf{y}` to be compared to observations
94     :math:`\mathbf{y}^o`. Its value is defined as a "*Function*" type object or
95     a "*Matrix*" type one. In the case of "*Function*" type, different
96     functional forms can be used, as described in the section
97     :ref:`section_ref_operator_requirements`. If there is some control :math:`U`
98     included in the observation, the operator has to be applied to a pair
99     :math:`(X,U)`.
100
101 The general optional commands, available in the editing user interface, are
102 indicated in :ref:`section_ref_assimilation_keywords`. Moreover, the parameters
103 of the command "*AlgorithmParameters*" allows to choose the specific options,
104 described hereafter, of the algorithm. See
105 :ref:`section_ref_options_Algorithm_Parameters` for the good use of this
106 command.
107
108 The options of the algorithm are the following:
109
110   Minimizer
111     This key allows to choose the optimization minimizer. The default choice is
112     "POWELL", and the possible ones are "POWELL" (modified Powell unconstrained
113     minimizer, see [Powell]_), "SIMPLEX" (nonlinear constrained minimizer), "CG"
114     (simplex of Nelder-Mead unconstrained minimizer, see [Nelder]_). It is
115     recommended to stay with the default.
116
117     Example : ``{"Minimizer":"POWELL"}``
118
119   MaximumNumberOfSteps
120     This key indicates the maximum number of iterations allowed for iterative
121     optimization. The default is 15000, which is very similar to no limit on
122     iterations. It is then recommended to adapt this parameter to the needs on
123     real problems. For some optimizers, the effective stopping step can be
124     slightly different of the limit due to algorithm internal control
125     requirements.
126
127     Example : ``{"MaximumNumberOfSteps":50}``
128
129   MaximumNumberOfFunctionEvaluations
130     This key indicates the maximum number of evaluation of the cost function to
131     be optimized. The default is 15000, which is very similar to no limit on
132     iterations. The calculation can be over this limit when an outer
133     optimization loop has to be finished. It is strongly recommended to adapt
134     this parameter to the needs on real problems.
135
136     Example : ``{"MaximumNumberOfFunctionEvaluations":50}``
137
138   StateVariationTolerance
139     This key indicates the maximum relative variation of the state for stopping
140     by convergence on the state.  The default is 1.e-4, and it is recommended to
141     adapt it to the needs on real problems.
142
143     Example : ``{"StateVariationTolerance":1.e-4}``
144
145   CostDecrementTolerance
146     This key indicates a limit value, leading to stop successfully the
147     iterative optimization process when the cost function decreases less than
148     this tolerance at the last step. The default is 1.e-7, and it is
149     recommended to adapt it to the needs on real problems.
150
151     Example : ``{"CostDecrementTolerance":1.e-7}``
152
153   QualityCriterion
154     This key indicates the quality criterion, minimized to find the optimal
155     state estimate. The default is the usual data assimilation criterion named
156     "DA", the augmented weighted least squares. The possible criteria has to be
157     in the following list, where the equivalent names are indicated by the sign
158     "=": ["AugmentedWeightedLeastSquares"="AWLS"="DA",
159     "WeightedLeastSquares"="WLS", "LeastSquares"="LS"="L2",
160     "AbsoluteValue"="L1", "MaximumError"="ME"].
161
162     Example : ``{"QualityCriterion":"DA"}``
163
164   StoreSupplementaryCalculations
165     This list indicates the names of the supplementary variables that can be
166     available at the end of the algorithm. It involves potentially costly
167     calculations or memory consumptions. The default is a void list, none of
168     these variables being calculated and stored by default. The possible names
169     are in the following list: ["CurrentState", "CostFunctionJ",
170     "SimulatedObservationAtBackground", "SimulatedObservationAtCurrentState",
171     "SimulatedObservationAtOptimum"].
172
173     Example : ``{"StoreSupplementaryCalculations":["CurrentState", "CostFunctionJ"]}``
174
175 Information and variables available at the end of the algorithm
176 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
177
178 At the output, after executing the algorithm, there are variables and
179 information originating from the calculation. The description of
180 :ref:`section_ref_output_variables` show the way to obtain them by the method
181 named ``get`` of the variable "*ADD*" of the post-processing. The input
182 variables, available to the user at the output in order to facilitate the
183 writing of post-processing procedures, are described in the
184 :ref:`subsection_r_o_v_Inventaire`.
185
186 The unconditional outputs of the algorithm are the following:
187
188   Analysis
189     *List of vectors*. Each element is an optimal state :math:`\mathbf{x}*` in
190     optimization or an analysis :math:`\mathbf{x}^a` in data assimilation.
191
192     Example : ``Xa = ADD.get("Analysis")[-1]``
193
194   CostFunctionJ
195     *List of values*. Each element is a value of the error function :math:`J`.
196
197     Example : ``J = ADD.get("CostFunctionJ")[:]``
198
199   CostFunctionJb
200     *List of values*. Each element is a value of the error function :math:`J^b`,
201     that is of the background difference part.
202
203     Example : ``Jb = ADD.get("CostFunctionJb")[:]``
204
205   CostFunctionJo
206     *List of values*. Each element is a value of the error function :math:`J^o`,
207     that is of the observation difference part.
208
209     Example : ``Jo = ADD.get("CostFunctionJo")[:]``
210
211   CurrentState
212     *List of vectors*. Each element is a usual state vector used during the
213     optimization algorithm procedure.
214
215     Example : ``Xs = ADD.get("CurrentState")[:]``
216
217 The conditional outputs of the algorithm are the following:
218
219   SimulatedObservationAtBackground
220     *List of vectors*. Each element is a vector of observation simulated from
221     the background :math:`\mathbf{x}^b`.
222
223     Example : ``hxb = ADD.get("SimulatedObservationAtBackground")[-1]``
224
225   SimulatedObservationAtCurrentState
226     *List of vectors*. Each element is an observed vector at the current state,
227     that is, in the observation space.
228
229     Example : ``Ys = ADD.get("SimulatedObservationAtCurrentState")[-1]``
230
231   SimulatedObservationAtOptimum
232     *List of vectors*. Each element is a vector of observation simulated from
233     the analysis or optimal state :math:`\mathbf{x}^a`.
234
235     Example : ``hxa = ADD.get("SimulatedObservationAtOptimum")[-1]``
236
237 See also
238 ++++++++
239
240 References to other sections:
241   - :ref:`section_ref_algorithm_ParticleSwarmOptimization`
242
243 Bibliographical references:
244   - [Nelder]_
245   - [Powell]_