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
Dóra Kocsis
dynare
Commits
ec9b4742
Commit
ec9b4742
authored
Mar 09, 2012
by
Stéphane Adjemian
Browse files
Added an option for the threshold level of neff in the generic case of the resampling routines.
parent
2e6762eb
Changes
2
Hide whitespace changes
Inline
Side-by-side
matlab/global_initialization.m
View file @
ec9b4742
...
...
@@ -179,7 +179,8 @@ particle.unscented.alpha = 1;
particle
.
unscented
.
beta
=
2
;
particle
.
unscented
.
kappa
=
1
;
% Configuration of resampling in case of particles
particle
.
resampling
.
status
=
'systematic'
;
particle
.
resampling
.
status
=
'systematic'
;
% 'generic'
particle
.
resampling
.
neff_threshold
=
.
5
;
% Choice of the resampling method
particle
.
resampling
.
method1
=
'traditional'
;
particle
.
resampling
.
method2
=
'kitagawa'
;
...
...
matlab/particle/sequential_importance_particle_filter.m
View file @
ec9b4742
...
...
@@ -131,7 +131,7 @@ for t=1:sample_size
lik
(
t
)
=
log
(
mean
(
wtilde
))
+
dfac
;
weights
=
wtilde
/
sum
(
wtilde
);
Neff
=
1
/
(
weights
*
weights
'
);
if
(
Neff
<
.
5
*
sample_size
&&
strcmpi
(
DynareOptions
.
particle
.
resampling
.
status
,
'
generic
'
))
||
strcmpi
(
DynareOptions
.
particle
.
resampling
.
status
,
'
systematic
'
)
if
(
Neff
<
DynareOptions
.
particle
.
resampling
.
neff_threshold
*
sample_size
&&
strcmpi
(
DynareOptions
.
particle
.
resampling
.
status
,
'
generic
'
))
||
strcmpi
(
DynareOptions
.
particle
.
resampling
.
status
,
'
systematic
'
)
nb_obs_resamp
=
nb_obs_resamp
+
1
;
StateVectors
=
tmp
(
mf0
,
resample
(
weights
,
DynareOptions
.
particle
.
resampling
.
method1
,
DynareOptions
.
particle
.
resampling
.
method2
));
weights
=
ones
(
1
,
number_of_particles
)
/
number_of_particles
;
...
...
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