GETTING M-FILE INTO MOD-FILE

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.

GETTING M-FILE INTO MOD-FILE

Postby nsouzas » Wed Jan 27, 2010 7:09 pm

Dear all,

I have a large model with hundreds of parameters and I would like to set the parameter values in a separate file (preferably an m-file) instead of in the mod-file directly.
However, it seems that the mod-file in dynare version 4 does not read m-files. Is that right? If not, could you please tell me how I could proceeed?

My best regards and many thanks for you help.

nsouzas

p.s.: I've already tried saving the parameter values in the m-file (using the command "save filename") and then loading them into the mod-file (using the command "load filename"). Even though this works, this solution is not that good for my purposes.
nsouzas
 
Posts: 16
Joined: Fri Jun 29, 2007 1:16 am

Re: GETTING M-FILE INTO MOD-FILE

Postby Maren » Wed Jan 27, 2010 8:49 pm

Is this separate m-file containing steady state values of your model? If so, the mod-file automatically reads it before the command steady every time, by checking the directory where the mod-file is saved for a file called nameofthemodfile_steadystate.m, if this m-file does not contain the steady state values maybe there is still a similar way to do it
Maren
 
Posts: 6
Joined: Tue Dec 08, 2009 10:32 pm

Re: GETTING M-FILE INTO MOD-FILE

Postby Thorsten » Fri Jan 29, 2010 6:42 am

Hey,

I think you could simply you a scalar-valued Matlab function to input your parameter in a mod.-file. This definitely works, but you might want to automatize the process of creating the functions first. Anyway, try something along these lines:

...
my_parameter=my_function;
...

where you have a separate m.file containing

function output=my_function;
output=0.5;

Best,
Thorsten
Thorsten
 
Posts: 9
Joined: Mon Sep 14, 2009 9:28 pm


Return to Dynare help

Who is online

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