Parameters within parameters

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.

Parameters within parameters

Postby r.mcmanus » Tue Sep 20, 2011 10:24 am

Hello,

I have been trying to work something out for a little while and can still not find an answer. It is quite trivial, and that is why I have not asked on the forum before, but at the same time presumably the answer is quite trivial and (hopefully) easily explained; therefore I figured I would finally just ask.

The problem I am having is that when I set up a model which includes parameters that are a function of other calibrated parameters I can only effectively go for one step. For example, I can have:

Code: Select all
parameters alpha beta gamma;
alpha = 1;
beta = 2;
gamma = a/(alpha*beta);
epsilon = 3;


But I cannot have:

Code: Select all
paramets alpha beta gamma delta;
alpha = 1;
beta = 2;
delta = 1lpha*beta;
gamma = 1/delta;
epsilon = 3;


becauce delta is a function of gamma which is itself a function of alpha and beta.

Now, although this annoyed me at first, doing the former rather than the latter is simple enough (although it makes things harder when checking my coding). However, when I start to loop certain parameters the operation does not work if for example I loop alpha, but would work if I loop another parameter that does not then subsequently go into other parameters, epsilon for example.

I figured that the two problems were probably coming from the same route and thought that it would be best to check whether there was a simple enough answer.

Many thanks,
Richard.
r.mcmanus
 
Posts: 2
Joined: Fri Aug 12, 2011 12:34 pm

Re: Parameters within parameters

Postby SébastienVillemot » Wed Sep 28, 2011 1:16 pm

r.mcmanus wrote:But I cannot have:

Code: Select all
paramets alpha beta gamma delta;
alpha = 1;
beta = 2;
delta = 1lpha*beta;
gamma = 1/delta;
epsilon = 3;


becauce delta is a function of gamma which is itself a function of alpha and beta.


What do you mean by "I cannot have"? This code should work in Dynare, since the assignation sequence is recursive (note that you wrote "1lpha" while you probably meant "alpha")

Now, although this annoyed me at first, doing the former rather than the latter is simple enough (although it makes things harder when checking my coding). However, when I start to loop certain parameters the operation does not work if for example I loop alpha, but would work if I loop another parameter that does not then subsequently go into other parameters, epsilon for example.


If you change the value of a parameter that enters the expression for another one (alpha for example), then you have to explicitely tell Dynare to update this other parameter by writing again the assignment expression. Dynare does not automatically updates parameters which depends on others.

Best,
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: No registered users and 13 guests