Salome HOME
Documentation update with features and review corrections
[modules/adao.git] / doc / en / ref_algorithm_ExtendedKalmanFilter.rst
1 ..
2    Copyright (C) 2008-2024 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: ExtendedKalmanFilter
25 .. _section_ref_algorithm_ExtendedKalmanFilter:
26
27 Calculation algorithm "*ExtendedKalmanFilter*"
28 ----------------------------------------------
29
30 .. ------------------------------------ ..
31 .. include:: snippets/Header2Algo01.rst
32
33 This algorithm realizes an estimation of the state of a dynamic system by a
34 extended Kalman Filter, using a non-linear calculation of the state observation
35 and incremental evolution (process). Technically, the estimation of the state
36 is performed by the classical Kalman filter equations, using at each step the
37 Jacobian obtained by linearization of the observation and the evolution to
38 evaluate the state error covariance. This algorithm is therefore more expensive
39 than the linear Kalman Filter, but it is by nature better adapted as soon as
40 the operators are non-linear, being by principle universally recommended in
41 this case.
42
43 Conceptually, we can represent the temporal pattern of action of the evolution
44 and observation operators in this algorithm in the following way, with **x**
45 the state, **P** the state error covariance, *t* the discrete iterative time :
46
47   .. _schema_temporel_EKF:
48   .. figure:: images/schema_temporel_KF.png
49     :align: center
50     :width: 100%
51
52     **Timeline of steps in extended Kalman filter data assimilation**
53
54 In this scheme, the analysis **(x,P)** is obtained by means of the
55 "*correction*" by observing the "*prediction*" of the previous state. We notice
56 that there is no analysis performed at the initial time step (numbered 0 in the
57 time indexing) because there is no forecast at this time (the background is
58 stored as a pseudo analysis at the initial time step). If the observations are
59 provided in series by the user, the first one is therefore not used.
60
61 This filter can also be used to estimate (jointly or solely) parameters and not
62 the state, in which case neither the time nor the evolution have any meaning.
63 The iteration steps are then linked to the insertion of a new observation in
64 the recursive estimation. One should consult the section
65 :ref:`section_theory_dynamic` for the implementation concepts.
66
67 In case of more pronounced non-linear operators, one can easily use a
68 :ref:`section_ref_algorithm_EnsembleKalmanFilter` or a
69 :ref:`section_ref_algorithm_UnscentedKalmanFilter`, which are often far more
70 adapted to non-linear behavior but sometimes costly. One can verify the
71 linearity of the operators with the help of a
72 :ref:`section_ref_algorithm_LinearityTest`.
73
74 .. index::
75     pair: Variant ; EKF
76     pair: Variant ; CEKF
77
78 The extended Kalman filter can take into account bounds on the states (the
79 variant is named "CEKF", it is recommended and is used by default), or
80 conducted without any constraint (the variant is named "EKF", and it is not
81 recommended).
82
83 .. ------------------------------------ ..
84 .. include:: snippets/Header2Algo12.rst
85
86 .. include:: snippets/FeaturePropLocalOptimization.rst
87
88 .. include:: snippets/FeaturePropDerivativeNeeded.rst
89
90 .. include:: snippets/FeaturePropParallelDerivativesOnly.rst
91
92 .. ------------------------------------ ..
93 .. include:: snippets/Header2Algo02.rst
94
95 .. include:: snippets/Background.rst
96
97 .. include:: snippets/BackgroundError.rst
98
99 .. include:: snippets/EvolutionError.rst
100
101 .. include:: snippets/EvolutionModel.rst
102
103 .. include:: snippets/Observation.rst
104
105 .. include:: snippets/ObservationError.rst
106
107 .. include:: snippets/ObservationOperator.rst
108
109 .. ------------------------------------ ..
110 .. include:: snippets/Header2Algo03AdOp.rst
111
112 .. include:: snippets/BoundsWithNone.rst
113
114 .. include:: snippets/ConstrainedBy.rst
115
116 .. include:: snippets/EstimationOf_State.rst
117
118 StoreSupplementaryCalculations
119   .. index:: single: StoreSupplementaryCalculations
120
121   *List of names*. This list indicates the names of the supplementary
122   variables, that can be available during or at the end of the algorithm, if
123   they are initially required by the user. Their availability involves,
124   potentially, costly calculations or memory consumptions. The default is then
125   a void list, none of these variables being calculated and stored by default
126   (excepted the unconditional variables). The possible names are in the
127   following list (the detailed description of each named variable is given in
128   the following part of this specific algorithmic documentation, in the
129   sub-section "*Information and variables available at the end of the
130   algorithm*"): [
131   "Analysis",
132   "APosterioriCorrelations",
133   "APosterioriCovariance",
134   "APosterioriStandardDeviations",
135   "APosterioriVariances",
136   "BMA",
137   "CostFunctionJ",
138   "CostFunctionJAtCurrentOptimum",
139   "CostFunctionJb",
140   "CostFunctionJbAtCurrentOptimum",
141   "CostFunctionJo",
142   "CostFunctionJoAtCurrentOptimum",
143   "CurrentIterationNumber",
144   "CurrentOptimum",
145   "CurrentState",
146   "ForecastCovariance",
147   "ForecastState",
148   "IndexOfOptimum",
149   "InnovationAtCurrentAnalysis",
150   "InnovationAtCurrentState",
151   "SimulatedObservationAtCurrentAnalysis",
152   "SimulatedObservationAtCurrentOptimum",
153   "SimulatedObservationAtCurrentState",
154   ].
155
156   Example :
157   ``{"StoreSupplementaryCalculations":["CurrentState", "Residu"]}``
158
159 .. include:: snippets/Variant_EKF.rst
160
161 .. ------------------------------------ ..
162 .. include:: snippets/Header2Algo04.rst
163
164 .. include:: snippets/Analysis.rst
165
166 .. ------------------------------------ ..
167 .. include:: snippets/Header2Algo05.rst
168
169 .. include:: snippets/Analysis.rst
170
171 .. include:: snippets/APosterioriCorrelations.rst
172
173 .. include:: snippets/APosterioriCovariance.rst
174
175 .. include:: snippets/APosterioriStandardDeviations.rst
176
177 .. include:: snippets/APosterioriVariances.rst
178
179 .. include:: snippets/BMA.rst
180
181 .. include:: snippets/CostFunctionJ.rst
182
183 .. include:: snippets/CostFunctionJAtCurrentOptimum.rst
184
185 .. include:: snippets/CostFunctionJb.rst
186
187 .. include:: snippets/CostFunctionJbAtCurrentOptimum.rst
188
189 .. include:: snippets/CostFunctionJo.rst
190
191 .. include:: snippets/CostFunctionJoAtCurrentOptimum.rst
192
193 .. include:: snippets/CurrentIterationNumber.rst
194
195 .. include:: snippets/CurrentOptimum.rst
196
197 .. include:: snippets/CurrentState.rst
198
199 .. include:: snippets/ForecastCovariance.rst
200
201 .. include:: snippets/ForecastState.rst
202
203 .. include:: snippets/IndexOfOptimum.rst
204
205 .. include:: snippets/InnovationAtCurrentAnalysis.rst
206
207 .. include:: snippets/InnovationAtCurrentState.rst
208
209 .. include:: snippets/SimulatedObservationAtCurrentAnalysis.rst
210
211 .. include:: snippets/SimulatedObservationAtCurrentOptimum.rst
212
213 .. include:: snippets/SimulatedObservationAtCurrentState.rst
214
215 .. ------------------------------------ ..
216 .. _section_ref_algorithm_ExtendedKalmanFilter_examples:
217
218 .. include:: snippets/Header2Algo06.rst
219
220 - :ref:`section_ref_algorithm_KalmanFilter`
221 - :ref:`section_ref_algorithm_EnsembleKalmanFilter`
222 - :ref:`section_ref_algorithm_UnscentedKalmanFilter`
223
224 .. ------------------------------------ ..
225 .. include:: snippets/Header2Algo07.rst
226
227 - [WikipediaEKF]_