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
795d0fce
Commit
795d0fce
authored
Mar 30, 2012
by
Stéphane Adjemian
Browse files
Cosmetic changes.
parent
6c6b6293
Changes
1
Show whitespace changes
Inline
Side-by-side
matlab/particle/sequential_importance_particle_filter.m
View file @
795d0fce
...
...
@@ -130,17 +130,17 @@ for t=1:sample_size
wtilde
=
weights
.
*
exp
(
lnw
-
dfac
);
lik
(
t
)
=
log
(
sum
(
wtilde
))
+
dfac
;
weights
=
wtilde
/
sum
(
wtilde
);
if
strcmp
i
(
DynareOptions
.
particle
.
resampling
.
status
,
'
generic
'
))
if
strcmp
(
DynareOptions
.
particle
.
resampling
.
status
,
'
generic
'
))
Neff
=
1
/
(
weights
*
weights
'
);
end
if
(
Neff
<
DynareOptions
.
particle
.
resampling
.
neff_threshold
*
sample_size
&&
strcmp
i
(
DynareOptions
.
particle
.
resampling
.
status
,
'
generic
'
))
||
strcmp
i
(
DynareOptions
.
particle
.
resampling
.
status
,
'
systematic
'
)
if
(
Neff
<
DynareOptions
.
particle
.
resampling
.
neff_threshold
*
sample_size
&&
strcmp
(
DynareOptions
.
particle
.
resampling
.
status
,
'
generic
'
))
||
strcmp
(
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
;
elseif
strcmp
i
(
DynareOptions
.
particle
.
resampling
.
status
,
'
smoothed
'
)
elseif
strcmp
(
DynareOptions
.
particle
.
resampling
.
status
,
'
smoothed
'
)
StateVectors
=
multivariate_smooth_resampling
(
weights
'
,
tmp
(
mf0
,
:
)
'
,
number_of_particles
,
DynareOptions
.
particle
.
resampling
.
number_of_partitions
)
'
;
weights
=
ones
(
1
,
number_of_particles
)
/
number_of_particles
;
elseif
strcmp
i
(
DynareOptions
.
particle
.
resampling
.
status
,
'
none
'
)
elseif
strcmp
(
DynareOptions
.
particle
.
resampling
.
status
,
'
none
'
)
StateVectors
=
tmp
(
mf0
,
:
);
end
end
...
...
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