Fixed typo. Do not use the non linear filter automatically when order==2, otherwise the non linear filters are used if the estimation command is used after a stoch_simul command with order==2. The non linear filter is used only if options_.particle.status is explicitely set to 1 (before the estimation command). A new estimation option is needed...

time-shift
Stéphane Adjemian (Charybdis) 2012-03-05 08:46:52 +01:00
parent d64817437e
commit 59d3d30c90
1 changed files with 12 additions and 2 deletions

View File

@ -33,11 +33,21 @@ global M_ options_ oo_ estim_params_ bayestopt_ dataset_
% Set particle filter flag.
if options_.order > 1
options_.particle_filter.status = 1;
if options_.particle.status && options_.order==2
disp(' ')
disp('Estimation using a non linear filter!')
disp(' ')
elseif options_.particle.status && options_.order==2
error(['Non linear filter are not implemented with order ' int2str(options_.order) ' approximation of the model!'])
elseif ~options_.particle.status && options_.order==2
error('If you want to estimate the model with a second order approximation using a non linear filter, set options_.particle.status=1;')
else
error(['Cannot estimate a model with an order ' int2str(options_.order) ' approximation!'])
end
end
if ~options_.dsge_var
if options_.particle_filter.status
if options_.particle.status
objective_function = str2func('non_linear_dsge_likelihood');
else
objective_function = str2func('dsge_likelihood');