Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Mark Song
particles
Commits
427e88e6
Commit
427e88e6
authored
Jun 08, 2018
by
Frédéric Karamé
Browse files
Correct the calculation of the incremental weights.
parent
857168dd
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/gaussian_densities.m
View file @
427e88e6
...
...
@@ -42,11 +42,12 @@ proposal = probability2(mut_t,sqr_Pss_t_t,particles) ;
prior
=
probability2
(
st_t_1
,
sqr_Pss_t_t_1
,
particles
)
;
% likelihood
yt_t_1_i
=
measurement_equations
(
particles
,
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
;
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment