Salome HOME
Updating copyright date information
[modules/adao.git] / doc / en / ref_algorithm_KalmanFilter.rst
1 ..
2    Copyright (C) 2008-2017 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: KalmanFilter
25 .. _section_ref_algorithm_KalmanFilter:
26
27 Calculation algorithm "*KalmanFilter*"
28 --------------------------------------
29
30 Description
31 +++++++++++
32
33 This algorithm realizes an estimation of the state of a dynamic system by a
34 Kalman Filter.
35
36 It is theoretically reserved for observation and incremental evolution operators
37 cases which are linear, even if it sometimes works in "slightly" non-linear
38 cases. One can verify the linearity of the observation operator with the help of
39 the :ref:`section_ref_algorithm_LinearityTest`.
40
41 In case of non-linearity, even slightly marked, it will be preferred the
42 :ref:`section_ref_algorithm_ExtendedKalmanFilter` or the
43 :ref:`section_ref_algorithm_UnscentedKalmanFilter`.
44
45 Optional and required commands
46 ++++++++++++++++++++++++++++++
47
48 .. index:: single: AlgorithmParameters
49 .. index:: single: Background
50 .. index:: single: BackgroundError
51 .. index:: single: Observation
52 .. index:: single: ObservationError
53 .. index:: single: ObservationOperator
54 .. index:: single: EstimationOf
55 .. index:: single: StoreSupplementaryCalculations
56
57 The general required commands, available in the editing user interface, are the
58 following:
59
60   Background
61     *Required command*. This indicates the background or initial vector used,
62     previously noted as :math:`\mathbf{x}^b`. Its value is defined as a
63     "*Vector*" or a *VectorSerie*" type object.
64
65   BackgroundError
66     *Required command*. This indicates the background error covariance matrix,
67     previously noted as :math:`\mathbf{B}`. Its value is defined as a "*Matrix*"
68     type object, a "*ScalarSparseMatrix*" type object, or a
69     "*DiagonalSparseMatrix*" type object.
70
71   Observation
72     *Required command*. This indicates the observation vector used for data
73     assimilation or optimization, previously noted as :math:`\mathbf{y}^o`. It
74     is defined as a "*Vector*" or a *VectorSerie* type object.
75
76   ObservationError
77     *Required command*. This indicates the observation error covariance matrix,
78     previously noted as :math:`\mathbf{R}`. It is defined as a "*Matrix*" type
79     object, a "*ScalarSparseMatrix*" type object, or a "*DiagonalSparseMatrix*"
80     type object.
81
82   ObservationOperator
83     *Required command*. This indicates the observation operator, previously
84     noted :math:`H`, which transforms the input parameters :math:`\mathbf{x}` to
85     results :math:`\mathbf{y}` to be compared to observations
86     :math:`\mathbf{y}^o`. Its value is defined as a "*Function*" type object or
87     a "*Matrix*" type one. In the case of "*Function*" type, different
88     functional forms can be used, as described in the section
89     :ref:`section_ref_operator_requirements`. If there is some control :math:`U`
90     included in the observation, the operator has to be applied to a pair
91     :math:`(X,U)`.
92
93 The general optional commands, available in the editing user interface, are
94 indicated in :ref:`section_ref_assimilation_keywords`. Moreover, the parameters
95 of the command "*AlgorithmParameters*" allows to choose the specific options,
96 described hereafter, of the algorithm. See
97 :ref:`section_ref_options_Algorithm_Parameters` for the good use of this
98 command.
99
100 The options of the algorithm are the following:
101
102   EstimationOf
103     This key allows to choose the type of estimation to be performed. It can be
104     either state-estimation, with a value of "State", or parameter-estimation,
105     with a value of "Parameters". The default choice is "State".
106
107     Example : ``{"EstimationOf":"Parameters"}``
108
109   StoreSupplementaryCalculations
110     This list indicates the names of the supplementary variables that can be
111     available at the end of the algorithm. It involves potentially costly
112     calculations or memory consumptions. The default is a void list, none of
113     these variables being calculated and stored by default. The possible names
114     are in the following list: ["APosterioriCorrelations",
115     "APosterioriCovariance", "APosterioriStandardDeviations",
116     "APosterioriVariances", "BMA", "CostFunctionJ", "CostFunctionJb",
117     "CostFunctionJo", "CurrentState", "Innovation"].
118
119     Example : ``{"StoreSupplementaryCalculations":["BMA", "Innovation"]}``
120
121 Information and variables available at the end of the algorithm
122 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
123
124 At the output, after executing the algorithm, there are variables and
125 information originating from the calculation. The description of
126 :ref:`section_ref_output_variables` show the way to obtain them by the method
127 named ``get`` of the variable "*ADD*" of the post-processing. The input
128 variables, available to the user at the output in order to facilitate the
129 writing of post-processing procedures, are described in the
130 :ref:`subsection_r_o_v_Inventaire`.
131
132 The unconditional outputs of the algorithm are the following:
133
134   Analysis
135     *List of vectors*. Each element is an optimal state :math:`\mathbf{x}*` in
136     optimization or an analysis :math:`\mathbf{x}^a` in data assimilation.
137
138     Example : ``Xa = ADD.get("Analysis")[-1]``
139
140 The conditional outputs of the algorithm are the following:
141
142   APosterioriCorrelations
143     *List of matrices*. Each element is an *a posteriori* error correlation
144     matrix of the optimal state.
145
146     Example : ``C = ADD.get("APosterioriCorrelations")[-1]``
147
148   APosterioriCovariance
149     *List of matrices*. Each element is an *a posteriori* error covariance
150     matrix :math:`\mathbf{A}*` of the optimal state.
151
152     Example : ``A = ADD.get("APosterioriCovariance")[-1]``
153
154   APosterioriStandardDeviations
155     *List of matrices*. Each element is an *a posteriori* error standard
156     deviation matrix of the optimal state.
157
158     Example : ``E = ADD.get("APosterioriStandardDeviations")[-1]``
159
160   APosterioriVariances
161     *List of matrices*. Each element is an *a posteriori* error variance matrix
162     of the optimal state.
163
164     Example : ``V = ADD.get("APosterioriVariances")[-1]``
165
166   BMA
167     *List of vectors*. Each element is a vector of difference between the
168     background and the optimal state.
169
170     Example : ``bma = ADD.get("BMA")[-1]``
171
172   CostFunctionJ
173     *List of values*. Each element is a value of the error function :math:`J`.
174
175     Example : ``J = ADD.get("CostFunctionJ")[:]``
176
177   CostFunctionJb
178     *List of values*. Each element is a value of the error function :math:`J^b`,
179     that is of the background difference part.
180
181     Example : ``Jb = ADD.get("CostFunctionJb")[:]``
182
183   CostFunctionJo
184     *List of values*. Each element is a value of the error function :math:`J^o`,
185     that is of the observation difference part.
186
187     Example : ``Jo = ADD.get("CostFunctionJo")[:]``
188
189   CurrentState
190     *List of vectors*. Each element is a usual state vector used during the
191     optimization algorithm procedure.
192
193     Example : ``Xs = ADD.get("CurrentState")[:]``
194
195   Innovation
196     *List of vectors*. Each element is an innovation vector, which is in static
197     the difference between the optimal and the background, and in dynamic the
198     evolution increment.
199
200     Exemple : ``d = ADD.get("Innovation")[-1]``
201
202 See also
203 ++++++++
204
205 References to other sections:
206   - :ref:`section_ref_algorithm_ExtendedKalmanFilter`
207   - :ref:`section_ref_algorithm_UnscentedKalmanFilter`