Particle filter dynare

That is good insight. Thanks.

My next question has to do with programming Particle filters.
The command filter_algorithm=sis
is the sequential importance sampling. However, by adding

resampling=systematic or generic
Doe this make the particle filter the sequential importance resampling filter? It seems obvious, but the manual does not explicitly say this.

Does this option work with any of the other filters? It must not do anything to the APF

Lastly, the mode_compute=11 runs the on-line estimation. Does this option over ride the particle filters in the filter_algorithm=

Concerning the first question on filter_algorithm=sis and resampling=systematic the answer is yes. And it is the default.

resampling_threshold only works with generic and is useless with systematic or none. With apf it induces a second resampling step on current particles which is not necessary. The literature then recommands resampling=none for apf.

Keep in mind that maximum likelihood will not function in presence of resampling since it generates a discontinuity of the criterion with respect to the structural parameters. In that case, avoid gradient-based methods.

Concerning mode_compute=11 it is an auxiliary particle filter and it overrides the other options that control other particle filters. It is useful to obtain fast estimation on parameters by including them as extra states but suffers from a severe lack of theoretical foundations.

Thank you for the detailed reply. That makes things clear.
Can someone check the NKLF option with the linear_model.mod . It runs for several minutes before crashing.

Could you please provide the mod-file

The NLKF filter starts out strong, but then crashes at Simplex iteration number: 4964-4-3, maybe after 20 minutes.

linear_model_nlkf.mod (1.44 KB)

Notice that this file expects the linear_model.mode.mat file, but This board won’t let me upload .mat files. Be sure to eliminate the mode_file=linear_model_mode in the estimation command.

Thanks for looking into this bug.


You may try it again with the proposed change at

Dear Professor Pfeifer,

I learn that dynare 4.6.1 is able to do estimation for order higher than 1. While I try to implement the estimation which I have specified as log-linear model. However, the dynare reports that higher order estimation cannot deal with log-lineared model.

error: non_linear_dsge_likelihood (line 59)
non_linear_dsge_likelihood: It is not possible to use a non linear filter with the option loglinear!

I understand that the higher-order estimation or particle filter is relatively new. But is it possible to find any simple example or instruction in the dynare manual on the issue—how to use the estimation command with higher-order properly?


Examples are at

Note that the problem is not with using a log-linearized model, but rather you asking to log-linearize a model using Dynare functionality. It is usually better to work with auxiliary equations to get a log-linearization. See

Dear Professor,

Many thanks for your reply. It helps!


Dear Professor Pfeifer,

I try to run the .mod files from tests/particle · master · Dynare / dynare · GitLab. However, after running the .mod files and choosing the mode - finder I get the following error message.

Reference to non-existent field ‘ghs2’.

Error in non_linear_dsge_likelihood (line 179)
ReducedForm.constant = ReducedForm.steadystate + .5*dr.ghs2(restrict_variables_idx);

Error in initial_estimation_checks (line 153)
[fval,info] =

Error in dynare_estimation_1 (line 164)
oo_ =

Error in dynare_estimation (line 105)

Error in noisy_ar1.driver (line 177)

Error in dynare (line 293)
evalin(‘base’,[fname ‘.driver’]) ;

I am using dynare 4.6.4. How can I fix it?


Could you please try the unstable version?

Hi Professor,

Thank You for Your reply, I installed dynare 4.8 the latest unstable version. And now after running the same code I get such an error.
Error using initial_estimation_checks (line 99)
initial_estimation_checks:: particle filtering requires measurement error on the observables

Error in initial_estimation_checks (line 99)
error(‘initial_estimation_checks:: %s requires measurement error on the observables’,disp_string)

Error in dynare_estimation_1 (line 154)
oo_ =

Error in dynare_estimation (line 118)

Error in noisy_ar1.driver (line 179)

Error in dynare (line 281)
evalin(‘base’,[fname ‘.driver’]);

You picked exactly one the files that is not supposed to work. Try e.g. the first_spec.mod.