preprocessing failed error

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.

preprocessing failed error

Postby anitazhang » Wed Jan 29, 2014 4:47 am

Dear all,
Thank you for help in advance! I really appreciate it. I run the attached dynare code with matlab but it shows that,

Code: Select all
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

Error using dynare (line 168)
DYNARE: preprocessing failed


Could anyone please tell me if there's something wrong with my dynare code, or with the matlab software?

Thanks!
Attachments
benchmark.mod
(1.9 KiB) Downloaded 108 times
anitazhang
 
Posts: 35
Joined: Sat Oct 05, 2013 12:02 am

Re: preprocessing failed error

Postby jpfeifer » Wed Jan 29, 2014 11:14 am

This is a bug in the Dynare preprocessor related to the external function you are using in the initval-block. We will get back to you. Thanks for reporting this.
------------
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: preprocessing failed error

Postby anitazhang » Thu Jan 30, 2014 5:23 pm

Thank you. I also attached the external functions used in my dynare code for your reference. Looking forward to your reply!

jpfeifer wrote:This is a bug in the Dynare preprocessor related to the external function you are using in the initval-block. We will get back to you. Thanks for reporting this.
Attachments
find_para.m
(1.84 KiB) Downloaded 82 times
fun_ss.m
(4.69 KiB) Downloaded 84 times
calibration.m
(1.76 KiB) Downloaded 91 times
anitazhang
 
Posts: 35
Joined: Sat Oct 05, 2013 12:02 am

Re: preprocessing failed error

Postby jpfeifer » Mon Feb 03, 2014 3:25 pm

The problem is that the preprocessor thinks that par is the name of a MATLAB function, because of the par(1) call. Then it crashes because using a function as an argument of fun_ss is not authorized. In the future, Dynare will provide a more explicit error message of the type

par is the name of a MATLAB/Octave function, and cannot be used as a variable.


You could avoid this by putting the whole par-part into a verbatim-block:
Code: Select all
verbatim;
[par1 target]=calibration;
par2=fsolve(@(x) find_para([par1 x(1) x(2)],target),[0.1,5]);//compute calibrated parameters to target steady state values
par=[par1 par2];//par=[delta, eta, alpha, psi, A,z,r_star,tau_f_star,tau_star,tau,theta,phi,sigma,Psi]
delta=par(1);
eta=par(2);
alpha=par(3);
psi=par(4);
A=par(5);
z=par(6);
r_star=par(7);
tau_f_star=par(8);
tau_star=par(9);
tau=par(10);
theta=par(11);
phi=par(12);
sigma=par(13);
Psi=par(14);
end;

That way, par is hidden from Dynare and does not create confusion.

But this brings us to the next issue. You cannot use arbitrary auxiliary variables (F here) in the initval-block. Given that you want to use a function call in every interation to set an auxiliary variable, I am afraid you must use an explicit steady state-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: preprocessing failed error

Postby anitazhang » Thu Feb 06, 2014 4:59 am

Thank you for your reply. I now used the verbatim-block and used the steady-state-model block. However, when I run the dynare file, it says that
Warning: Some of the parameters have no value (delta, eta, alpha, psi, A, z, r_star,
tau_f_star, tau_star, tau, theta, phi, sigma, Psi) when using steady. If these
parameters are not initialized in a steadystate file, Dynare may not be able to solve
the model...


It seems the parameter values specified in the verbatim-block is not identified in the stead-state-model block. How can I solve this problem? please see attached as the updated dynare codes and functions.

Thanks a lot.


jpfeifer wrote:The problem is that the preprocessor thinks that par is the name of a MATLAB function, because of the par(1) call. Then it crashes because using a function as an argument of fun_ss is not authorized. In the future, Dynare will provide a more explicit error message of the type

par is the name of a MATLAB/Octave function, and cannot be used as a variable.


You could avoid this by putting the whole par-part into a verbatim-block:
Code: Select all
verbatim;
[par1 target]=calibration;
par2=fsolve(@(x) find_para([par1 x(1) x(2)],target),[0.1,5]);//compute calibrated parameters to target steady state values
par=[par1 par2];//par=[delta, eta, alpha, psi, A,z,r_star,tau_f_star,tau_star,tau,theta,phi,sigma,Psi]
delta=par(1);
eta=par(2);
alpha=par(3);
psi=par(4);
A=par(5);
z=par(6);
r_star=par(7);
tau_f_star=par(8);
tau_star=par(9);
tau=par(10);
theta=par(11);
phi=par(12);
sigma=par(13);
Psi=par(14);
end;

That way, par is hidden from Dynare and does not create confusion.

But this brings us to the next issue. You cannot use arbitrary auxiliary variables (F here) in the initval-block. Given that you want to use a function call in every interation to set an auxiliary variable, I am afraid you must use an explicit steady state-file.
Attachments
fun_ss_dynare.m
(4.64 KiB) Downloaded 89 times
find_para.m
(1.84 KiB) Downloaded 84 times
calibration.m
(1.76 KiB) Downloaded 91 times
benchmark.mod
(1.83 KiB) Downloaded 88 times
anitazhang
 
Posts: 35
Joined: Sat Oct 05, 2013 12:02 am

Re: preprocessing failed error

Postby jpfeifer » Thu Feb 06, 2014 10:42 am

Try working with the attached file
Attachments
benchmark.mod
(1.81 KiB) Downloaded 138 times
------------
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


Return to Dynare help

Who is online

Users browsing this forum: Google [Bot] and 7 guests