Page 1 of 1

Sometimes it runs, sometimes it doesn't

PostPosted: Tue Jul 07, 2015 8:26 pm
by asidorov
Dear everybody,

I am a beginner and struggeling at the moment with the following problem:
Sometimes my code runs and sometimes it doesn't, sometimes it gets only through the half of the iterations required before it crashes.
At all times I get the same answer:

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

Error using dynare (line 174)
DYNARE: preprocessing failed

Error in Paper_bank_run (line 189)
dynare Paper_bank_run_DSGE noclearall

The problem lies within the second half (unanticipated run) of the matlab file, the first one works just fine (at least it seems that way). The second one calls the paper_bank_run_DSGE.mod file as part of its iteration process and that's where the 'fun' begins.

I would appreciate any suggestions! Thanks a lot in advance.

Re: Sometimes it runs, sometimes it doesn't

PostPosted: Wed Jul 08, 2015 3:30 am
by jpfeifer
I am not sure what you are actually iterating over, but if you call Dynare repeatedly, the preprocessor may be faster than your harddisk so that it tries to create files that your system is still deleting. If you cannot build your loop without running the preprocessor several times, it might be necessary to give the harddisk more time by adding a
Code: Select all
pause

command from Matlab. Try one second first.

Re: Sometimes it runs, sometimes it doesn't

PostPosted: Wed Jul 08, 2015 7:25 am
by asidorov
Thank you very much Johannes, it did the trick! As usual, the solution is pretty straightforward now that I know it^^

Just a short explanation to the file: It's about to become a model of a sunspot equilibrium, a 'random state' in which the bank is thrown and that triggers a bank run. Therefore I need to 'construct' a new path backwards from the steady state to the bank run (which happens after a shock). But there are still a few bugs, of course. But thanks to you I am on them now - previously I just couldn't see what I got^^