Passing variables to the dynare command

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.

Passing variables to the dynare command

Postby Dr. En Ami » Mon Jul 08, 2013 11:24 pm

Thanks for the previous help. I would like to run estimation with forecast for different firstObs values. For example, I might like to call estimation n times with firstObs=i for i = 1:n for some user defined n. How can I do this is an automated fashion short of using meta code? Is there a way to pass variables to the dynare command? Thank you, --En
Dr. En Ami
 
Posts: 18
Joined: Sat Jul 06, 2013 11:19 pm

Re: Passing variables to the dynare command

Postby jpfeifer » Sat Sep 14, 2013 8:38 am

You could use the macro language. For fs2000.mod you would require something like
Code: Select all
@#define total_obs = [191,190,189,188]

@#for start_obs in 1:4
estimation(order=1, datafile=fsdat_simul,first_obs=@{start_obs},nobs=@{total_obs[start_obs]},loglinear, mh_replic=2000, mh_nblocks=2, mh_jscale=0.8);
save results_@{start_obs};
@#endfor
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 8 guests