Skip to content
Snippets Groups Projects
Commit af44f82a authored by Frédéric Karamé's avatar Frédéric Karamé
Browse files

Correct the calculation of the incremental weights.

(cherry picked from commit 1f08164b)
parent 31e853bb
Branches
No related tags found
No related merge requests found
......@@ -46,11 +46,12 @@ prior = prior' ;
proposal = proposal' ;
% Compute the density of the current observation conditionally to each particle
yt_t_1_i = measurement_equations(StateParticles,ReducedForm,ThreadsOptions) ;
eta_t_i = bsxfun(@minus,obs,yt_t_1_i)' ;
yt_t_1 = sum(yt_t_1_i*weigths1,2) ;
tmp = bsxfun(@minus,yt_t_1_i,yt_t_1) ;
Pyy = bsxfun(@times,weigths2',tmp)*tmp' + H ;
sqr_det = sqrt(det(Pyy)) ;
foo = (eta_t_i/Pyy).*eta_t_i ;
likelihood = exp(-0.5*sum(foo,2))/(normconst*sqr_det) + 1e-99 ;
%eta_t_i = bsxfun(@minus,obs,yt_t_1_i)' ;
%yt_t_1 = sum(yt_t_1_i*weigths1,2) ;
%tmp = bsxfun(@minus,yt_t_1_i,yt_t_1) ;
%Pyy = bsxfun(@times,weigths2',tmp)*tmp' + H ;
%sqr_det = sqrt(det(Pyy)) ;
%foo = (eta_t_i/Pyy).*eta_t_i ;
%likelihood = exp(-0.5*sum(foo,2))/(normconst*sqr_det) + 1e-99 ;
likelihood = probability2(obs,sqrt(H),yt_t_1_i) ;
IncrementalWeights = likelihood.*prior./proposal ;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment