Gali and Monacelli 2008

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.

Gali and Monacelli 2008

Postby xyz » Fri Dec 11, 2015 4:13 pm

Hello everybody,

I am trying to replicate “Optimal monetary and fiscal policy in a currency union” by Gali and Monacelli (2008). I am new to Dynare and I do not know how to solve my problem.

I get this error message:

Error using print_info (line 80)
The steady state contains NaN or Inf
Error in steady (line 92)
print_info(info,options_.noprint, options_);
Error in gali_monacelli_2008 (line 240)
steady;
Error in dynare (line 180)
evalin('base',fname) ;

Attached you find my code.

It would be great if somebody could help me. Many thanks in advance for your help.

Kind regards
Attachments
gali_monacelli_2008.mod
(6.33 KiB) Downloaded 338 times
xyz
 
Posts: 12
Joined: Fri Dec 11, 2015 2:33 pm

Re: Gali and Monacelli 2008

Postby xyz » Fri Dec 18, 2015 11:18 am

Hello again,

I still have problems with my mod file. I divided the model into two separate mod files, one for the country and one for the currency union, in order to see what is going wrong.

The currency model is now running, but I cannot figure out my mistake in case of the country model. I tried to use the mod file of Prof. Pfeifer for the Gali and Monacelli (2005) model as a guidance.

Attached you find both mod files.

Some advice would be very helpful. Many thanks in advance.

Kind regards
Attachments
gali_monacelli_2008_country.mod
(4.38 KiB) Downloaded 254 times
gali_monacelli_2008_union.mod
(3.41 KiB) Downloaded 260 times
xyz
 
Posts: 12
Joined: Fri Dec 11, 2015 2:33 pm

Re: Gali and Monacelli 2008

Postby jpfeifer » Sun Dec 20, 2015 2:50 pm

Are you sure this split is possible. Shouldn't there an equation linking the two blocks that will be undetermined when you separate the two?
------------
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: Gali and Monacelli 2008

Postby xyz » Mon Dec 21, 2015 5:16 pm

I tried to simplify the linking equation in order to avoid that problem. Of course, there might be a mistake.

Unfortunately, I still have not managed to get the complete model running. I got rid of some equations, but there is still an error in the system of equations such that dynare cannot find the steady states for the equations 1. - 16. (except 10.).

Do you have any idea how to solve that?

Kind regards
Attachments
g_m_2008.mod
(6.32 KiB) Downloaded 266 times
xyz
 
Posts: 12
Joined: Fri Dec 11, 2015 2:33 pm

Re: Gali and Monacelli 2008

Postby jpfeifer » Wed Dec 23, 2015 9:08 am

Put
Code: Select all
resid;

before steady to see the residuals of the equations. The problem with Gali's papers is that some of his linearized equations still contain constant terms and you need to make this consistent. For example,
Code: Select all
rr_star=rho_a+(y_bar_star(+1)-y_bar_star);            //9. Union's natural level of interest rate, p.126

implies that rr_star has steady state rho_a.
You will need something like
Code: Select all
initval;
rr_star=rho_a;
r_star=rho_a;
g_bar_star = log(BigChi);
f_gap_star = -log(BigChi);
end;

But this alone will not be sufficient, because I think there is still something wrong with some 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: Gali and Monacelli 2008

Postby xyz » Wed Dec 23, 2015 9:17 pm

Dear Mr.Pfeifer,

thank you very much for your help.

Would you be so kind to explain me the meaning of the residuals here? What problems do the constant terms in the linearized equations cause? Is it that I am dividing by zero or something like this?

Unfortunately, I think you are right, there is something wrong with the equations as well...

Merry Christmas and kind regards,
xyz
xyz
 
Posts: 12
Joined: Fri Dec 11, 2015 2:33 pm

Re: Gali and Monacelli 2008

Postby jpfeifer » Sat Dec 26, 2015 10:12 am

The residuals are the difference between the left and the right side of your equations, given the 0 starting values you provide. They show that some variables are not mean 0. This is per se not a problem in linear models, but you need to take care of this constant term in every equation that is affected.
------------
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: Gali and Monacelli 2008

Postby xyz » Tue Dec 29, 2015 11:10 am

Thank you Mr.Pfeifer. I think, I adjusted my mod file for the constant equations you mnetioned but it is still not working. Can you help me to find the mistake in my equations? I really do not know how to start finding the problem...

Thanky you very much in advance.

Kind regards
Attachments
g_m_2008.mod
(6.59 KiB) Downloaded 264 times
xyz
 
Posts: 12
Joined: Fri Dec 11, 2015 2:33 pm

Re: Gali and Monacelli 2008

Postby chowshangyao » Thu Dec 31, 2015 2:38 pm

i rewrite your code after reading the article you referred. And the consequence of code simulation is same as the article.excuse my bad english
Attachments
untitled3.mod
(2.22 KiB) Downloaded 297 times
chowshangyao
 
Posts: 4
Joined: Tue Dec 29, 2015 10:43 am

Re: Gali and Monacelli 2008

Postby xyz » Sat Jan 02, 2016 5:31 pm

Dear chowshangyao, thank you very much for your help.

If I understand it correctly, you implemented the equations describing the optimal policy, right? My problem is, that if I manage to get the baisc model working, I want to add some government debt policies to the model. Thus, I think, I would have to recalculate the optimality conditions, right? In order to avoid that problem, I would like to base my mod-file on the equations describing the economy, and not on the optimality conditions. Does that make sense to you?

Do you have (or anybody else) any suggestions to get my model running? I think, I need to include the monetary union, don't I ? I would really appreciate any hints or suggestions!

Thank you very much in advance.

Kind regards
xyz
 
Posts: 12
Joined: Fri Dec 11, 2015 2:33 pm

Re: Gali and Monacelli 2008

Postby chowshangyao » Mon Jan 04, 2016 7:36 pm

i see what you mean.Some variables like nominal interest_rate and government expenditure are exogenous, optimal condition just determine the unique path for them.So giving any specific path to these exogenous variables can make the basic model working.

back to the topic , i guess some equations like p - p(-1) = ppi make the code cannot work.So i add the risk sharing condition (c = c_star + (1- alpha*s) )into the model for solving the path of domestic consumption c and terms of trade s (As the equilibrium of union is independent to country i ,and the path of y_gap and f_gap ppi can be derived only by using equation(1) phillips curve and (2) Is curve. so the path of y_star c_ star y is known , and we can derive the c and s by using country i's market clearing and risk sharing condition).

Dropping some equations can make it works.But even if i add one equation like p - p(-1) = ppi will also make it unworkable .It troubles me a lot.
There also has another thing troubles me that the steady value of some variables which should equal to zero are just close to 0 but not 0.
Attachments
g_m_2008.mod
(6.52 KiB) Downloaded 305 times
chowshangyao
 
Posts: 4
Joined: Tue Dec 29, 2015 10:43 am

Re: Gali and Monacelli 2008

Postby chowshangyao » Mon Jan 04, 2016 7:48 pm

i had wrote a polite reply before ,but i forget to login ...And it's already 03:00 am in my country .If there are any inappropriate words ,please forgive me .
chowshangyao
 
Posts: 4
Joined: Tue Dec 29, 2015 10:43 am

Re: Gali and Monacelli 2008

Postby xyz » Wed Jan 06, 2016 9:31 am

Dear chowshangyao, thank you very much for working so much on my code. You really helped me a lot as the code is running now.

Nonetheless, I do not really understand why these equations cause so much trouble. Does anybody understand this? Unfortunately, I think, the simulations based on your code do not produce the correct impulse response functions, do they? The output gap and the fiscal gap behave in the opposite way...

Kind regards
xyz
 
Posts: 12
Joined: Fri Dec 11, 2015 2:33 pm

Re: Gali and Monacelli 2008

Postby chowshangyao » Wed Jan 06, 2016 12:19 pm

Of course the simulation will be different . Because we define the government expenditure as g_star = BigChi*a_star , but the original(gali(2008) is g_star = log(BigChi) + a_star.
From the original we can see g_gap_star = 0 for all period ,and the fiscal gap will satisfy f_gap_star = - y_gap_star(which can be regarded as the optimal fiscal policy).
But our code's fiscal gap is f_gap_star = (g_star - y_star ) - log(BigChi) = (BigChi-1)*a_star - log(BigChi) - y_gap_star.On the other hand , the exogenous shocks may be badly defined,thus the irf works weirdly.
From above, it's obvious to see the reason why the consequence of our simulation is different from gali(2008).But i haven't test it and cannot make sure whether it can be fixed only by modifying the path of government expenditure.
chowshangyao
 
Posts: 4
Joined: Tue Dec 29, 2015 10:43 am

Re: Gali and Monacelli 2008

Postby xyz » Thu Jan 07, 2016 3:39 pm

Dear chowshangyao,

I adjusted the path for government expenditure to g = log(BigChi)+a (where in the paper do you find this?), and I get g_gap = 0 and f_gap= -y_gap. Thus, I think, this is working now.
But looking at the impulse response functions pictured in the paper, this does not seem to hold. There, y_gap initially drops to -0.2 whereas f_gap rises to 2.. Is the related to how the shock is specified? The paper simulates a 1 percent rise in productivity. Do you know how to model that?

I have an additional question on modifying the model. Do you think it is possible to implement a debt target and a government spending path to reduce the outstandig debt to that level in order to model a government debt policy (spending cut)?

Thank you very much for your help. I am new to dynare and to this kind of models, so I am really greatful for your support.

Kind regards
xyz
 
Posts: 12
Joined: Fri Dec 11, 2015 2:33 pm

Next

Return to Dynare contributions and examples

Who is online

Users browsing this forum: No registered users and 3 guests