inputting shocks through a loop

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.

inputting shocks through a loop

Postby maile » Wed Mar 08, 2006 8:44 am

Dear all

Is there a way to read in the shock_files in a loop, because I want to do some simulations where I read in the shocks from 1000 different files. I've tried using the eval function with a for loop, but this doesn't seem to work, I think because there is an equals sign in there:
Example:

for i=1:10
first='shocks';
second=['(shocks_file=shocks',int2str(i)] ;
third=')' ;
eval([first,second,third] );
//shocks(shocks_file=shocks2);
var eps;
periods 1;
values 0;
end;
simul(periods=40);
format long
end;

Another way I was thinking it might to be able to be done is that if I have one matrix with all shocks in it, can I set for example:

var eps=shock(1,1)

to set eps as the first element of the shock matrix?

I think whenever dynare starts running it clears the workspace so I haven't been able to do it this way. Is there a way of stopping it clearing the workspace?

Thank you
Mai
maile
 
Posts: 4
Joined: Mon Apr 18, 2005 12:25 pm

Return to Dynare help

Who is online

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