Smets and Wouter(2007) code from JohannesPfeifer

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.

[quote]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
[/quote]

Could you help me out?

I attached the files regarding to this error.
dynare.m (7.76 KB)
Smets_Wouters_2007.mod (7.17 KB)

You cannot selectively replace individual files from Dynare 4.4.3. Why can’t you use that version unaltered?

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.

[quote]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) ;[/quote]

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

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

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

Awesome! It works now.
Thank you for your help!