How to save dynare results in loop into a specified matrix

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.

How to save dynare results in loop into a specified matrix

Postby lizeze » Thu Dec 27, 2007 2:43 am

I do a loop in which dynare run 100 times, at the same time I want save the same name series into a specified matrix. forexample,
for i=1:100
dynare <filename.mod>
k(i,:) = y %y is series generated by dynare
end
I found it cannot work because dynare refreshs the workspace in matlab everytime, so result show k is not definded and cannot store the y.
who can help me to save dynare results very run into a fixed name matrix?

best regards
lizeze
lizeze
 
Posts: 7
Joined: Wed Nov 21, 2007 11:18 am

Postby reubenpjacob » Tue Jan 01, 2008 1:09 pm

not quite clear what u want to do.
i usually run loops within the mod file.
then matrices appear in the workspace, and those can be easily saved into our own arrays or matrices.
reubenpjacob
 
Posts: 133
Joined: Fri Oct 06, 2006 3:23 pm
Location: Reserve Bank of New Zealand

Postby tomiw » Wed Jan 09, 2008 3:40 pm

you can simply define a vector/matrix/structure with length N in the mod-file which stores the underlying results in each step n and (important) SAVES the object for each step as a mat-file so that you can obtain your object after the loop is done.

greets, tomi
tomiw
 
Posts: 8
Joined: Sun Nov 19, 2006 4:19 pm

Postby agupta28 » Thu Jun 12, 2008 9:17 pm

Hi tomi,

It is not clear to me how to write loops within the mod file. Could you please post an example where you do this. I am particularly interested in running a loop in which dynare uses the parameter values from the posterior distribution saved in the matrix *_mh*_blck*.mat to calculate the policy and transition function under each new draw.

Thanks.
abhishek.
abhishek
agupta28
 
Posts: 29
Joined: Tue Mar 04, 2008 2:17 am


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 7 guests