Salome HOME
Adding multi-functions input capabilities (2)
[modules/adao.git] / doc / en / ref_algorithm_ParticleSwarmOptimization.rst
index aa6f918503bd86344d796249d8ab93e9557a5557..3229547abc1d6c373d41ae2f4ecb27341d9e4c74 100644 (file)
@@ -1,5 +1,5 @@
 ..
-   Copyright (C) 2008-2017 EDF R&D
+   Copyright (C) 2008-2018 EDF R&D
 
    This file is part of SALOME ADAO module.
 
@@ -30,70 +30,33 @@ Calculation algorithm "*ParticleSwarmOptimization*"
 Description
 +++++++++++
 
-This algorithm realizes an estimation of the state of a dynamic system by
-minimization of a cost function :math:`J` by using a particle swarm. It is a
-method that doesn't use the derivatives of the cost function. It fall in the
-same category than the :ref:`section_ref_algorithm_DerivativeFreeOptimization`.
+This algorithm realizes an estimation of the state of a system by minimization
+of a cost function :math:`J` by using an evolutionary strategy of particle
+swarm. It is a method that does not use the derivatives of the cost function.
+It falls in the same category than the
+:ref:`section_ref_algorithm_DerivativeFreeOptimization` or the
+:ref:`section_ref_algorithm_DifferentialEvolution`.
 
 This is an optimization method allowing for global minimum search of a general
 error function :math:`J` of type :math:`L^1`, :math:`L^2` or :math:`L^{\infty}`,
 with or without weights. The default error function is the augmented weighted
-least squares function, classicaly used in data assimilation.
+least squares function, classically used in data assimilation.
 
 Optional and required commands
 ++++++++++++++++++++++++++++++
 
-.. index:: single: AlgorithmParameters
-.. index:: single: Background
-.. index:: single: BackgroundError
-.. index:: single: Observation
-.. index:: single: ObservationError
-.. index:: single: ObservationOperator
-.. index:: single: MaximumNumberOfSteps
-.. index:: single: MaximumNumberOfFunctionEvaluations
-.. index:: single: NumberOfInsects
-.. index:: single: SwarmVelocity
-.. index:: single: GroupRecallRate
-.. index:: single: QualityCriterion
-.. index:: single: BoxBounds
-.. index:: single: SetSeed
-.. index:: single: StoreSupplementaryCalculations
-
 The general required commands, available in the editing user interface, are the
 following:
 
-  Background
-    *Required command*. This indicates the background or initial vector used,
-    previously noted as :math:`\mathbf{x}^b`. Its value is defined as a
-    "*Vector*" or a *VectorSerie*" type object.
-
-  BackgroundError
-    *Required command*. This indicates the background error covariance matrix,
-    previously noted as :math:`\mathbf{B}`. Its value is defined as a "*Matrix*"
-    type object, a "*ScalarSparseMatrix*" type object, or a
-    "*DiagonalSparseMatrix*" type object.
-
-  Observation
-    *Required command*. This indicates the observation vector used for data
-    assimilation or optimization, previously noted as :math:`\mathbf{y}^o`. It
-    is defined as a "*Vector*" or a *VectorSerie* type object.
-
-  ObservationError
-    *Required command*. This indicates the observation error covariance matrix,
-    previously noted as :math:`\mathbf{R}`. It is defined as a "*Matrix*" type
-    object, a "*ScalarSparseMatrix*" type object, or a "*DiagonalSparseMatrix*"
-    type object.
-
-  ObservationOperator
-    *Required command*. This indicates the observation operator, previously
-    noted :math:`H`, which transforms the input parameters :math:`\mathbf{x}` to
-    results :math:`\mathbf{y}` to be compared to observations
-    :math:`\mathbf{y}^o`. Its value is defined as a "*Function*" type object or
-    a "*Matrix*" type one. In the case of "*Function*" type, different
-    functional forms can be used, as described in the section
-    :ref:`section_ref_operator_requirements`. If there is some control :math:`U`
-    included in the observation, the operator has to be applied to a pair
-    :math:`(X,U)`.
+  .. include:: snippets/Background.rst
+
+  .. include:: snippets/BackgroundError.rst
+
+  .. include:: snippets/Observation.rst
+
+  .. include:: snippets/ObservationError.rst
+
+  .. include:: snippets/ObservationOperator.rst
 
 The general optional commands, available in the editing user interface, are
 indicated in :ref:`section_ref_assimilation_keywords`. Moreover, the parameters
@@ -103,51 +66,38 @@ described hereafter, of the algorithm. See
 command.
 
 The options of the algorithm are the following:
+.. index:: single: NumberOfInsects
+.. index:: single: SwarmVelocity
+.. index:: single: GroupRecallRate
+.. index:: single: QualityCriterion
+.. index:: single: BoxBounds
 
-  MaximumNumberOfSteps
-    This key indicates the maximum number of iterations allowed for iterative
-    optimization. The default is 50, which is an arbitrary limit. It is then
-    recommended to adapt this parameter to the needs on real problems.
-
-    Example : ``{"MaximumNumberOfSteps":100}``
+  .. include:: snippets/MaximumNumberOfSteps_50.rst
 
-  MaximumNumberOfFunctionEvaluations
-    This key indicates the maximum number of evaluation of the cost function to
-    be optimized. The default is 15000, which is an arbitrary limit. It is then
-    recommended to adapt this parameter to the needs on real problems. For some
-    optimizers, the effective number of function evaluations can be slightly
-    different of the limit due to algorithm internal control requirements.
+  .. include:: snippets/MaximumNumberOfFunctionEvaluations.rst
 
-    Example : ``{"MaximumNumberOfFunctionEvaluations":50}``
+  .. include:: snippets/QualityCriterion.rst
 
   NumberOfInsects
     This key indicates the number of insects or particles in the swarm. The
     default is 100, which is a usual default for this algorithm.
 
-    Example : ``{"NumberOfInsects":100}``
+    Example :
+    ``{"NumberOfInsects":100}``
 
   SwarmVelocity
-    This key indicates the part of the insect velocity which is imposed by the 
+    This key indicates the part of the insect velocity which is imposed by the
     swarm. It is a positive floating point value. The default value is 1.
 
-    Example : ``{"SwarmVelocity":1.}``
+    Example :
+    ``{"SwarmVelocity":1.}``
 
   GroupRecallRate
     This key indicates the recall rate at the best swarm insect. It is a
     floating point value between 0 and 1. The default value is 0.5.
 
-    Example : ``{"GroupRecallRate":0.5}``
-
-  QualityCriterion
-    This key indicates the quality criterion, minimized to find the optimal
-    state estimate. The default is the usual data assimilation criterion named
-    "DA", the augmented weighted least squares. The possible criteria has to be
-    in the following list, where the equivalent names are indicated by the sign
-    "=": ["AugmentedWeightedLeastSquares"="AWLS"="DA",
-    "WeightedLeastSquares"="WLS", "LeastSquares"="LS"="L2",
-    "AbsoluteValue"="L1", "MaximumError"="ME"].
-
-    Example : ``{"QualityCriterion":"DA"}``
+    Example :
+    ``{"GroupRecallRate":0.5}``
 
   BoxBounds
     This key allows to define upper and lower bounds for *increments* on every
@@ -157,17 +107,14 @@ The options of the algorithm are the following:
     (``None`` is not allowed when there is no bound). This key is required and
     there is no default values.
 
-    Example : ``{"BoxBounds":[[-0.5,0.5], [0.01,2.], [0.,1.e99], [-1.e99,1.e99]]}``
+    Example :
+    ``{"BoxBounds":[[-0.5,0.5], [0.01,2.], [0.,1.e99], [-1.e99,1.e99]]}``
 
-  SetSeed
-    This key allow to give an integer in order to fix the seed of the random
-    generator used to generate the ensemble. A convenient value is for example
-    1000. By default, the seed is left uninitialized, and so use the default
-    initialization from the computer.
-
-    Example : ``{"SetSeed":1000}``
+  .. include:: snippets/SetSeed.rst
 
   StoreSupplementaryCalculations
+    .. index:: single: StoreSupplementaryCalculations
+
     This list indicates the names of the supplementary variables that can be
     available at the end of the algorithm. It involves potentially costly
     calculations or memory consumptions. The default is a void list, none of
@@ -177,7 +124,8 @@ The options of the algorithm are the following:
     "SimulatedObservationAtBackground", "SimulatedObservationAtCurrentState",
     "SimulatedObservationAtOptimum"].
 
-    Example : ``{"StoreSupplementaryCalculations":["BMA", "Innovation"]}``
+    Example :
+    ``{"StoreSupplementaryCalculations":["BMA", "Innovation"]}``
 
 Information and variables available at the end of the algorithm
 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@@ -192,85 +140,38 @@ writing of post-processing procedures, are described in the
 
 The unconditional outputs of the algorithm are the following:
 
-  Analysis
-    *List of vectors*. Each element is an optimal state :math:`\mathbf{x}*` in
-    optimization or an analysis :math:`\mathbf{x}^a` in data assimilation.
-
-    Example : ``Xa = ADD.get("Analysis")[-1]``
-
-  CostFunctionJ
-    *List of values*. Each element is a value of the error function :math:`J`.
-
-    Example : ``J = ADD.get("CostFunctionJ")[:]``
-
-  CostFunctionJb
-    *List of values*. Each element is a value of the error function :math:`J^b`,
-    that is of the background difference part.
+  .. include:: snippets/Analysis.rst
 
-    Example : ``Jb = ADD.get("CostFunctionJb")[:]``
+  .. include:: snippets/CostFunctionJ.rst
 
-  CostFunctionJo
-    *List of values*. Each element is a value of the error function :math:`J^o`,
-    that is of the observation difference part.
+  .. include:: snippets/CostFunctionJb.rst
 
-    Example : ``Jo = ADD.get("CostFunctionJo")[:]``
+  .. include:: snippets/CostFunctionJo.rst
 
 The conditional outputs of the algorithm are the following:
 
-  BMA
-    *List of vectors*. Each element is a vector of difference between the
-    background and the optimal state.
-
-    Example : ``bma = ADD.get("BMA")[-1]``
-
-  CurrentState
-    *List of vectors*. Each element is a usual state vector used during the
-    optimization algorithm procedure.
-
-    Example : ``Xs = ADD.get("CurrentState")[:]``
-
-  Innovation
-    *List of vectors*. Each element is an innovation vector, which is in static
-    the difference between the optimal and the background, and in dynamic the
-    evolution increment.
-
-    Example : ``d = ADD.get("Innovation")[-1]``
-
-  OMA
-    *List of vectors*. Each element is a vector of difference between the
-    observation and the optimal state in the observation space.
-
-    Example : ``oma = ADD.get("OMA")[-1]``
-
-  OMB
-    *List of vectors*. Each element is a vector of difference between the
-    observation and the background state in the observation space.
+  .. include:: snippets/BMA.rst
 
-    Example : ``omb = ADD.get("OMB")[-1]``
+  .. include:: snippets/CurrentState.rst
 
-  SimulatedObservationAtBackground
-    *List of vectors*. Each element is a vector of observation simulated from
-    the background :math:`\mathbf{x}^b`.
+  .. include:: snippets/Innovation.rst
 
-    Example : ``hxb = ADD.get("SimulatedObservationAtBackground")[-1]``
+  .. include:: snippets/OMA.rst
 
-  SimulatedObservationAtCurrentState
-    *List of vectors*. Each element is an observed vector at the current state,
-    that is, in the observation space.
+  .. include:: snippets/OMB.rst
 
-    Example : ``Ys = ADD.get("SimulatedObservationAtCurrentState")[-1]``
+  .. include:: snippets/SimulatedObservationAtBackground.rst
 
-  SimulatedObservationAtOptimum
-    *List of vectors*. Each element is a vector of observation simulated from
-    the analysis or optimal state :math:`\mathbf{x}^a`.
+  .. include:: snippets/SimulatedObservationAtCurrentState.rst
 
-    Example : ``hxa = ADD.get("SimulatedObservationAtOptimum")[-1]``
+  .. include:: snippets/SimulatedObservationAtOptimum.rst
 
 See also
 ++++++++
 
 References to other sections:
   - :ref:`section_ref_algorithm_DerivativeFreeOptimization`
+  - :ref:`section_ref_algorithm_DifferentialEvolution`
 
 Bibliographical references:
   - [WikipediaPSO]_