Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
dynare
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dynare
dynare
Merge requests
!2345
Draft: Integrate DSMH
Code
Review changes
Check out branch
Download
Patches
Plain diff
Open
Draft: Integrate DSMH
JohannesPfeifer/dynare:DSMH
into
master
Overview
0
Commits
8
Pipelines
4
Changes
1
Open
Johannes Pfeifer
requested to merge
JohannesPfeifer/dynare:DSMH
into
master
2 months ago
Overview
0
Commits
8
Pipelines
4
Changes
1
Expand
Supersedes and closes
!2337
0
0
Merge request reports
Viewing commit
f7f44a7b
Prev
Next
Show latest version
1 file
+
11
−
6
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
f7f44a7b
kitagawa.m: allow drawing defined number of particles instead of all particles
· f7f44a7b
Frédéric Karamé
authored
4 months ago
matlab/estimation/resampler/kitagawa.m
+
11
−
6
Options
function
indices
=
kitagawa
(
weights
,
noise
)
function
indices
=
kitagawa
(
weights
,
noise
,
m
)
% function indices = kitagawa(weights, noise, m)
% Return indices for resampling.
%
% INPUTS
% - weights [double] n×1 vector of partcles' weights.
% - weights [double] n×1 vector of part
i
cles' weights.
% - noise [double] scalar, uniform random deviates in [0,1]
% - m [integer] scalar, number of particles to resample
%
% OUTPUTS
% - indices [integer]
n
×1 vector of indices in [1:n]
% - indices [integer]
m
×1 vector of indices in [1:n]
% Copyright © 2022-202
3
Dynare Team
% Copyright © 2022-202
4
Dynare Team
%
% This file is part of Dynare.
%
@@ -26,7 +27,11 @@ function indices = kitagawa(weights, noise)
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <https://www.gnu.org/licenses/>.
n
=
length
(
weights
);
if
nargin
<
3
n
=
length
(
weights
);
else
n
=
m
;
end
if
nargin
<
2
,
noise
=
rand
;
end
Loading