Neglecting Error Messages

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.

Neglecting Error Messages

Postby timbuyse » Thu Dec 01, 2011 3:53 pm

Hello,

I am trying to run dynare as part of another .m file in Matlab. This .m file is built to give certain parameter values to Dynare, after which I let dynare compute the steady state for my model. In a second step, I want to use these steady state values for computations, which are stated in the original .m file. However, It is clear that for some parameter value combinations, Dynare gives an error message (maxit reached, or others) because these combinations are not compatible with a steady state. I now this in advance that I will get an error for some combinations of parameter values.

Now, in case of an error, Dynare interrupts the procedure and gives no values for the steady state (as there is no steady sate), hence my original .m file can not continue working. I would like to solve this as follows:

In case there is an error of any kind, I would like that Dynare gives me some output for the steady state (like 'NA' or '0') , without interrupting the original .m file.


I was wondering if there is any way to realize this.

Thanks,

Tim.
timbuyse
 
Posts: 4
Joined: Fri Feb 19, 2010 3:52 pm

Re: Neglecting Error Messages

Postby jpfeifer » Thu Dec 01, 2011 7:25 pm

A possibility is to use "try ... catch". See http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=3069
------------
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: Neglecting Error Messages

Postby timbuyse » Fri Dec 02, 2011 8:56 am

Thanks a lot for the quick reply!
timbuyse
 
Posts: 4
Joined: Fri Feb 19, 2010 3:52 pm


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 13 guests