23 #include <gsl/gsl_vector.h>
24 #include <gsl/gsl_matrix.h>
156 gsl_matrix_set_identity(s.
Rv);
168 double _decay, _lower_bound;
172 _lower_bound(lower_bound)
177 for(
int i = 0 ; i < p.
n ; ++i)
179 for(
int j = 0 ; j < p.
n ; ++j)
182 gsl_matrix_set(s.
Rv, i, i,
ukf::math::max(_decay * gsl_matrix_get(s.
Rv,i,i),_lower_bound));
184 gsl_matrix_set(s.
Rv, i, j, 0.0);
200 printf(
"Forgetting factor should not be null !!\n");
205 gsl_matrix_memcpy(s.
Rv, s.
Pxk);
206 gsl_matrix_scale(s.
Rv, 1.0 / _decay - 1.0);
224 gsl_matrix_view mat_view = gsl_matrix_view_array(s.
ino_yk->data, p.
no, 1);
225 gsl_blas_dgemm(CblasNoTrans, CblasNoTrans, 1.0, s.
Kk, &mat_view.matrix, 0.0, s.
temp_n_1);
227 gsl_blas_dgemm(CblasNoTrans, CblasTrans, _alpha, s.
temp_n_1, s.
temp_n_1, (1.0 - _alpha),s.
Rv);
233 #endif // EKF_TYPES_H
double _initial_value
Definition: ekf_types.h:151
void updateEvolutionNoise(ekf_param &p, ekf_state &s)
Definition: ekf_types.h:221
EvolutionNoise(double initial_value)
Definition: ekf_types.h:153
Mother class from which the evolution noises inherit.
Definition: ekf_types.h:148
Robbins-Monro evolution noise.
Definition: ekf_types.h:213
EvolutionRobbinsMonro(double initial_value, double alpha)
Definition: ekf_types.h:217
double observation_noise
Covariance of the observation noise.
Definition: ekf_types.h:50
virtual void updateEvolutionNoise(ekf_param &p, ekf_state &s)=0
int no
Dimension of the output.
Definition: ekf_types.h:65
gsl_matrix * Rv
Variance covariance of the evolution noise.
Definition: ekf_types.h:99
gsl_vector * ino_yk
Current innovations.
Definition: ekf_types.h:109
gsl_matrix * temp_n_no
Definition: ekf_types.h:132
gsl_vector * yk
Current observation.
Definition: ekf_types.h:104
Structure holding the parameters of the statistical linearization.
Definition: ekf_types.h:39
Definition: ekf_types.h:74
EvolutionRLS(double initial_value, double decay)
Definition: ekf_types.h:197
gsl_matrix * Rn
Variance covariance of the observation noise.
Definition: ekf_types.h:119
Forgetting type evolution noise.
Definition: ekf_types.h:193
double max(double a, double b)
Definition: ukf_math.h:40
gsl_vector * xkm
Predicted state.
Definition: ekf_types.h:84
gsl_vector * xk
Current estimate of the state.
Definition: ekf_types.h:79
EvolutionNoise * evolution_noise
Evolution noise type.
Definition: ekf_types.h:45
gsl_matrix * temp_n_n
Temporary matrices.
Definition: ekf_types.h:129
gsl_matrix * Hyk
Jacobian of the observation function.
Definition: ekf_types.h:114
gsl_matrix * Kk
Kalman gain.
Definition: ekf_types.h:124
EvolutionAnneal(double initial_value, double decay, double lower_bound)
Definition: ekf_types.h:170
gsl_vector * temp_no
Definition: ekf_types.h:134
gsl_matrix * temp_no_no
Definition: ekf_types.h:131
gsl_matrix * temp_n_1
Definition: ekf_types.h:130
Annealing type evolution noise.
Definition: ekf_types.h:166
void updateEvolutionNoise(ekf_param &p, ekf_state &s)
Definition: ekf_types.h:175
gsl_matrix * Fxk
Jacobian of the evolution function.
Definition: ekf_types.h:94
double prior_pk
Prior estimate of the covariance matrix.
Definition: ekf_types.h:55
void init(ekf_param &p, ekf_state &s)
Definition: ekf_types.h:154
gsl_matrix * Pxk
Variance-Covariance of the state.
Definition: ekf_types.h:89
bool cmp_equal(double x, double y)
Definition: ukf_math.h:50
gsl_matrix * temp_2_n_n
Definition: ekf_types.h:133
void updateEvolutionNoise(ekf_param &p, ekf_state &s)
Definition: ekf_types.h:203
int n
Number of parameters to estimate.
Definition: ekf_types.h:60
bool observation_gradient_is_diagonal
Is the observation gradient diagonal ? In that case, simplifications can be introduced.
Definition: ekf_types.h:70
gsl_vector * params
Optional parameters (this must be allocated and initialized from the user side!
Definition: ekf_types.h:139