Page 1 of 1

Running loops and error message

PostPosted: Sun Feb 22, 2015 4:23 pm
by iacoviel
When I try running dynare in a loop, I sometimes get this error message

-----------
Processing outputs ...ERROR: Can't open file filename_static.m for writing

??? Error using ==> dynare at 114
DYNARE: preprocessing failed
--------------

Is there any way to avoid this? I have tried in some cases with success to slow down the execution of the loop, but that defeats a little bit the purpose. Any other suggestions?

Re: Running loops and error message

PostPosted: Sun Feb 22, 2015 6:48 pm
by jpfeifer
Dear Matteo, what exactly are you trying to accomplish? Running the Dynare preprocessor within a loop is seldom necessary and very inefficient. Do you really want to recreate all Dynare files or are you only varying parameters within a loop? You can also send me the files in question per email so that I can provide you with more detailed feedback.

Best,

Johannes

Re: Running loops and error message

PostPosted: Fri Feb 27, 2015 4:11 am
by iacoviel
Hi Johannes

Your reply helped a lot and convinced me to bypass the pre-processor. I eventually managed to bypass invoking the pre-processor every time.

Every time I have to learn it again. Maybe for next time is there a handy reference on how to loop over parameters?

Thanks a lot

Re: Running loops and error message

PostPosted: Fri Feb 27, 2015 7:24 am
by jpfeifer
Dear Matteo,

currently, the best reference is http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=4891. Better documenting this is on my to do list for my "Guide to Observation Equations".