easykf-2.04
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros Pages
ukf_state_ndim.h
Go to the documentation of this file.
1 /* ukf_state_ndim.h
2  *
3  * Copyright (C) 2011-2014 Jeremy Fix
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 3 of the License, or (at
8  * your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18  */
19 
20 #ifndef UKF_NDIM_STATE_H
21 #define UKF_NDIM_STATE_H
22 
23 #include <gsl/gsl_linalg.h> // For the Cholesky decomposition
24 #include <gsl/gsl_math.h>
25 #include <gsl/gsl_blas.h>
26 
27 #include "ukf_types.h"
28 
29 namespace ukf
30 {
31 
36  namespace state
37  {
42  inline void ukf_init(ukf_param &p, ukf_state &s)
43  {
44  // Parameters for the sigma points of the process equation
45  p.nbSamples = 2 * p.n + 1;
46  p.lambda = p.alpha * p.alpha * (p.n + p.kpa) - p.n;
47  p.gamma = sqrt(p.n + p.lambda);
48 
49  // Parameters for the sigma points of the observation equation
50  p.nbSamplesMeasure = 4 * p.n + 1;
51  p.lambda_aug = p.alpha * p.alpha * (2*p.n + p.kpa) - 2*p.n;
52  p.gamma_aug = sqrt(2*p.n + p.lambda_aug);
53 
54  // Init the matrices used to iterate
55  s.xi = gsl_vector_alloc(p.n);
56  gsl_vector_set_zero(s.xi);
57 
58  s.xi_prediction = gsl_matrix_alloc(p.n, p.nbSamples);
59  gsl_matrix_set_zero(s.xi_prediction);
60 
61  s.xi_mean = gsl_vector_alloc(p.n);
62  gsl_vector_set_zero(s.xi_mean);
63 
64  s.Pxxi = gsl_matrix_alloc(p.n,p.n);
65  gsl_matrix_set_identity(s.Pxxi);
66  gsl_matrix_scale(s.Pxxi, p.prior_x);
67 
68  s.cholPxxi = gsl_matrix_alloc(p.n,p.n);
69  gsl_matrix_set_zero(s.cholPxxi);
70 
71  s.Pvvi = gsl_matrix_alloc(p.n,p.n);
72  s.cholPvvi = gsl_matrix_alloc(p.n,p.n);
73  p.evolution_noise->init(p,s);
74 
75  s.yi_prediction = gsl_matrix_alloc(p.no, p.nbSamplesMeasure);
76  gsl_matrix_set_zero(s.yi_prediction);
77 
78  s.yi_mean = gsl_vector_alloc(p.no);
79  gsl_vector_set_zero(s.yi_mean);
80 
81  s.ino_yi = gsl_vector_alloc(p.no);
82  gsl_vector_set_zero(s.ino_yi);
83 
84  s.Pyyi = gsl_matrix_alloc(p.no, p.no);
85  gsl_matrix_set_zero(s.Pyyi);
86 
87  s.Pnni = gsl_matrix_alloc(p.no,p.no);
88  gsl_matrix_set_identity(s.Pnni);
89  gsl_matrix_scale(s.Pnni, p.measurement_noise);
90 
91  s.Pxyi = gsl_matrix_alloc(p.n, p.no);
92  gsl_matrix_set_zero(s.Pxyi);
93 
94  s.sigmaPoint = gsl_vector_alloc(p.n);
95  gsl_vector_set_zero(s.sigmaPoint);
96 
97  s.sigmaPoints = gsl_matrix_alloc(p.n, p.nbSamples);
98  gsl_matrix_set_zero(s.sigmaPoints);
99 
100  s.sigmaPointMeasure = gsl_vector_alloc(p.n);
101  gsl_vector_set_zero(s.sigmaPoint);
102 
103  s.sigmaPointsMeasure = gsl_matrix_alloc(p.n, p.nbSamplesMeasure);
104  gsl_matrix_set_zero(s.sigmaPointsMeasure);
105 
106  // Weights used to update the statistics
107  s.wm_j = gsl_vector_alloc(p.nbSamples); // Weights used to compute the mean of the sigma points images
108  s.wc_j = gsl_vector_alloc(p.nbSamples); // Weights used to update the covariance matrices
109 
110  // Set the weights
111  gsl_vector_set(s.wm_j, 0, p.lambda / (p.n + p.lambda));
112  gsl_vector_set(s.wc_j, 0, p.lambda / (p.n + p.lambda) + (1.0 - p.alpha*p.alpha + p.beta));
113  for(int j = 1 ; j < p.nbSamples; j ++)
114  {
115  gsl_vector_set(s.wm_j, j, 1.0 / (2.0 * (p.n + p.lambda)));
116  gsl_vector_set(s.wc_j, j, 1.0 / (2.0 * (p.n + p.lambda)));
117  }
118 
119  // Set the weights
120  s.wm_aug_j = gsl_vector_alloc(p.nbSamplesMeasure); // Weights used to compute the mean of the sigma points images
121  s.wc_aug_j = gsl_vector_alloc(p.nbSamplesMeasure); // Weights used to update the covariance matrices
122  gsl_vector_set(s.wm_aug_j, 0, p.lambda_aug / (2*p.n + p.lambda_aug));
123  gsl_vector_set(s.wc_aug_j, 0, p.lambda_aug / (2*p.n + p.lambda_aug) + (1.0 - p.alpha*p.alpha + p.beta));
124  for(int j = 1 ; j < p.nbSamplesMeasure; j ++)
125  {
126  gsl_vector_set(s.wm_aug_j, j, 1.0 / (2.0 * (2*p.n + p.lambda_aug)));
127  gsl_vector_set(s.wc_aug_j, j, 1.0 / (2.0 * (2*p.n + p.lambda_aug)));
128  }
129 
130  s.Ki = gsl_matrix_alloc(p.n, p.no);
131  s.Ki_T = gsl_matrix_alloc(p.no, p.n);
132 
133  // Allocate temporary matrices
134  s.temp_n = gsl_vector_alloc(p.n);
135 
136  s.temp_n_1 = gsl_matrix_alloc(p.n,1);
137  s.temp_1_n = gsl_matrix_alloc(1,p.n);
138  s.temp_n_n = gsl_matrix_alloc(p.n, p.n);
139  s.temp_n_no = gsl_matrix_alloc(p.n, p.no);
140  s.temp_no_1 = gsl_matrix_alloc(p.no,1);
141  s.temp_1_no = gsl_matrix_alloc(1,p.no);
142  s.temp_no_no = gsl_matrix_alloc(p.no, p.no);
143  }
144 
149  inline void ukf_free(ukf_param &p, ukf_state &s)
150  {
151  gsl_vector_free(s.xi);
152  gsl_matrix_free(s.xi_prediction);
153  gsl_vector_free(s.xi_mean);
154  gsl_matrix_free(s.Pxxi);
155  gsl_matrix_free(s.cholPxxi);
156  gsl_matrix_free(s.Pvvi);
157  gsl_matrix_free(s.cholPvvi);
158 
159  gsl_matrix_free(s.yi_prediction);
160  gsl_vector_free(s.yi_mean);
161  gsl_vector_free(s.ino_yi);
162  gsl_matrix_free(s.Pyyi);
163  gsl_matrix_free(s.Pnni);
164 
165  gsl_matrix_free(s.Pxyi);
166 
167  gsl_vector_free(s.sigmaPoint);
168  gsl_matrix_free(s.sigmaPoints);
169 
170  gsl_vector_free(s.sigmaPointMeasure);
171  gsl_matrix_free(s.sigmaPointsMeasure);
172 
173  gsl_vector_free(s.wm_j);
174  gsl_vector_free(s.wc_j);
175 
176  gsl_vector_free(s.wm_aug_j);
177  gsl_vector_free(s.wc_aug_j);
178 
179  gsl_matrix_free(s.Ki);
180  gsl_matrix_free(s.Ki_T);
181 
182  gsl_vector_free(s.temp_n);
183  gsl_matrix_free(s.temp_n_1);
184  gsl_matrix_free(s.temp_1_n);
185  gsl_matrix_free(s.temp_n_n);
186 
187  gsl_matrix_free(s.temp_n_no);
188  gsl_matrix_free(s.temp_no_1);
189  gsl_matrix_free(s.temp_1_no);
190  gsl_matrix_free(s.temp_no_no);
191  }
192 
197  template <typename FunctProcess, typename FunctObservation>
198  inline void ukf_iterate(ukf_param &p, ukf_state &s, FunctProcess f, FunctObservation h, gsl_vector* yi)
199  {
200  int i,j,k;
201 
202  // ************************************************** //
203  // ************ Compute the sigma points ************ //
204  // ************************************************** //
205 
206  // 0 - Compute the Cholesky decomposition of s.Pxxi
207  gsl_matrix_memcpy(s.cholPxxi, s.Pxxi);
208  gsl_linalg_cholesky_decomp(s.cholPxxi);
209  // Set all the elements of cholPvvi strictly above the diagonal to zero
210  for(j = 0 ; j < p.n ; j++)
211  for(k = j+1 ; k < p.n ; k++)
212  gsl_matrix_set(s.cholPxxi,j,k,0.0);
213 
214  // 1- Compute the sigma points,
215  // Equation (3.170)
216  // sigmapoint_j = x_(i-1)
217  // sigmapoint_j = x_(i-1) + gamma * sqrt(P_i-1)_j for 1 <= j <= n
218  // sigmapoint_j = x_(i-1) - gamma * sqrt(P_i-1)_(j-(n+1)) for n+1 <= j <= 2n
219  gsl_matrix_set_col(s.sigmaPoints, 0, s.xi);
220  for(j = 1 ; j < p.n+1 ; ++j)
221  for(i = 0 ; i < p.n ; ++i)
222  {
223  gsl_matrix_set(s.sigmaPoints,i,j, s.xi->data[i] + p.gamma * gsl_matrix_get(s.cholPxxi, i, j-1));
224  gsl_matrix_set(s.sigmaPoints,i,j+p.n, s.xi->data[i] - p.gamma * gsl_matrix_get(s.cholPxxi, i, j-1));
225  }
226 
227  /**********************************/
228  /***** Time update equations *****/
229  /**********************************/
230 
231  // Time update equations
232  // 0 - Compute the image of the sigma points and the mean of these images
233  gsl_vector_set_zero(s.xi_mean);
234  gsl_vector_view vec_view;
235  for(j = 0 ; j < p.nbSamples ; ++j)
236  {
237  gsl_matrix_get_col(s.sigmaPoint, s.sigmaPoints, j);
238  vec_view = gsl_matrix_column(s.xi_prediction,j);
239  f(s.params, s.sigmaPoint, &vec_view.vector);
240 
241  // Update the mean, Eq (3.172)
242  for(i = 0 ; i < p.n ; ++i)
243  s.xi_mean->data[i] += s.wm_j->data[j] * gsl_matrix_get(s.xi_prediction,i,j);
244  }
245 
246  // 1 - Compute the covariance of the images and add the process noise,
247  // Equation (3.173)
248  // Warning, s.Pxxi will now hold P_xk^-
249  gsl_matrix_set_zero(s.Pxxi);
250  for(j = 0 ; j < p.nbSamples ; ++j)
251  {
252  for(i = 0 ; i < p.n ; ++i)
253  s.temp_n_1->data[i] = gsl_matrix_get(s.xi_prediction,i,j) - s.xi_mean->data[i];
254 
255  gsl_blas_dgemm(CblasNoTrans, CblasTrans, s.wc_j->data[j] , s.temp_n_1, s.temp_n_1, 0, s.temp_n_n);
256  gsl_matrix_add(s.Pxxi, s.temp_n_n);
257  }
258  // Add the covariance of the evolution noise
259  gsl_matrix_add(s.Pxxi, s.Pvvi);
260 
261  // Augment sigma points
262  // Equation 3.174
263  // First put the images of the initial sigma points
264  gsl_matrix_view mat_view;
265  mat_view = gsl_matrix_submatrix(s.sigmaPointsMeasure, 0, 0, p.n, p.nbSamples);
266  gsl_matrix_memcpy(&mat_view.matrix, s.xi_prediction);
267  // And add the additional sigma points eq. (7.56)
268  for(j = 0 ; j < p.n ; ++j)
269  {
270  for(i = 0 ; i < p.n ; ++i)
271  {
272  gsl_matrix_set(s.sigmaPointsMeasure, i, j+p.nbSamples, gsl_matrix_get(s.xi_prediction,i,0)+p.gamma_aug*gsl_matrix_get(s.cholPvvi,i,j));
273  gsl_matrix_set(s.sigmaPointsMeasure, i, j+p.nbSamples+p.n, gsl_matrix_get(s.xi_prediction,i,0)-p.gamma_aug*gsl_matrix_get(s.cholPvvi,i,j));
274  }
275  }
276 
277  // Compute the image of the sigma points through the observation equation
278  // eq (3.175)
279  gsl_vector_set_zero(s.yi_mean);
280  for(j = 0 ; j < p.nbSamplesMeasure ; ++j)
281  {
282  gsl_matrix_get_col(s.sigmaPointMeasure, s.sigmaPointsMeasure, j);
283  vec_view = gsl_matrix_column(s.yi_prediction,j);
284  h(s.sigmaPointMeasure, &vec_view.vector);
285 
286  // Update the mean , eq (3.176)
287  for(i = 0 ; i < p.no ; ++i)
288  s.yi_mean->data[i] += s.wm_aug_j->data[j] * gsl_matrix_get(s.yi_prediction,i,j);
289  }
290 
291  /*****************************************/
292  /***** Measurement update equations *****/
293  /*****************************************/
294 
295  // Compute the covariance of the observations
296  // Eq. (3.177)
297  // Initialize with the observation noise covariance
298  gsl_matrix_memcpy(s.Pyyi, s.Pnni);
299  for(j = 0 ; j < p.nbSamplesMeasure ; ++j)
300  {
301  for(i = 0 ; i < p.no ; ++i)
302  s.temp_no_1->data[i] = gsl_matrix_get(s.yi_prediction,i,j) - s.yi_mean->data[i];
303 
304  gsl_blas_dgemm(CblasNoTrans, CblasTrans, s.wc_aug_j->data[j] , s.temp_no_1, s.temp_no_1, 0, s.temp_no_no);
305  gsl_matrix_add(s.Pyyi, s.temp_no_no);
306  }
307 
308  // Compute the state/observation covariance
309  // Eq (3.178)
310  gsl_matrix_set_zero(s.Pxyi);
311  for(j = 0 ; j < p.nbSamplesMeasure ; ++j)
312  {
313  for(i = 0 ; i < p.n ; ++i)
314  s.temp_n_1->data[i] = gsl_matrix_get(s.sigmaPointsMeasure,i,j) - s.xi_mean->data[i];
315 
316  for(i = 0 ; i < p.no ; ++i)
317  s.temp_1_no->data[i] = gsl_matrix_get(s.yi_prediction,i,j) - s.yi_mean->data[i];
318 
319  gsl_blas_dgemm(CblasNoTrans, CblasNoTrans, s.wc_aug_j->data[j] , s.temp_n_1, s.temp_1_no, 0, s.temp_n_no);
320  gsl_matrix_add(s.Pxyi, s.temp_n_no);
321  }
322 
323  // Compute the Kalman gain, eq (3.179)
324  // 0- Compute the inverse of Pyyi
325  gsl_matrix_memcpy(s.temp_no_no, s.Pyyi);
326  gsl_linalg_cholesky_decomp(s.temp_no_no);
327  gsl_linalg_cholesky_invert(s.temp_no_no);
328 
329  // 1- Compute the Kalman gain
330  gsl_blas_dgemm(CblasNoTrans, CblasNoTrans, 1.0 , s.Pxyi, s.temp_no_no, 0, s.Ki);
331 
332  // Correction : correct the estimation of the state
333  // Eq. 3.180
334  // Compute the innovations
335  for(i = 0 ; i < p.no ; ++i)
336  s.ino_yi->data[i] = gsl_vector_get(yi, i) - gsl_vector_get(s.yi_mean, i);
337  gsl_vector_memcpy(s.xi, s.xi_mean);
338  gsl_blas_dgemv(CblasNoTrans, 1.0 , s.Ki, s.ino_yi, 1.0, s.xi);
339 
340  // Correction : Update the covariance matrix Pk
341  // Eq. 3.181
342  gsl_matrix_transpose_memcpy(s.Ki_T, s.Ki);
343  gsl_blas_dgemm(CblasNoTrans, CblasNoTrans, 1.0 , s.Ki, s.Pyyi, 0, s.temp_n_no);
344  gsl_blas_dgemm(CblasNoTrans, CblasNoTrans, -1.0 , s.temp_n_no, s.Ki_T, 1.0, s.Pxxi);
345 
346  // Update of the process noise
348 // switch(p.process_noise_type)
349 // {
350 // case ukf::UKF_PROCESS_FIXED:
351 // //nothing to do
352 // break;
353 // case ukf::UKF_PROCESS_RLS:
354 // gsl_matrix_memcpy(s.Pvvi, s.Pxxi);
355 // gsl_matrix_scale(s.Pvvi, 1.0/p.process_noise-1.0);
356 // gsl_matrix_memcpy(s.cholPvvi, s.Pvvi);
357 // gsl_linalg_cholesky_decomp(s.cholPvvi);
358 // for(j = 0 ; j < p.n ; j++)
359 // for(k = j+1 ; k < p.n ; k++)
360 // gsl_matrix_set(s.cholPvvi,j,k,0.0);
361 // break;
362 // default:
363 // printf("Warning : Unrecognized process noise type\n");
364 // }
365 
366 
367  }
368 
373  template <typename FunctProcess, typename FunctObservation>
374  inline void ukf_evaluate(ukf_param &p, ukf_state &s, FunctProcess f, FunctObservation h, gsl_vector* yi)
375  {
376 
377  int i,j,k;
378  // ************************************************** //
379  // ************ Compute the sigma points ************ //
380  // ************************************************** //
381 
382  // 0 - Compute the Cholesky decomposition of s.Pxxi
383  gsl_matrix_memcpy(s.cholPxxi, s.Pxxi);
384  gsl_linalg_cholesky_decomp(s.cholPxxi);
385  // Set all the elements of cholPvvi strictly above the diagonal to zero
386  for(j = 0 ; j < p.n ; j++)
387  for(k = j+1 ; k < p.n ; k++)
388  gsl_matrix_set(s.cholPxxi,j,k,0.0);
389 
390  // 1- Compute the sigma points,
391  // Equation (3.170)
392  // sigmapoint_j = x_(i-1)
393  // sigmapoint_j = x_(i-1) + gamma * sqrt(P_i-1)_j for 1 <= j <= n
394  // sigmapoint_j = x_(i-1) - gamma * sqrt(P_i-1)_(j-(n+1)) for n+1 <= j <= 2n
395  gsl_matrix_set_col(s.sigmaPoints, 0, s.xi);
396  for(j = 1 ; j < p.n+1 ; ++j)
397  for(i = 0 ; i < p.n ; ++i)
398  {
399  gsl_matrix_set(s.sigmaPoints,i,j, s.xi->data[i] + p.gamma * gsl_matrix_get(s.cholPxxi, i, j-1));
400  gsl_matrix_set(s.sigmaPoints,i,j+p.n, s.xi->data[i] - p.gamma * gsl_matrix_get(s.cholPxxi, i, j-1));
401  }
402 
403  /**********************************/
404  /***** Time update equations *****/
405  /**********************************/
406 
407  // Time update equations
408  // 0 - Compute the image of the sigma points and the mean of these images
409  gsl_vector_set_zero(s.xi_mean);
410  for(j = 0 ; j < p.nbSamples ; ++j)
411  {
412  gsl_matrix_get_col(s.sigmaPoint, s.sigmaPoints, j);
413  f(s.params, s.sigmaPoint, &gsl_matrix_column(s.xi_prediction,j).vector);
414 
415  // Update the mean, Eq (3.172)
416  for(i = 0 ; i < p.n ; ++i)
417  s.xi_mean->data[i] += s.wm_j->data[j] * gsl_matrix_get(s.xi_prediction,i,j);
418  }
419 
420  // 1 - Compute the covariance of the images and add the process noise,
421  // Equation (3.173)
422  // Warning, s.Pxxi will now hold P_xk^-
423  gsl_matrix_set_zero(s.Pxxi);
424  for(j = 0 ; j < p.nbSamples ; ++j)
425  {
426  for(i = 0 ; i < p.n ; ++i)
427  s.temp_n_1->data[i] = gsl_matrix_get(s.xi_prediction,i,j) - s.xi_mean->data[i];
428 
429  gsl_blas_dgemm(CblasNoTrans, CblasTrans, s.wc_j->data[j] , s.temp_n_1, s.temp_n_1, 0, s.temp_n_n);
430  gsl_matrix_add(s.Pxxi, s.temp_n_n);
431  }
432  // Add the covariance of the evolution noise
433  gsl_matrix_add(s.Pxxi, s.Pvvi);
434 
435  // Augment sigma points
436  // Equation 3.174
437  // First put the images of the initial sigma points
438  gsl_matrix_memcpy(&gsl_matrix_submatrix(s.sigmaPointsMeasure, 0, 0, p.n, p.nbSamples).matrix, s.xi_prediction);
439  // And add the additional sigma points eq. (7.56)
440  for(j = 0 ; j < p.n ; ++j)
441  {
442  for(i = 0 ; i < p.n ; ++i)
443  {
444  gsl_matrix_set(s.sigmaPointsMeasure, i, j+p.nbSamples, gsl_matrix_get(s.xi_prediction,i,0)+p.gamma_aug*gsl_matrix_get(s.cholPvvi,i,j));
445  gsl_matrix_set(s.sigmaPointsMeasure, i, j+p.nbSamples+p.n, gsl_matrix_get(s.xi_prediction,i,0)-p.gamma_aug*gsl_matrix_get(s.cholPvvi,i,j));
446  }
447  }
448 
449  // Compute the image of the sigma points through the observation equation
450  // eq (3.175)
451  gsl_vector_set_zero(yi);
452  for(j = 0 ; j < p.nbSamplesMeasure ; ++j)
453  {
454  gsl_matrix_get_col(s.sigmaPointMeasure, s.sigmaPointsMeasure, j);
455  h(s.sigmaPointMeasure, &gsl_matrix_column(s.yi_prediction,j).vector);
456 
457  // Update the mean , eq (3.176)
458  for(i = 0 ; i < p.no ; ++i)
459  yi->data[i] += s.wm_aug_j->data[j] * gsl_matrix_get(s.yi_prediction,i,j);
460  }
461  }
462  } // state
463 } // ukf
464 
465 
466 #endif // UKF_NDIM_STATE_H
gsl_vector * wm_aug_j
Definition: ukf_types.h:618
gsl_matrix * Ki_T
Definition: ukf_types.h:622
void init(ukf_param &p, ukf_state &s)
Definition: ukf_types.h:645
gsl_matrix * temp_n_no
Definition: ukf_types.h:629
double lambda_aug
Definition: ukf_types.h:534
gsl_matrix * sigmaPointsMeasure
Definition: ukf_types.h:613
Structure holding the matrices manipulated by the statistical linearization in the vectorial case for...
Definition: ukf_types.h:589
gsl_vector * wc_j
Definition: ukf_types.h:616
gsl_matrix * temp_n_n
Definition: ukf_types.h:625
int nbSamples
Number of sigma-points
Definition: ukf_types.h:550
gsl_matrix * yi_prediction
Definition: ukf_types.h:601
gsl_matrix * Pyyi
Definition: ukf_types.h:604
double lambda
Definition: ukf_types.h:533
int nbSamplesMeasure
Number of sigma-points
Definition: ukf_types.h:555
gsl_vector * ino_yi
Definition: ukf_types.h:603
gsl_matrix * Pxyi
Definition: ukf_types.h:607
double kpa
, is a good choice. According to van der Merwe, its value is not critical
Definition: ukf_types.h:518
gsl_matrix * Pxxi
Definition: ukf_types.h:596
double gamma
Definition: ukf_types.h:539
gsl_vector * xi_mean
Definition: ukf_types.h:595
void ukf_evaluate(ukf_param &p, ukf_state &s, FunctProcess f, FunctObservation h, gsl_vector *yi)
Evaluation of the output from the sigma points.
Definition: ukf_state_ndim.h:374
void ukf_free(ukf_param &p, ukf_state &s)
Free of memory allocation.
Definition: ukf_state_ndim.h:149
Structure holding the parameters of the statistical linearization.
Definition: ukf_types.h:513
gsl_matrix * sigmaPoints
Definition: ukf_types.h:610
gsl_vector * sigmaPointMeasure
Definition: ukf_types.h:612
gsl_matrix * cholPvvi
Definition: ukf_types.h:599
gsl_matrix * Pvvi
Definition: ukf_types.h:598
gsl_matrix * cholPxxi
Definition: ukf_types.h:597
virtual void updateEvolutionNoise(ukf_param &p, ukf_state &s)=0
gsl_vector * params
Definition: ukf_types.h:591
EvolutionNoise * evolution_noise
Type of process noise.
Definition: ukf_types.h:570
gsl_vector * xi
Definition: ukf_types.h:593
gsl_vector * yi_mean
Definition: ukf_types.h:602
double alpha
: "Size" of sigma-point distribution. Should be small if the function is strongly non-linear ...
Definition: ukf_types.h:523
int no
Dimension of the output : the measurements.
Definition: ukf_types.h:560
gsl_matrix * xi_prediction
Definition: ukf_types.h:594
gsl_matrix * temp_no_1
Definition: ukf_types.h:632
double prior_x
Prior estimate of the covariance matrix of the state.
Definition: ukf_types.h:565
gsl_matrix * temp_no_no
Definition: ukf_types.h:631
gsl_vector * wm_j
Definition: ukf_types.h:615
gsl_matrix * temp_1_n
Definition: ukf_types.h:627
void ukf_iterate(ukf_param &p, ukf_state &s, FunctProcess f, FunctObservation h, gsl_vector *yi)
UKF-additive (zero-mean) noise case, "Kalman Filtering and Neural Networks", p.233.
Definition: ukf_state_ndim.h:198
gsl_matrix * temp_1_no
Definition: ukf_types.h:633
int n
Size of the state vector.
Definition: ukf_types.h:545
gsl_matrix * temp_n_1
Definition: ukf_types.h:626
gsl_vector * wc_aug_j
Definition: ukf_types.h:619
double gamma_aug
Definition: ukf_types.h:540
double beta
Non negative weights used to introduce knowledge about the higher order moments of the distribution...
Definition: ukf_types.h:528
gsl_matrix * Pnni
Definition: ukf_types.h:605
double measurement_noise
Parameter used for the evolution noise.
Definition: ukf_types.h:580
gsl_vector * temp_n
Definition: ukf_types.h:624
gsl_matrix * Ki
Definition: ukf_types.h:621
void ukf_init(ukf_param &p, ukf_state &s)
Allocation of the vectors/matrices and initialization.
Definition: ukf_state_ndim.h:42
gsl_vector * sigmaPoint
Definition: ukf_types.h:609