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
Frédéric Karamé
dynare
Commits
8ee392fc
Commit
8ee392fc
authored
4 months ago
by
Frédéric Karamé
Browse files
Options
Downloads
Patches
Plain Diff
Grant the possibility to draw a particular number of particles instead of all the particles.
parent
2eecea76
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
matlab/estimation/resampler/kitagawa.m
+10
-5
10 additions, 5 deletions
matlab/estimation/resampler/kitagawa.m
with
10 additions
and
5 deletions
matlab/estimation/resampler/kitagawa.m
+
10
−
5
View file @
8ee392fc
function
indices
=
kitagawa
(
weights
,
noise
)
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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment