Page 1 of 1

Smets and Wouter(2007) code from JohannesPfeifer

PostPosted: Sat Apr 16, 2016 7:59 am
by jykim
Hi, I am using Dynare 4.3.3 version now. I want to replicate the model of Smets and Wouters(2007) and because their code is not compatible with Dynare 4.3.3
I used the code from JohannesPfeifer's website. I also added and adjust some dynare file using the ones on his website such as 'dynare_estimation', 'dynare_estimation1', 'dynare_estimation_init' and add 'add_path_to_mex_files.m' into the folder because I've got some error message from the functions when I run his code. However, I still have problem that I cannot figure it out.
When I run "Smets_Wouters_2007.mod" I have following error message.

Configuring Dynare ...
[mex] Generalized QZ.
[mex] Sylvester equation solution.
[mex] Kronecker products.
[mex] Sparse kronecker products.
[mex] Local state space iteration (second order).
[mex] Bytecode evaluation.
[mex] k-order perturbation solver.
[mex] k-order solution simulation.
[mex] Quasi Monte-Carlo sequence (Sobol).
[mex] Markov Switching SBVAR.

Using 64-bit preprocessor
The system cannot find the path specified.

Error using dynare (line 217)
DYNARE: preprocessing failed


Could you help me out?

I attached the files regarding to this error.

Re: Smets and Wouter(2007) code from JohannesPfeifer

PostPosted: Sat Apr 16, 2016 4:09 pm
by jpfeifer
You cannot selectively replace individual files from Dynare 4.4.3. Why can't you use that version unaltered?

Re: Smets and Wouter(2007) code from JohannesPfeifer

PostPosted: Sat Apr 16, 2016 7:55 pm
by jykim
When I use unaltered dynare 4.4.3 version. There are a lot of error messages. Followings are the error messages I have got from the code.

Error using union
Too many input arguments.

Error in dynare_estimation_init (line 347)
k2 = union(var_obs_index,[M_.nstatic+1:M_.nstatic+M_.nspred]', 'rows');

Error in dynare_estimation_1 (line 81)
[dataset_,xparam1, hh, M_, options_, oo_, estim_params_,bayestopt_] = dynare_estimation_init(var_list_,
dname, [], M_, options_, oo_, estim_params_, bayestopt_);

Error in dynare_estimation (line 89)
dynare_estimation_1(var_list,dname);

Error in Smets_Wouters_2007 (line 505)
dynare_estimation(var_list_);

Error in dynare (line 180)
evalin('base',fname) ;


So I thought I needed to change some files to the ones that are on your website.

Re: Smets and Wouter(2007) code from JohannesPfeifer

PostPosted: Sun Apr 17, 2016 8:05 am
by jpfeifer
There is a path conflict here. You have some other Matlab file called union.m that has priority over the one Dynare wants to use.
Please try
Code: Select all
which union

in the Matlab command window after the crash to see which file this is and then remove the corresponding path from your Matlab path.

Re: Smets and Wouter(2007) code from JohannesPfeifer

PostPosted: Sun Apr 17, 2016 9:07 am
by jykim
Awesome! It works now.
Thank you for your help!