Page 1 of 1

How to continue the Simulated annealing when Dynare stops?

PostPosted: Thu Mar 08, 2012 11:55 pm
by yvette-hyq
Hi...
I am doing estimation using Simulated Annealing. In every iteration, model would be simulated using Dynare with different set of parameters. But once it encounters a set of parameters which cannot satisfy the rank condition, Dynare stops and the whole simulation is stopped.
Is there a way I can skip this run, and continue the annealing program for next iteration?
I did try to put a 'if' after Dynare file. For example:

Dynare file_name
load file_name_results
if ~isfield(oo_.dr,'ghx')
objective = 10000000000000000;
else
......(carry on my program)
end

But it doesn't work. Can anyone please let me know how can I solve this problem.
Thanks a lot.

Re: How to continue the Simulated annealing when Dynare stop

PostPosted: Fri Mar 09, 2012 12:21 pm
by yvette-hyq
Continue my post....
Or is there a code in Dynare to check the rank condition before it runs fully, so I can write a code to skip the set of parameters that cannot justify the rank condition and carry on the next iteration?

please..if anyone knows how to do...Really appreciate..

Re: How to continue the Simulated annealing when Dynare stop

PostPosted: Fri Mar 09, 2012 5:36 pm
by jpfeifer
If you run Dynare in a loop, embed the Dynare call in a Matlab "try-catch"-statement.

Re: How to continue the Simulated annealing when Dynare stop

PostPosted: Mon Mar 12, 2012 1:55 pm
by yvette-hyq
Thank you soooooooooo much...It works.