put dynare *.mod in 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.

put dynare *.mod in a loop

Postby xuenanli » Sat Apr 09, 2011 3:34 am

Dear all,

I need to put the "dynare *.mod" operation inside a loop. In each loop, I solve the model with different parameter values and simulate a panel of artificial data using the solution. Since nothing is changed in each loop except the parameters and I calculate the steady state with my own m-file, I am thinking to do the following to save computational time: compile the mod file once at the beginning to generate the corresponding m file. Afterwards, within each loop, I change the parameter values directly in M_.params and just run the m file in the loop. Can you let me know whether this procedure will give me the correct solutions?

Thank you for your help!
Erica
xuenanli
 
Posts: 4
Joined: Tue Dec 28, 2010 2:03 pm

Re: put dynare *.mod in a loop

Postby SébastienVillemot » Tue Apr 19, 2011 9:51 am

This might work, but you will probably need to look at some Dynare internals to make sure everything is working as expected.

I am actually not sure that there is much to gain from this procedure: the preprocessor is quite efficient and runs in a negligible time.
Sébastien Villemot
Economist at OFCE – Sciences Po
SébastienVillemot
 
Posts: 706
Joined: Fri Dec 07, 2007 2:29 pm
Location: Paris, France

Re: put dynare *.mod in a loop

Postby xuenanli » Tue May 17, 2011 2:56 pm

Thanks a lot for your help! I will compare the results from both methods. You are probably right. I will check on the time saved to see whether it is worthwhile.
Best,
Erica
xuenanli
 
Posts: 4
Joined: Tue Dec 28, 2010 2:03 pm

Re: put dynare *.mod in a loop

Postby aghaly » Thu Mar 08, 2012 5:14 pm

Hi everybody,
i'm currently doing a similar stuff. Actually I run a mod file inside which I have a loop over a parameter "sigma" and similate the model for each value of this parameter. I'm particularly interested in the standard deviations of the endogenous variables.

How could you get these moments at the same time with the corresponding parameter "sigma" ?

Many thanks in advance.
aghaly
 
Posts: 16
Joined: Fri Mar 26, 2010 4:56 pm


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 4 guests

cron