Running dynare in a matlab function

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.

Running dynare in a matlab function

Postby Saint1106 » Fri Dec 07, 2012 4:18 am

I am trying to optimize welfare for a set of parameters in dynare.
I would like to run the dyname .m file with a function statement, which would have as output the Welfare index.
Apparently dynare does not execute within the function. Is there a trick to remedy this, to get dynare to run within a matlab function statement?
My procedure is to change a parameter, insert it into "load_initial_values" matrix in the dynare program, then execute the dynare .m file,
and then compute welfare. I have a series of optimization functions (simulated annealing and the genetic algorithm) which I would like to use.
Thanks, Paul McNelis
Saint1106
 
Posts: 11
Joined: Wed Feb 23, 2005 12:37 pm

Re: Running dynare in a matlab function

Postby HoutanBastani » Fri Dec 07, 2012 9:56 am

What do you mean by "function statement"? Do you mean function?

Why do you say that dynare won't execute within a function?

Can you post your code?
Best,
Houtan
HoutanBastani
 
Posts: 197
Joined: Fri Jan 22, 2010 4:11 pm
Location: Paris, France

Re: Running dynare in a matlab function

Postby SébastienVillemot » Wed Jan 09, 2013 5:23 pm

Normally you should be able to run dynare within a MATLAB function. To retrieve results, just copy them back from the global oo_ structure.
Sébastien Villemot
Economist at OFCE – Sciences Po
SébastienVillemot
 
Posts: 706
Joined: Fri Dec 07, 2007 2:29 pm
Location: Paris, France


Return to Dynare help

Who is online

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