23 #include <gsl/gsl_vector.h>
24 #include <gsl/gsl_matrix.h>
25 #include <gsl/gsl_blas.h>
26 #include <gsl/gsl_math.h>
27 #include <gsl/gsl_linalg.h>
397 gsl_matrix_set_identity(s.
Prrk);
402 gsl_matrix_set_identity(s.
Prrk);
415 double _decay, _lower_bound;
419 _lower_bound(lower_bound)
424 for(
int i = 0 ; i < p.
n ; ++i)
426 for(
int j = 0 ; j < p.
n ; ++j)
431 gsl_matrix_set(s.
Prrk, i, j, 0.0);
437 for(
int i = 0 ; i < p.
n ; ++i)
439 for(
int j = 0 ; j < p.
n ; ++j)
444 gsl_matrix_set(s.
Prrk, i, j, 0.0);
460 printf(
"Forgetting factor should not be null !!\n");
465 gsl_matrix_memcpy(s.
Prrk, s.
Pk);
466 gsl_matrix_scale(s.
Prrk, 1.0 / _decay - 1.0);
470 gsl_matrix_memcpy(s.
Prrk, s.
Pk);
471 gsl_matrix_scale(s.
Prrk, 1.0 / _decay - 1.0);
489 gsl_matrix_view mat_view = gsl_matrix_view_array(s.
ino_dk->data, p.
no, 1);
490 gsl_blas_dgemm(CblasNoTrans, CblasNoTrans, 1.0, s.
Kk, &mat_view.matrix, 0.0, s.
mat_temp_n_1);
497 gsl_matrix_view mat_view = gsl_matrix_view_array(s.
Kk->data,p.
n,1);
498 gsl_blas_dgemm(CblasNoTrans, CblasTrans, gsl_pow_2(s.
ino_dk) * _alpha, &mat_view.matrix, &mat_view.matrix, 1.0 - _alpha, s.
Prrk);
508 class EvolutionNoise;
647 gsl_matrix_set_identity(s.
Pvvi);
649 gsl_matrix_set_identity(s.
cholPvvi);
661 double _decay, _lower_bound;
665 _lower_bound(lower_bound)
671 for(
int i = 0 ; i < p.
n ; ++i)
673 for(
int j = 0 ; j < p.
n ; ++j)
678 gsl_matrix_set(s.
Pvvi, i, i, value);
679 gsl_matrix_set(s.
cholPvvi, i ,i, sqrt(value));
683 gsl_matrix_set(s.
Pvvi, i, j, 0.0);
684 gsl_matrix_set(s.
cholPvvi, i, j, 0.0);
701 printf(
"Forgetting factor should not be null !!\n");
707 gsl_matrix_scale(s.
Pvvi, 1.0 / _decay - 1.0);
709 gsl_linalg_cholesky_decomp(s.
cholPvvi);
711 for(
int j = 0 ; j < p.
n ; j++)
712 for(
int k = j+1 ; k < p.
n ; k++)
733 gsl_matrix_view mat_view = gsl_matrix_view_array(s.
temp_n->data,p.
n,1);
734 gsl_blas_dgemm(CblasNoTrans, CblasTrans, _alpha, &mat_view.matrix, &mat_view.matrix, (1.0 - _alpha),s.
Pvvi);
883 #endif // UKF_TYPES_H
gsl_vector * wm_aug_j
Definition: ukf_types.h:618
gsl_matrix * Sxi
Definition: ukf_types.h:832
gsl_matrix * Ki_T
Definition: ukf_types.h:622
gsl_matrix * xi_prediction
Definition: ukf_types.h:830
void init(ukf_param &p, ukf_state &s)
Definition: ukf_types.h:645
EvolutionNoise * evolution_noise
Parameter used for the evolution noise.
Definition: ukf_types.h:96
gsl_vector * yi_mean
Definition: ukf_types.h:836
EvolutionNoise(double initial_value)
Definition: ukf_types.h:644
gsl_vector * cSk
Vector holding one column of Sk, of size .
Definition: ukf_types.h:196
void updateEvolutionNoise(ukf_param &p, ukf_state &s)
Definition: ukf_types.h:463
gsl_vector * w
Parameter vector, of size .
Definition: ukf_types.h:176
gsl_vector * Pwdk
Covariance of : , of size .
Definition: ukf_types.h:156
gsl_matrix * temp_n_no
Definition: ukf_types.h:629
gsl_vector * temp_n
Definition: ukf_types.h:860
void updateEvolutionNoise(ukf_param &p, ukf_state &s)
Definition: ukf_types.h:668
gsl_vector * dk
Temporary vector holding the image of the sigma points, of size .
Definition: ukf_types.h:215
gsl_vector * wc
Weights used to update the covariance matrices.
Definition: ukf_types.h:318
double lambda_aug
Definition: ukf_types.h:534
double Peek
Covariance of the observation noise.
Definition: ukf_types.h:166
gsl_matrix * mat_temp_1_output
Temporary matrix of size .
Definition: ukf_types.h:368
gsl_matrix * U
Definition: ukf_types.h:849
gsl_matrix * sigmaPointsMeasure
Definition: ukf_types.h:613
Pointer to the function to approximate in the scalar case.
Definition: ukf_types.h:136
Robbins-Monro evolution noise.
Definition: ukf_types.h:478
EvolutionRobbinsMonro(double initial_value, double alpha)
Definition: ukf_types.h:724
gsl_matrix * Sni
Definition: ukf_types.h:839
Structure holding the matrices manipulated by the statistical linearization in the vectorial case for...
Definition: ukf_types.h:589
gsl_matrix * Pddk
Covariance of the output, a matrix of size .
Definition: ukf_types.h:269
gsl_vector * wc_j
Definition: ukf_types.h:616
void updateEvolutionNoise(ukf_param &p, ukf_scalar_state &s)
Definition: ukf_types.h:435
double kpa
, is a good choice. According to van der Merwe, its value is not critical
Definition: ukf_types.h:60
gsl_matrix * temp_n_n
Definition: ukf_types.h:625
gsl_vector * wk
Temporary vector, holding a sigma-point.
Definition: ukf_types.h:181
gsl_matrix * Sk
Matrix holding the Cholesky decomposition of , of size .
Definition: ukf_types.h:191
gsl_matrix * Pk
Covariance matrix of the parameters, of size .
Definition: ukf_types.h:186
double d_mean
Variable holding the mean of the sigma points image.
Definition: ukf_types.h:225
int nbSamples
Number of sigma-points
Definition: ukf_types.h:550
gsl_vector * wm_aug_j
Definition: ukf_types.h:854
gsl_matrix * yi_prediction
Definition: ukf_types.h:601
gsl_matrix * Pyyi
Definition: ukf_types.h:604
double _initial_value
Definition: ukf_types.h:642
void init(ukf_param &p, ukf_scalar_state &s)
Definition: ukf_types.h:400
double lambda
Definition: ukf_types.h:533
int nbSamplesMeasure
Number of sigma-points
Definition: ukf_types.h:555
double observation_noise
Covariance of the observation noise.
Definition: ukf_types.h:101
gsl_matrix * mat_temp_output_1
Temporary matrix of size .
Definition: ukf_types.h:373
double measurement_noise
Covariance of the observation noise.
Definition: ukf_types.h:816
gsl_matrix * sigmaPoints
Matrix holding the sigma points in the columns, of size .
Definition: ukf_types.h:338
EvolutionAnneal(double initial_value, double decay, double lower_bound)
Definition: ukf_types.h:417
void updateEvolutionNoise(ukf_param &p, ukf_state &s)
Definition: ukf_types.h:422
gsl_vector * ino_yi
Definition: ukf_types.h:603
gsl_matrix * Kk
Kalman gain, a matrix of size .
Definition: ukf_types.h:254
gsl_matrix * Pxyi
Definition: ukf_types.h:841
Structure holding the parameters of the Unscented Kalman Filter.
Definition: ukf_types.h:55
gsl_matrix * Pxyi
Definition: ukf_types.h:607
Annealing type evolution noise.
Definition: ukf_types.h:413
Structure holding the parameters of the statistical linearization.
Definition: ukf_types.h:749
gsl_vector * ino_dk
Vector holding the inovation, of size ŝ
Definition: ukf_types.h:333
double kpa
, is a good choice. According to van der Merwe, its value is not critical
Definition: ukf_types.h:518
double beta
Non negative weights used to introduce knowledge about the higher order moments of the distribution...
Definition: ukf_types.h:70
gsl_matrix * Pxxi
Definition: ukf_types.h:596
gsl_matrix * mat_temp_output_output
Temporary matrix of size .
Definition: ukf_types.h:378
gsl_matrix * temp_n_n
Temporary matrix.
Definition: ukf_types.h:240
EvolutionRLS(double initial_value, double decay)
Definition: ukf_types.h:698
gsl_vector * d_mean
Vector holding the mean of the sigma points image, of size ŝ
Definition: ukf_types.h:328
double gamma
Definition: ukf_types.h:539
gsl_vector * xi_mean
Definition: ukf_types.h:595
gsl_vector * wk
Temporary vector holding one sigma point, of size .
Definition: ukf_types.h:289
gsl_vector * wc_aug_j
Definition: ukf_types.h:855
double max(double a, double b)
Definition: ukf_math.h:40
gsl_matrix * temp_no_1
Definition: ukf_types.h:870
int n
Number of parameters to estimate.
Definition: ukf_types.h:111
gsl_vector * w
Parameter vector, of size .
Definition: ukf_types.h:284
gsl_matrix * sigmaPoints
Definition: ukf_types.h:844
gsl_matrix * dk
Temporary matrix holding the image of the sigma points, of size .
Definition: ukf_types.h:323
ProcessNoise
The different types of implemented process noise for UKF state estimation.
Definition: ukf_types.h:36
void init(ukf_param &p, ukf_state &s)
Definition: ukf_types.h:395
gsl_matrix * mat_temp_n_1
Temporary matrix of size .
Definition: ukf_types.h:353
gsl_vector * temp_no
Definition: ukf_types.h:861
Forgetting type evolution noise.
Definition: ukf_types.h:694
EvolutionRLS(double initial_value, double decay)
Definition: ukf_types.h:457
double beta
Non negative weights used to introduce knowledge about the higher order moments of the distribution...
Definition: ukf_types.h:764
gsl_matrix * Peek
Covariance of the observation noise, of size .
Definition: ukf_types.h:274
gsl_matrix * temp_1_no
Definition: ukf_types.h:871
Mother class from which the evolution noises inherit.
Definition: ukf_types.h:639
Structure holding the parameters of the statistical linearization.
Definition: ukf_types.h:513
gsl_matrix * temp_n_1
Definition: ukf_types.h:864
int no
Dimension of the output.
Definition: ukf_types.h:121
gsl_matrix * sigmaPoints
Definition: ukf_types.h:610
EvolutionAnneal(double initial_value, double decay, double lower_bound)
Definition: ukf_types.h:663
gsl_vector * cSk
Vector holding one column of Sk, of size .
Definition: ukf_types.h:304
gsl_vector * sigmaPointMeasure
Definition: ukf_types.h:612
gsl_vector * wm
Weights used to compute the mean of the sigma points' images.
Definition: ukf_types.h:203
double ino_dk
Innovation.
Definition: ukf_types.h:220
gsl_matrix * cholPvvi
Definition: ukf_types.h:599
gsl_matrix * Pvvi
Definition: ukf_types.h:598
double lambda_aug
Definition: ukf_types.h:770
double alpha
: "Size" of sigma-point distribution. Should be small if the function is strongly non-linear ...
Definition: ukf_types.h:65
gsl_matrix * Pk
Covariance matrix of the parameters, of size .
Definition: ukf_types.h:294
gsl_matrix * temp_n_no
Definition: ukf_types.h:867
gsl_vector * vec_temp_n
Temporary vector of size .
Definition: ukf_types.h:343
gsl_matrix * temp_1_n
Definition: ukf_types.h:865
ProcessNoise process_noise_type
Type of process noise.
Definition: ukf_types.h:806
The covariance of the evolution noise is defined as .
Definition: ukf_types.h:45
gsl_vector * wc_j
Definition: ukf_types.h:852
gsl_matrix * cholPxxi
Definition: ukf_types.h:597
gsl_vector * sigmaPoint
Definition: ukf_types.h:843
virtual void updateEvolutionNoise(ukf_param &p, ukf_state &s)=0
gsl_vector * params
Definition: ukf_types.h:591
gsl_matrix * mat_temp_n_output
Temporary matrix of size .
Definition: ukf_types.h:358
void updateEvolutionNoise(ukf_param &p, ukf_state &s)
Definition: ukf_types.h:486
gsl_matrix * Prrk
Covariance of the evolution noise.
Definition: ukf_types.h:161
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
gsl_matrix * Pwdk
Covariance of : , of size .
Definition: ukf_types.h:264
double process_noise
Parameter used for the evolution noise.
Definition: ukf_types.h:811
void updateEvolutionNoise(ukf_param &p, ukf_state &s)
Definition: ukf_types.h:728
Structure holding the matrices manipulated by the statistical linearization in the vectorial case for...
Definition: ukf_types.h:825
int no
Dimension of the output : the measurements.
Definition: ukf_types.h:560
double kpa
, is a good choice. According to van der Merwe, its value is not critical
Definition: ukf_types.h:754
gsl_matrix * xi_prediction
Definition: ukf_types.h:594
gsl_matrix * Ki
Definition: ukf_types.h:857
gsl_matrix * Kk_mat
Temporary matrix for the kalman gain, a matrix of size .
Definition: ukf_types.h:146
gsl_matrix * temp_no_no
Definition: ukf_types.h:869
gsl_matrix * temp_no_1
Definition: ukf_types.h:632
void updateEvolutionNoise(ukf_param &p, ukf_state &s)
Definition: ukf_types.h:704
EvolutionNoise(double initial_value)
Definition: ukf_types.h:394
double prior_x
Prior estimate of the covariance matrix of the state.
Definition: ukf_types.h:565
double lambda
Definition: ukf_types.h:75
int nbSamplesMeasure
Number of sigma-points
Definition: ukf_types.h:791
gsl_matrix * Prrk
Covariance of the evolution noise, of size .
Definition: ukf_types.h:279
gsl_matrix * temp_no_no
Definition: ukf_types.h:631
double gamma
Definition: ukf_types.h:775
gsl_vector * wm_j
Definition: ukf_types.h:615
gsl_vector * xi_mean
Definition: ukf_types.h:831
Forgetting type evolution noise.
Definition: ukf_types.h:453
gsl_vector * params
Definition: ukf_types.h:827
double alpha
: "Size" of sigma-point distribution. Should be small if the function is strongly non-linear ...
Definition: ukf_types.h:759
int nbSamples
Number of sigma-points
Definition: ukf_types.h:786
gsl_matrix * temp_1_n
Definition: ukf_types.h:627
gsl_matrix * temp_2nno_no
Definition: ukf_types.h:874
gsl_matrix * temp_n_n
Definition: ukf_types.h:863
Robbins-Monro evolution noise.
Definition: ukf_types.h:720
int no
Dimension of the output : the measurements.
Definition: ukf_types.h:796
The covariance of the evolution noise is fixed to .
Definition: ukf_types.h:41
virtual void updateEvolutionNoise(ukf_param &p, ukf_state &s)=0
gsl_matrix * yi_prediction
Definition: ukf_types.h:835
gsl_vector * sigmaPointMeasure
Definition: ukf_types.h:846
Structure holding the matrices manipulated by the unscented kalman filter in the vectorial case...
Definition: ukf_types.h:249
double _initial_value
Definition: ukf_types.h:392
gsl_vector * wm_j
Definition: ukf_types.h:851
gsl_matrix * Kk_mat_T
Temporary matrix for the transpose of the kalman gain, a matrix of size .
Definition: ukf_types.h:151
gsl_vector * wc
Weights used to update the covariance matrices.
Definition: ukf_types.h:210
double lambda
Definition: ukf_types.h:769
Annealing type evolution noise.
Definition: ukf_types.h:659
int n
Size of the state vector.
Definition: ukf_types.h:781
gsl_matrix * mat_temp_n_n
Temporary matrix of size .
Definition: ukf_types.h:383
gsl_vector * xi
Definition: ukf_types.h:829
void updateEvolutionNoise(ukf_param &p, ukf_scalar_state &s)
Definition: ukf_types.h:468
gsl_matrix * Kk_T
The tranposed Kalman gain, a vector of size .
Definition: ukf_types.h:259
double prior_x
Prior estimate of the covariance matrix of the state.
Definition: ukf_types.h:801
gsl_vector * Kk
Kalman gain, a vector of size .
Definition: ukf_types.h:141
gsl_matrix * temp_1_no
Definition: ukf_types.h:633
void updateEvolutionNoise(ukf_param &p, ukf_scalar_state &s)
Definition: ukf_types.h:494
gsl_vector * temp_n
Temporary vector.
Definition: ukf_types.h:235
gsl_matrix * Syi
Definition: ukf_types.h:838
int n
Size of the state vector.
Definition: ukf_types.h:545
double prior_pi
Prior estimate of the covariance matrix.
Definition: ukf_types.h:106
gsl_matrix * Sk
Matrix holding the Cholesky decomposition of , of size .
Definition: ukf_types.h:299
gsl_matrix * Svi
Definition: ukf_types.h:833
gsl_matrix * temp_n_1
Definition: ukf_types.h:626
gsl_vector * wc_aug_j
Definition: ukf_types.h:619
bool cmp_equal(double x, double y)
Definition: ukf_math.h:50
gsl_matrix * temp_3n_n
Definition: ukf_types.h:873
gsl_matrix * Ki_T
Definition: ukf_types.h:858
gsl_vector * ino_yi
Definition: ukf_types.h:837
double gamma_aug
Definition: ukf_types.h:776
double gamma_aug
Definition: ukf_types.h:540
gsl_vector * vec_temp_output
Temporary vector of size .
Definition: ukf_types.h:348
double beta
Non negative weights used to introduce knowledge about the higher order moments of the distribution...
Definition: ukf_types.h:528
gsl_matrix * sigmaPointsMeasure
Definition: ukf_types.h:847
gsl_matrix * Pnni
Definition: ukf_types.h:605
double Pddk
Covariance of the output.
Definition: ukf_types.h:171
Mother class from which the evolution noises inherit.
Definition: ukf_types.h:389
double measurement_noise
Parameter used for the evolution noise.
Definition: ukf_types.h:580
gsl_vector * temp_n
Definition: ukf_types.h:624
double gamma
Definition: ukf_types.h:80
gsl_matrix * Ki
Definition: ukf_types.h:621
gsl_matrix * sigmaPoints
Matrix holding the sigma points in the columns, of size .
Definition: ukf_types.h:230
gsl_vector * wm
Weights used to compute the mean of the sigma points' images.
Definition: ukf_types.h:311
gsl_matrix * mat_temp_output_n
Temporary matrix of size .
Definition: ukf_types.h:363
EvolutionRobbinsMonro(double initial_value, double alpha)
Definition: ukf_types.h:482
gsl_vector * sigmaPoint
Definition: ukf_types.h:609
int nbSamples
Number of sigma-points
Definition: ukf_types.h:116