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: ExtendedKalmanFilter
25 .. _section_ref_algorithm_ExtendedKalmanFilter:
27 Calculation algorithm "*ExtendedKalmanFilter*"
28 ----------------------------------------------
30 .. ------------------------------------ ..
31 .. include:: snippets/Header2Algo01.rst
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
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 :
47 .. _schema_temporel_EKF:
48 .. figure:: images/schema_temporel_KF.png
52 **Timeline of steps in extended Kalman filter data assimilation**
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.
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.
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`.
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
83 .. ------------------------------------ ..
84 .. include:: snippets/Header2Algo12.rst
86 .. include:: snippets/FeaturePropLocalOptimization.rst
88 .. include:: snippets/FeaturePropDerivativeNeeded.rst
90 .. include:: snippets/FeaturePropParallelDerivativesOnly.rst
92 .. ------------------------------------ ..
93 .. include:: snippets/Header2Algo02.rst
95 .. include:: snippets/Background.rst
97 .. include:: snippets/BackgroundError.rst
99 .. include:: snippets/EvolutionError.rst
101 .. include:: snippets/EvolutionModel.rst
103 .. include:: snippets/Observation.rst
105 .. include:: snippets/ObservationError.rst
107 .. include:: snippets/ObservationOperator.rst
109 .. ------------------------------------ ..
110 .. include:: snippets/Header2Algo03AdOp.rst
112 .. include:: snippets/BoundsWithNone.rst
114 .. include:: snippets/ConstrainedBy.rst
116 .. include:: snippets/EstimationOf_State.rst
118 StoreSupplementaryCalculations
119 .. index:: single: StoreSupplementaryCalculations
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
132 "APosterioriCorrelations",
133 "APosterioriCovariance",
134 "APosterioriStandardDeviations",
135 "APosterioriVariances",
138 "CostFunctionJAtCurrentOptimum",
140 "CostFunctionJbAtCurrentOptimum",
142 "CostFunctionJoAtCurrentOptimum",
143 "CurrentIterationNumber",
146 "ForecastCovariance",
149 "InnovationAtCurrentAnalysis",
150 "InnovationAtCurrentState",
151 "SimulatedObservationAtCurrentAnalysis",
152 "SimulatedObservationAtCurrentOptimum",
153 "SimulatedObservationAtCurrentState",
157 ``{"StoreSupplementaryCalculations":["CurrentState", "Residu"]}``
159 .. include:: snippets/Variant_EKF.rst
161 .. ------------------------------------ ..
162 .. include:: snippets/Header2Algo04.rst
164 .. include:: snippets/Analysis.rst
166 .. ------------------------------------ ..
167 .. include:: snippets/Header2Algo05.rst
169 .. include:: snippets/Analysis.rst
171 .. include:: snippets/APosterioriCorrelations.rst
173 .. include:: snippets/APosterioriCovariance.rst
175 .. include:: snippets/APosterioriStandardDeviations.rst
177 .. include:: snippets/APosterioriVariances.rst
179 .. include:: snippets/BMA.rst
181 .. include:: snippets/CostFunctionJ.rst
183 .. include:: snippets/CostFunctionJAtCurrentOptimum.rst
185 .. include:: snippets/CostFunctionJb.rst
187 .. include:: snippets/CostFunctionJbAtCurrentOptimum.rst
189 .. include:: snippets/CostFunctionJo.rst
191 .. include:: snippets/CostFunctionJoAtCurrentOptimum.rst
193 .. include:: snippets/CurrentIterationNumber.rst
195 .. include:: snippets/CurrentOptimum.rst
197 .. include:: snippets/CurrentState.rst
199 .. include:: snippets/ForecastCovariance.rst
201 .. include:: snippets/ForecastState.rst
203 .. include:: snippets/IndexOfOptimum.rst
205 .. include:: snippets/InnovationAtCurrentAnalysis.rst
207 .. include:: snippets/InnovationAtCurrentState.rst
209 .. include:: snippets/SimulatedObservationAtCurrentAnalysis.rst
211 .. include:: snippets/SimulatedObservationAtCurrentOptimum.rst
213 .. include:: snippets/SimulatedObservationAtCurrentState.rst
215 .. ------------------------------------ ..
216 .. _section_ref_algorithm_ExtendedKalmanFilter_examples:
218 .. include:: snippets/Header2Algo06.rst
220 - :ref:`section_ref_algorithm_KalmanFilter`
221 - :ref:`section_ref_algorithm_EnsembleKalmanFilter`
222 - :ref:`section_ref_algorithm_UnscentedKalmanFilter`
224 .. ------------------------------------ ..
225 .. include:: snippets/Header2Algo07.rst