particle filter dynare

This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location where you will have to reset your password.
Forum rules
This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location (https://forum.dynare.org) where you will have to reset your password.

Re: particle filter dynare

Postby jpfeifer » Sun Oct 30, 2016 8:07 am

When downloading and installing the unstable version, you can find the up-to-date manual in the doc-folder. It's called dynare.pdf
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: particle filter dynare

Postby shengan28 » Wed Nov 02, 2016 12:12 am

By including mode_check, the mode check plots are created. How can we get the parameter trajectories and parameter densities plots to be created? I am able to create them with other estimation programs, but not this one.
shengan28
 
Posts: 13
Joined: Mon Jul 20, 2015 11:24 pm

Re: particle filter dynare

Postby jpfeifer » Wed Nov 02, 2016 8:49 am

Which estimation command exactly did you use?
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: particle filter dynare

Postby shengan28 » Tue Dec 27, 2016 1:55 am

I have been playing around with the linear_model.mod program.

See https://github.com/DynareTeam/dynare/blob/master/tests/particle/linear_model.mod

Are the option-options the new, or the old approaches to programming SMC.
For example,
Code: Select all
options_.particle.number_of_particles = 20000;
options_.particle.resampling.status = 'systematic';
options_.particle.resampling.neff_threshold = .1;


can also be programmed within the estimation command:

Code: Select all
estimation(order=2,nobs=100,mode_compute=8, mode_check,datafile=linear_model_data,mh_replic=0, filter_algorithm=sis, resampling=systematic, resampling_threshold=.1,  mode_file=linear_model_mode);


or more specifically, my question is which approach is preferable?

Also, is there documentation regarding these options?>
Code: Select all
options_.gstep(1) = 1e-4;
options_.gstep(2) = .1;

options_.mode_check_neighbourhood_size = 0.05;

set_dynare_threads('local_state_space_iteration_2',3);
shengan28
 
Posts: 13
Joined: Mon Jul 20, 2015 11:24 pm

Re: particle filter dynare

Postby jpfeifer » Tue Dec 27, 2016 6:37 am

In general, you can set any Dynare option manually the way you see it above. If you use the preprocessor interface, all it does is translate the commands to statements like the one above. The preprocessor interface is less prone to mistakes and therefore usually more preferable.

The gstep part is size of the gradient step used in numerical solvers.

Code: Select all
mode_check_neighbourhood_size
is in the manual.

set_dynare_threads is a command to
set the number of threads used by some MEX files when compiled
with OpenMP support (i.e with --enable-openmp is given to configure) or any
other parallel library.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: particle filter dynare

Postby shengan28 » Wed Dec 28, 2016 3:33 am

That is good insight. Thanks.

My next question has to do with programming Particle filters.
The command
Code: Select all
filter_algorithm=sis

is the sequential importance sampling. However, by adding

Code: Select all
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
Code: Select all
mode_compute=11
runs the on-line estimation. Does this option over ride the particle filters in the
Code: Select all
filter_algorithm=

command?
shengan28
 
Posts: 13
Joined: Mon Jul 20, 2015 11:24 pm

Re: particle filter dynare

Postby jpfeifer » Sun Jan 01, 2017 7:57 am

Concerning the first question on
Code: Select all
filter_algorithm=sis
and
Code: Select all
resampling=systematic
the answer is yes. And it is the default.
Code: Select all
resampling_threshold
only works with
Code: Select all
generic
and is useless with
Code: Select all
systematic
or
Code: Select all
none
. With
Code: Select all
apf
it induces a second resampling step on current particles which is not necessary. The literature then recommands
Code: Select all
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
Code: Select all
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.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: particle filter dynare

Postby shengan28 » Tue Jan 10, 2017 5:40 am

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.
shengan28
 
Posts: 13
Joined: Mon Jul 20, 2015 11:24 pm

Re: particle filter dynare

Postby jpfeifer » Tue Jan 17, 2017 11:23 am

Could you please provide the mod-file
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: particle filter dynare

Postby shengan28 » Sat Jan 21, 2017 7:27 pm

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 KiB) Downloaded 52 times


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
Code: Select all
mode_file=linear_model_mode
in the estimation command.

Thanks for looking into this bug.

~Shawn
shengan28
 
Posts: 13
Joined: Mon Jul 20, 2015 11:24 pm

Re: particle filter dynare

Postby jpfeifer » Mon Jan 23, 2017 11:21 am

You may try it again with the proposed change at https://github.com/DynareTeam/particles/pull/8
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Previous

Return to Dynare help

Who is online

Users browsing this forum: No registered users and 5 guests