Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
particles
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
4
Issues
4
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dynare
particles
Commits
1f08164b
Commit
1f08164b
authored
Jun 09, 2018
by
Frédéric Karamé
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correct the calculation of the incremental weights.
parent
28f7c762
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
src/gaussian_mixture_densities.m
src/gaussian_mixture_densities.m
+8
-7
No files found.
src/gaussian_mixture_densities.m
View file @
1f08164b
...
...
@@ -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
;
Sébastien Villemot
@sebastien
mentioned in commit
af44f82a
·
Jun 18, 2020
mentioned in commit
af44f82a
mentioned in commit af44f82a658a393f43a694ab0a3bb4ccda4e49bd
Toggle commit list
Write
Preview
Markdown
is supported
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