Skip to content
Snippets Groups Projects
Commit 26d0f1a2 authored by Dóra Kocsis's avatar Dóra Kocsis
Browse files

fix bug in particle_filter drop-down option inputs: resampling, resampling_method, filter_algorithm

parent 549f0cf4
No related branches found
No related tags found
No related merge requests found
...@@ -89,18 +89,9 @@ switch name ...@@ -89,18 +89,9 @@ switch name
case 'number_of_particles' case 'number_of_particles'
mapping = 'particle.number_of_particles'; mapping = 'particle.number_of_particles';
case 'resampling'
mapping = 'particle.resampling.status';
case 'resampling_threshold' case 'resampling_threshold'
mapping = 'particle.resampling.threshold'; mapping = 'particle.resampling.threshold';
case 'resampling_method'
mapping = 'particle.resampling.method';
case 'filter_algorithm'
mapping = 'particle.filter_algorithm';
case 'tex' case 'tex'
mapping = 'TeX'; mapping = 'TeX';
......
...@@ -537,35 +537,29 @@ dynare_gui_.estimation.Particle_filter{num,2} = '5000'; %default is 1000 in R ...@@ -537,35 +537,29 @@ dynare_gui_.estimation.Particle_filter{num,2} = '5000'; %default is 1000 in R
dynare_gui_.estimation.Particle_filter{num,3} = 'INTEGER'; dynare_gui_.estimation.Particle_filter{num,3} = 'INTEGER';
dynare_gui_.estimation.Particle_filter{num,4} = 'Number of particles used when evaluating the likelihood of a non linear state space model. Default: 1000.'; dynare_gui_.estimation.Particle_filter{num,4} = 'Number of particles used when evaluating the likelihood of a non linear state space model. Default: 1000.';
num = num+1; num = num+1;
dynare_gui_.estimation.Particle_filter{num,1} = 'resampling'; dynare_gui_.estimation.Particle_filter{num,1} = 'resampling';
dynare_gui_.estimation.Particle_filter{num,2} = ''; %default is systematic ??? dynare_gui_.estimation.Particle_filter{num,2} = 'systematic';
dynare_gui_.estimation.Particle_filter{num,3} = {'','none','systematic','generic'}; dynare_gui_.estimation.Particle_filter{num,3} = {'systematic','none','generic'};
dynare_gui_.estimation.Particle_filter{num,4} = 'Determines if resampling of the particles is done. Possible values for OPTION are: none, systematic and generic.'; dynare_gui_.estimation.Particle_filter{num,4} = 'Determines if resampling of the particles is done. Possible values for OPTION are: none, systematic and generic.';
num = num+1; num = num+1;
dynare_gui_.estimation.Particle_filter{num,1} = 'resampling_threshold'; dynare_gui_.estimation.Particle_filter{num,1} = 'resampling_threshold';
dynare_gui_.estimation.Particle_filter{num,2} = ''; % default is 0.5 ??? dynare_gui_.estimation.Particle_filter{num,2} = ''; % default is 0.5 ???
dynare_gui_.estimation.Particle_filter{num,3} = 'DOUBLE'; dynare_gui_.estimation.Particle_filter{num,3} = 'DOUBLE';
dynare_gui_.estimation.Particle_filter{num,4} = 'A real number between zero and one. The resampling step is triggered as soon as the effective number of particles is less than this number times the total number of particles (as set by [number of particles]). This option is effective if and only if option [resampling] has value generic.'; dynare_gui_.estimation.Particle_filter{num,4} = 'A real number between zero and one. The resampling step is triggered as soon as the effective number of particles is less than this number times the total number of particles (as set by [number of particles]). This option is effective if and only if option [resampling] has value generic.';
num = num+1; num = num+1;
dynare_gui_.estimation.Particle_filter{num,1} = 'resampling_method'; dynare_gui_.estimation.Particle_filter{num,1} = 'resampling_method';
dynare_gui_.estimation.Particle_filter{num,2} = ''; %default is kitagawa??? dynare_gui_.estimation.Particle_filter{num,2} = 'kitagawa';
dynare_gui_.estimation.Particle_filter{num,3} = {'kitagawa','stratified','smooth'}; dynare_gui_.estimation.Particle_filter{num,3} = {'kitagawa','stratified','smooth'};
dynare_gui_.estimation.Particle_filter{num,4} = 'Sets the resampling method. Possible values for OPTION are: kitagawa, stratified and smooth.'; dynare_gui_.estimation.Particle_filter{num,4} = 'Sets the resampling method. Possible values for OPTION are: kitagawa, stratified and smooth.';
num = num+1; num = num+1;
dynare_gui_.estimation.Particle_filter{num,1} = 'filter_algorithm'; dynare_gui_.estimation.Particle_filter{num,1} = 'filter_algorithm';
dynare_gui_.estimation.Particle_filter{num,2} = ''; dynare_gui_.estimation.Particle_filter{num,2} = 'sis';
dynare_gui_.estimation.Particle_filter{num,3} = {'','sis','apf','gf','gmf','cpf'}; dynare_gui_.estimation.Particle_filter{num,3} = {'sis','apf','gf','gmf','cpf', 'nlkf'};
dynare_gui_.estimation.Particle_filter{num,4} = 'Sets the particle filter algorithm. Possible values for OPTION are: sis, apf, gf, gmf and cpf.'; dynare_gui_.estimation.Particle_filter{num,4} = 'Sets the particle filter algorithm. Possible values for OPTION are: sis, apf, gf, gmf, cpf, and nlkf.';
%% Group 8: output %% Group 8: output
......
...@@ -132,6 +132,33 @@ try ...@@ -132,6 +132,33 @@ try
case 'optim' case 'optim'
options_.optim_opt = value; options_.optim_opt = value;
case 'resampling'
if value == 2
options_.particle.resampling.status.none = true;
elseif value == 3
options_.particle.resampling.status.generic = true;
end
case 'resampling_method'
if value == 2
options_.particle.resampling.method.stratified = true;
elseif value == 3
options_.particle.resampling.method.smooth = true;
end
case 'filter_algorithm'
if value == 2
options_.particle.filter_algorithm = 'apf';
elseif value == 3
options_.particle.filter_algorithm = 'gf';
elseif value == 4
options_.particle.filter_algorithm = 'gmf';
elseif value == 5
options_.particle.filter_algorithm = 'cpf';
elseif value == 6
options_.particle.filter_algorithm = 'nlkf';
end
otherwise otherwise
if isnumeric(value) if isnumeric(value)
eval(['options_.' gui_auxiliary.command_option_mapping(name) '=' num2str(value) ';']); eval(['options_.' gui_auxiliary.command_option_mapping(name) '=' num2str(value) ';']);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment