Question: Multi-Country-Model

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.

Question: Multi-Country-Model

Postby kanimbla » Mon Apr 22, 2013 3:57 pm

Dear all,

I have a question regarding the coding for a multi-country model. Suppose I have 4 countries with the following declarations for my countries and variables

@#define countries = [ "a", "b", "c", "d" ]

@#for co in countries
var w_@{co} c_@{co};


For the model declaration, I would like to include a set of equations that has the following structure:

c_a(+1) - c_b(+1)) = c_a - c_b
c_a(+1) - c_c(+1)) = c_a - c_c
c_a(+1) - c_d(+1)) = c_a - c_d

and in addition:

w_b + w_c + w_d = c_a - c_b
w_b + w_c + w_d = c_a - c_c
w_b + w_c + w_d = c_a - c_d


I would be very happy to get a hint how a structure like this can be coded up in Dynare.

Thanks,
kanimbla
kanimbla
 
Posts: 18
Joined: Sat Jan 14, 2012 8:55 am

Re: Question: Multi-Country-Model

Postby mghazias » Tue Apr 23, 2013 3:15 pm

I had the same problem and couldn't find anyway to do it in loops,
you can separate independent equations from interrelated ones. do independent ones in loops and bring the rest at the end after your loop.
mghazias
 
Posts: 19
Joined: Mon Oct 22, 2012 12:49 am

Re: Question: Multi-Country-Model

Postby kanimbla » Tue Apr 23, 2013 6:02 pm

Thanks for your message!

I found a way for the first three equations by defining a second group of countries:

@#define group = [ "b", "c", "d" ]

and then write a loop:

@#for gr in group
c_a(+1) - c_@{gr}(+1)) = c_a - c_@{gr}
@#endfor
kanimbla
 
Posts: 18
Joined: Sat Jan 14, 2012 8:55 am

Re: Question: Multi-Country-Model

Postby Oriana » Sun Mar 22, 2015 4:11 pm

Hi,

I am trying to convert a two country model into a three country model. I already can run the former model despite both countries are not in autarky.

The uncovered interest rate parity condition for the two country version is: :

exp(c2lambdaq_pot(+1))/exp(c2lambdaq_pot)*exp(c2rpcpd_pot(+1))/exp(c2rpcpd_pot) =(exp(
c1phibparm*c1b_pot))*exp(c1rer_pot(+1))/exp(c1rer_pot)*exp(c1lambdaq_pot(+1))/exp(c1lambdaq_pot)*exp(c1rpcpd_pot(+1))/exp(c1rpcpd_pot);

So, I supposed that for a third country would be :

exp.(c2lambdaq_pot(+1))/exp(c2lambdaq_pot)*exp(c2rpcpd_pot(+1))/exp(c2rpcpd_pot) =(exp(
c3phibparm*c3b_pot))*exp(c3rer_pot(+1))/exp(c3rer_pot)*exp(c3lambdaq_pot(+1))/exp(c3lambdaq_pot)*exp(c3rpcpd_pot(+1))/exp(c3rpcpd_pot);

Nevertheless, I still have a few equations with residues different from zero mainly associated with the international links blocs .

I must confess my lack of knowledge in this matter.
Could someone, please, give me a help or send me some references about the subject.
Attachments
nonlinearomega-2.zip
(601.77 KiB) Downloaded 53 times
Oriana
 
Posts: 67
Joined: Fri Jul 18, 2014 2:49 pm

Re: Question: Multi-Country-Model

Postby Oriana » Mon Mar 23, 2015 1:55 pm

I know this is a rather complex issue but I would highly appreciate any help in this matter, please!
Oriana
 
Posts: 67
Joined: Fri Jul 18, 2014 2:49 pm

Re: Question: Multi-Country-Model

Postby jpfeifer » Mon Mar 23, 2015 3:51 pm

If all countries are symmetric, you should get the same steady state values for each country. Thus, going from the running two country to the three country version should be straightforward. If this is not the case and you encounter residuals, there must be a mistake in your model equations.
------------
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

Re: Question: Multi-Country-Model

Postby Oriana » Mon Mar 23, 2015 4:19 pm

Yes, all countries are symmetric. In my view the problem arises from equations such as the clearing oil market… Actually I put these equations all together at the end of my model bloc, so they are quite easy to identify. I understand, however, that Professors have other things to do than to resolve students' s problems.
In any case I am sincerely grateful for the reply.
Oriana
 
Posts: 67
Joined: Fri Jul 18, 2014 2:49 pm

Re: Question: Multi-Country-Model

Postby jpfeifer » Tue Mar 24, 2015 9:32 am

Actually, that's not completely true. It is the job of professors to help resolve their own students' problems. So if you have a supervisor, ask him for help. He may have more time for you than I have.

It seens you uploaded the wrong code. It looks like a two country model. One thing that is definitely wrong is the incorrect accounting for parameter dependence. See e.g. http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=5999
------------
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 10 guests