Ramsey Policy

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.

Ramsey Policy

Postby jd1090 » Sat Apr 16, 2016 1:59 pm

Hi,

I'm trying to work out how to run the Ramsey_Policy in dynare. The problem that I am having is that I do not quite understand what it means to specify the steady state of the model CONDITIONAL on the instruments used. I tried to follow the Michel Juillard's set of notes and implement his example (see attached file).

The code for a generic model provided in the notes is as follows:

Code: Select all
var pai, c, n, r, a;
varexo u;
parameters beta, rho, epsilon, omega, phi, gamma;

beta=0.99;
gamma=3;
omega=17;
epsilon=8;
phi=1;
rho=0.95;
model;
a = rho*a(-1)+u;
1/c = beta*r/(c(+1)*pai(+1));
pai*(pai-1)/c = beta*pai(+1)*(pai(+1)-1)/c(+1)+epsilon*phi*n^(gamma+1)/omega-exp(a)*n*(epsilon-1)/(omega*c);
exp(a)*n = c+(omega/2)*(pai-1)^2;
end;
initval;
r=1;
end;

steady_state_model;
a = 0;
pai = beta*r;
c = find_c(0.96,pai,beta,epsilon,phi,gamma,omega);
n = c+(omega/2)*(pai-1)^2;
end;
shocks;
var u; stderr 0.008;
end;

planner_objective(ln(c)-phi*((n^(1+gamma))/(1+gamma)));
ramsey_policy(planner_discount=0.99,order=1,instruments=(r));

function c = find_c(c0,pai,beta,epsilon,phi,gamma,omega)
c = csolve(@nk_ss,c0,[],1e-8,100,pai,beta,epsilon,phi,gamma,omega);
function r = nk_ss(c,pai,beta,epsilon,phi,gamma,omega)
r = pai*(pai-1)/c - beta*pai*(pai-1)/c-epsilon*phi*(c+(omega/2)*(pai-1)^2)^(gamma+1)/omega+(c+(omega/2)*(pai-1)^2)*(epsilon-1)/(omega*c);


The problem is that dynare does not recognise the command @nk_ss and the code cannot be implemented (see error message below) even if I name the .mod file as nk_ss:


Starting Dynare (version 4.4.3).
Starting preprocessing of the model file ...
ERROR: nk_ss.mod: line 35, col 12: character unrecognized by lexer

Error using dynare (line 174)
DYNARE: preprocessing failed


I have read the dynare manual and I understand that you need to omit he Taylor rule in the model (if it applies), that commands "steady" are incompatible with ramsey_policy, I know how the policy objective is specified and what the ramsey_policy options are. The only thing I do not understand is how the steady state has to be specified (hence the example above cannot be implemented, and I am using unstable version of dynare 4.4.3). I tried looking into other topics on similar issues, but running my model with just initval doesn't work. Then specifying the instrument in the initval, whereas the rest of the model in steady_state_model block leads to singularity (as in other topics here). So I could really use some help in trying to find these conditional steady states, because I am sure that this is the root of all problems. There isn't a lot of material out there. Andy Levin's codes are also outdated and don't work on recent versions of Dynare.

Thank you.
Attachments
nk_ss.mod
Michel Juillards example
(993 Bytes) Downloaded 148 times
Ramsey Policy.pdf
The set of notes
(175.11 KiB) Downloaded 206 times
Justas Dainauskas
Department of Economics and Related Studies
University of York
Heslington
York
YO10 5DD
United Kingdom
jd1090
 
Posts: 62
Joined: Wed Mar 25, 2015 11:12 am

Re: Ramsey Policy

Postby jpfeifer » Mon Apr 18, 2016 8:48 pm

You can find an example here: https://github.com/DynareTeam/dynare/blob/master/tests/optimal_policy/Ramsey/ramsey_ex.mod. The find_c.m file you also need in the same folder is at https://github.com/DynareTeam/dynare/blob/master/tests/optimal_policy/Ramsey/find_c.m
r is declared as an instrument. Given any value of the instrument entered to the steady_state_model-block, an analytical steady state is provided. If you want, you can implement something similar within a proper steady state file. An example here is the NK_baseline.mod in the Dynare examples folder. Note that you should use the current unstable version (soon to be 4.5) for Ramsey with instruments as several bugs related to this have been fixed.
------------
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: Ramsey Policy

Postby jd1090 » Thu Apr 21, 2016 1:02 pm

Following your guidance, I can now run the example without any problems. However, I still don't think I quite understand what the software is doing, because I can't apply it to any other models (I always get an error message that says either "too many input arguments" or "not enough input arguments").

The way I understand it is as follows. The line in the steady_state_model block of the mod file

Code: Select all
c = find_c(0.96,pai,beta,epsilon,phi,gamma,omega);


Returns a non-zero value for c, which is found numerically from the find_c.m file. This is done because the steady state value of the instrument r is ex ante not known and thus the analytical solution to the steady state of c is not possible. Then the find_c.m file has the following:

Code: Select all
function c = find_c(c0,pai,beta,epsilon,phi,gamma,omega)
c = csolve(@nk_ss,c0,[],1e-8,100,pai,beta,epsilon,phi,gamma,omega);
end

function r = nk_ss(c,pai,beta,epsilon,phi,gamma,omega)
r = pai*(pai-1)/c - beta*pai*(pai-1)/c-epsilon*phi*(c+(omega/2)*(pai-1)^2)^(gamma+1)/omega +(c+(omega/2)*(pai-1)^2)*(epsilon-1)/(omega*c);
end


Where c0 is the initial value (=0.96 in the mod file). The next part is less clear. The arguments inside find_c, are they ALL the model parameters (except for technological progress persistence) or are they only the parameters that would affect c from equation 3?

Code: Select all
equation 3: beta*pai(+1)*(pai(+1)-1)/c(+1)+epsilon*phi*n^(gamma+1)/omega -exp(a)*n*(epsilon-1)/(omega*c)


Why is one of the endogenous variables (i.e. pai) in the find_c function? Is it because the steady state value of pai directly depends on the value of the instrument and it is recursively used in the steady state of c?

Then in the second line where csolve is used

Code: Select all
c=csolve(@nk_ss,c0,[],1e-8,100....


@nk_ss applies some sort of numerical optimisation algorithm (does @ indicate a model local variable?), where c0 is the initial value, [] specifies the gradient, 1e-8 is the terminal condition (i.e. ad hoc value for when the gradient is sufficiently small) and 100 is the maximum number of iterations to be used. So, the values of (ALL?) the model parameters are specified at this step because they influence the value of the steady state of c?

Then the last part is specifying the instrument:

Code: Select all
r = nk_ss(c,pai,beta,epsilon,phi,gamma,omega)

Again, I'm not sure what nk_ss stands for so I can only guess that its a numerical optimisation algorithm (some sort of "FUN" from dynare internals). Why does the value of c or anything else enter the specification of nk_ss (its important to know if it is to be applied in other contexts)? And is this the policy makers constraint (which is the recursive solution of equation 3 equated to the value of the instrument)?:

Code: Select all
r = pai*(pai-1)/c - beta*pai*(pai-1)/c-epsilon*phi*(c+(omega/2)*(pai-1)^2)^(gamma+1)/omega +(c+(omega/2)*(pai-1)^2)*(epsilon-1)/(omega*c);


As always, thank you very much for the help and support.
Justas Dainauskas
Department of Economics and Related Studies
University of York
Heslington
York
YO10 5DD
United Kingdom
jd1090
 
Posts: 62
Joined: Wed Mar 25, 2015 11:12 am

Re: Ramsey Policy

Postby jpfeifer » Thu Apr 21, 2016 6:55 pm

A steady state file is always recursive as you solve for one variable after another. We have
Code: Select all
a = 0;
pai = beta*r;
c = find_c(0.96,pai,beta,epsilon,phi,gamma,omega);
n = c+(omega/2)*(pai-1)^2;

That is, we first find the steady state for a, then for pai, then for c, and last for n. That is the reason we can use pai when solving for c. As you can see, the value for pai is therefore handed over to the find_c.m function.
The problem with the model is that even if you know the value of the instrument, the particular nonlinear structure of the model makes it impossible to solve for c. You need to use a root finder for this. The function find_c does exactly this. Given the value of pai and the values of the parameter appearing in the consumption equation after substituting out labor (therefore there is no need to pass all parameters), we search for the root of this equation.
Looking at the find_c.m file, you can see that it contains a nested function
Code: Select all
nk_ss
in line 5 following. This function could have been a separate m-file, but here it is nested. This function computes the residual of the consumption FOC after labor has been substituted out. That is, with the correct value for consumption, the residual will be 0. That is what is done with csolve: starting with c0 find the value that returns a zero residual. The @ is used by Matlab to create a function handle, i.e. tell the solver that nk_ss is the function we need to solve.
------------
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: Ramsey Policy

Postby jd1090 » Sun Apr 24, 2016 12:38 pm

I think I understand the find_ and nk_ss commands better now. I applied similar logic to my model, but I think I ran into a similar problem as in this topic: http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=5803.

Please see the code attached to this message. I specify the nominal interest rate (r) as an instrument, which appears in the stochastic discount factor (LAMBDA). The CPI inflation (PI_CPI) is thus a function of LAMBDA and beta (the time invariant discount factor), which must be obtained using find_ command:

Code: Select all
function PI_CPI = find_PI_CPI(PI_CPI0, LAMBDA, beta)
PI_CPI = csolve(@nk_ss,PI_CPI0,[],1e-8,100, LAMBDA, beta);
end


Then I specify the function for the residuals of the instrument (i.e. the Euler equation):

Code: Select all
function r = nk_ss(PI_CPI, LAMBDA, beta)
r = (PI_CPI*LAMBDA)/beta;
end


The steady_state_model block is solved recursively and it is conditional on the instrument value. However, when I run the code I obtain quite a number of rank deficiency warnings such as:

Code: Select all
Warning: Rank deficient, rank = 0, tol = NaN.
> In dyn_ramsey_static_dyn_ramsey_static_1 (line 152)
  In dyn_ramsey_static>@(x)dyn_ramsey_static_1(x,M,options_,oo) (line 40)
  In csolve (line 112)
  In dyn_ramsey_static (line 55)
  In evaluate_steady_state (line 55)
  In resol (line 104)
  In stoch_simul (line 88)
  In ramsey_policy (line 25)
  In FINOP_RAMSEY (line 650)
  In dynare (line 180) 


Until Matlab stops and gives another error at the end:

Code: Select all
Attempted to access ys_(50); index out of bounds because numel(ys_)=40.
Error in FINOP_RAMSEY_steadystate2 (line 44)
ys_(80)=ys_(50)*(-(ys_(18)*1/(ys_(26)*ys_(15))));
Error in evaluate_steady_state_file (line 54)
        [ys,params1,check] = h_steadystate(ys_init, exo_ss, params);
Error in dyn_ramsey_static (line 61)
    [xx,params,check] = evaluate_steady_state_file(ys,exo_ss,M,options_);
Error in evaluate_steady_state (line 55)
        [ys,params] = dyn_ramsey_static(ys_init,M,options,oo);
Error in resol (line 104)
[dr.ys,M.params,info] = evaluate_steady_state(oo.steady_state,M,options,oo,0);
Error in stoch_simul (line 88)
    [oo_.dr,info,M_,options_,oo_] = resol(0,M_,options_,oo_);
Error in ramsey_policy (line 25)
info = stoch_simul(var_list);
Error in FINOP_RAMSEY (line 650)
ramsey_policy(var_list_);
Error in dynare (line 180)
evalin('base',fname)


Hence, there are only 40 equation in the model, so ys(50) and ys(80) are auxiliary equations (as the steady state file suggests). There should not be any division by zero. I can run the model smoothly using different versions of Taylor rules with various parameter specifications. Is there still something wrong with the way I specify the steady state?

Thank you.
Justas Dainauskas
Department of Economics and Related Studies
University of York
Heslington
York
YO10 5DD
United Kingdom
jd1090
 
Posts: 62
Joined: Wed Mar 25, 2015 11:12 am

Re: Ramsey Policy

Postby jpfeifer » Mon Apr 25, 2016 8:37 am

Please use the current unstable version of Dynare, where a bug related to auxiliary variables when using instruments has been fixed. There you will get
evaluate_steady_state: The steady state file computation for the Ramsey problem resulted in NaNs.
evaluate_steady_state: The steady state was computed conditional on the following initial instrument values:
r 1.000000
evaluate_steady_state: The problem occured in the following equations:
Equation(s): 1, 2, 3, 4, 5, 6, 7, 10, 11, 14, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 30, 31, 32, 33, 34, 35, 38, 40,
evaluate_steady_state: If those initial values are not admissable, change them using an initval-block.

I manually executed the parameter definitions, the setting of r and then the equations in the steady_state_model-block using F9 in Matlab. I turns out that your steady state file is not properly recursive. You use
Code: Select all
PHI2=(Y*UC)/(1-pi*beta*(PI_CPI^(varepsilon-1)));
PHI1=((Y*UC)/(1-pi*beta*(PI_CPI^(varepsilon))))*(varepsilon/(varepsilon-1))*MC;

but Y is only define later.
------------
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: Ramsey Policy

Postby jd1090 » Mon Apr 25, 2016 9:46 am

Thanks for the prompt response. I have now fixed the steady state block.

I am using the current unstable version of dynare for windows (i.e. dynare 2016-04-24 downloaded from here:http://www.dynare.org/snapshot/windows-zip/).

I'm not sure if that's a problem but I also have the unstable 4.4.3 in the C drive. It used to be ok to have different versions simultaneously. I set the path in the folder of the most recent dynare version on the site.

I execute the parameter values, the instrument and the steady state model equations in this precise order using F9.

I then run dynare FINOP_RAMSEY.mod in the command window and get an identical outcome (i.e. lots of warnings and eventually the auxiliary variable problem).

Any further comments are greatly appreciated.

P.S. Apologies for the incompetence.
Justas Dainauskas
Department of Economics and Related Studies
University of York
Heslington
York
YO10 5DD
United Kingdom
jd1090
 
Posts: 62
Joined: Wed Mar 25, 2015 11:12 am

Re: Ramsey Policy

Postby jpfeifer » Mon Apr 25, 2016 11:42 am

Check that you are using the correct version. The preprocessor should show
dynare FINOP_RAMSEY

Configuring Dynare ...
[mex] Generalized QZ.
[mex] Sylvester equation solution.
[mex] Kronecker products.
[mex] Sparse kronecker products.
[mex] Local state space iteration (second order).
[mex] Bytecode evaluation.
[mex] k-order perturbation solver.
[mex] k-order solution simulation.
[mex] Quasi Monte-Carlo sequence (Sobol).
[mex] Markov Switching SBVAR.

Using 64-bit preprocessor
Starting Dynare (version 2016-04-16).

If the last line above says 4.4.3 then you are using the wrong path. I now get
evaluate_steady_state: The steady state file does not solve the steady state for the Ramsey problem.
evaluate_steady_state: Conditional on the following instrument values:
r 1.000000
evaluate_steady_state: the following equations have non-zero residuals:
Equation number 3: -2900105745041947900000.000000
Equation number 10: 6117457973423583000000.000000
Equation number 11: -4.324949
Equation number 14: 7.785978
Equation number 16: -2.646347
Equation number 21: 179102810608.442600
Equation number 24: -76677505772.973389
Equation number 29: -1.000000
Equation number 31: -1.000000
------------
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: Ramsey Policy

Postby jd1090 » Mon Apr 25, 2016 2:05 pm

Thanks. I uninstalled 4.4.3 and I managed to get to the same stage as you did. I will try to workout the steady state once more, since it appears that something is going horribly wrong.

Its strange given that it runs with alternative policy rules. I'm probably still making instinctive errors given that I'm used to solving everything in the context of a zero inflation steady state.
Justas Dainauskas
Department of Economics and Related Studies
University of York
Heslington
York
YO10 5DD
United Kingdom
jd1090
 
Posts: 62
Joined: Wed Mar 25, 2015 11:12 am

Re: Ramsey Policy

Postby jd1090 » Wed Apr 27, 2016 1:54 pm

So I managed to resolve most of the abnormalities in the steady state, but I find it hard to grind out this last step which is to do with the residual in the Euler equation:

Code: Select all
evaluate_steady_state: The steady state file does not solve the steady state for the Ramsey problem.
evaluate_steady_state: Conditional on the following instrument values:
    r     0.010050
evaluate_steady_state: the following equations have non-zero residuals:
    Equation number 16: -1.000000
    Equation number 29: -1.000000


Code: Select all
PI_CPI(+1)=beta*(UC(+1)/UC)*(1/LAMBDA);      //(16)  EULER EQUATION
PI_CPI=CPI/CPI(-1);                          //(29)  CPI INFLATION IDENTITY


Where the instrument r=-log(beta)=~0.010050. The steady state of LAMBDA when r=-log(beta) is equal to beta itself and by definition UC(+1)=UC in the steady state, so I don't see what could be wrong.

As usual, the files are attached below. Thank you.
Justas Dainauskas
Department of Economics and Related Studies
University of York
Heslington
York
YO10 5DD
United Kingdom
jd1090
 
Posts: 62
Joined: Wed Mar 25, 2015 11:12 am

Re: Ramsey Policy

Postby jpfeifer » Thu Apr 28, 2016 9:05 am

Sidenote: I am not sure what you are doing. It seems the function you are solving numerically can be easily solved for inflation. So why do you use solver?
Now to the problem:
You have the function
Code: Select all
r = (PI_CPI*LAMBDA)/beta;

you want to solve. Setting r=0, we see that PI_CPI=0 is the solution. But
Code: Select all
PI_CPI=CPI/CPI(-1);                         

implies that
Code: Select all
PI_CPI=1

in steady state
------------
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: Ramsey Policy

Postby jd1090 » Tue May 03, 2016 8:59 am

Well the reason I used csolve to begin with was because the example above used it and I wasn't sure what it meant to specify the steady state conditional on the instruments. I thought that it was the only way, but I suppose the only reason it was used in the example was because there are multiple steady states of inflation unlike in my model.

I now realise that I don't need the find_ file at all, but the initial value of the instrument must be very precise for dynare to solve for the steady state of the model. That is, initval r=-log(beta)=0.010050 does not solve the model and gives rise to small residuals:

Code: Select all
evaluate_steady_state: The steady state for the Ramsey problem could not be computed.
evaluate_steady_state: The steady state computation stopped with the following instrument values::
    r     0.010050
evaluate_steady_state: The following equations have non-zero residuals:
    Equation number 17: -0.000079
    Equation number 26: 0.000114
    Equation number 29: -0.000171
    Equation number 30: -0.000040


but r=-log(beta)=0.01005033585 does solve the model, because it is more accurate. However, to make it even more ironic, I am now struggling with the Blanchard Kahn conditions.

Code: Select all
Error using print_info (line 42)
Blanchard Kahn conditions are not satisfied: no stable equilibrium

Error in stoch_simul (line 94)
    print_info(info, options_.noprint, options_);

Error in ramsey_policy (line 25)
info = stoch_simul(var_list);

Error in FINOP_RAMSEY (line 660)
ramsey_policy(var_list_);

Error in dynare (line 223)
evalin('base',fname) ;


Which really puzzles me, because the model runs smoothly with other Taylor rules (the IRFs look smooth and non-oscillating). Is there anything in particular that I should keep in my when running ramsey_policy with regard to the time subscripts or predetermined variables that would otherwise not be a problem?
Last edited by jd1090 on Tue May 17, 2016 2:46 pm, edited 1 time in total.
Justas Dainauskas
Department of Economics and Related Studies
University of York
Heslington
York
YO10 5DD
United Kingdom
jd1090
 
Posts: 62
Joined: Wed Mar 25, 2015 11:12 am

Re: Ramsey Policy

Postby jpfeifer » Fri May 06, 2016 8:11 am

First off,
initval r=-log(beta)=0.010050 does not solve the model and gives rise to small residuals

makes no sense. You are providing a steady state condition on the value of the instruments. Thus, it must work for any instrument! If it doesn't, you are not taking the value of the instrument correctly into account. When you change the planner discount factor, your steady state file suddenly does not work anymore.

Regarding timing: the same rules apply as for stoch_simul. My guess is that there is an economic reason for the error message.
------------
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: Ramsey Policy

Postby jd1090 » Sat May 07, 2016 3:47 pm

You may be right that my model contains an economic problem (I cannot guarantee that). For this reason, I took the most well known open economy framework (Gali & Monacelli(2005)) and wrote the mod file for the non-linear version of the model (i.e. I do not log-linearise by hand). I also include capital and define the net exports in a slightly different way, but these changes make no real difference to the end result. There are no further frictions.

I also wrote the .tex file (see pdf below and .tex code at the very bottom) with all the equilibrium conditions and detailed derivations of the conditional steady state. I suspect that the problem may arise do the misspecification of the price level steady state, but I'm not sure (which is why I keep pestering you on this blog post to begin with :) ).

In this case, the error message is different:

Code: Select all
Warning: Rank deficient, rank = 0, tol = NaN.
> In dyn_ramsey_static_dyn_ramsey_static_1 (line 152)
  In dyn_ramsey_static>@(x)dyn_ramsey_static_1(x,M,options_,oo) (line 43)
  In csolve (line 112)
  In dyn_ramsey_static (line 58)
  In evaluate_steady_state (line 120)
  In resol (line 104)
  In stoch_simul (line 83)
  In ramsey_policy (line 25)
  In GM_2005 (line 542)
  In dynare (line 223)

evaluate_steady_state: The steady state computation for the Ramsey problem resulted in NaNs.
evaluate_steady_state: The steady state computation resulted in the following instrument values:
    i     0.010050
evaluate_steady_state: The problem occured in the following equations:
    Equation(s): 1, 33, 34,
Error using print_info (line 140)
Ramsey: The steady state computation resulted in NaN in the static first order conditions for optimal policy
Error in stoch_simul (line 94)
    print_info(info, options_.noprint, options_);
Error in ramsey_policy (line 25)
info = stoch_simul(var_list);
Error in GM_2008 (line 542)
ramsey_policy(var_list_);
Error in dynare (line 223)
evalin('base',fname) ;


P.S. Apologies for yet another question on this, but this is really bothering me. Hopefully we can figure this out and you can put this example on github, so that others in the future would not have to struggle as much as I am.

\documentclass[11pt]{article}
\usepackage{amsmath, amssymb}
\usepackage{mathtools}
\usepackage{graphicx}
\usepackage{float}
\usepackage{natbib}
\bibliographystyle{agsm}
\begin{document}

\title{Running the Ramsey Policy on a Non-Linear\\ Gali \& Monacelli (2005) Model using Dynare}
\author{Justas Dainauskas\footnote{University of York, Department of Economics and Related Studies, Heslington, York, YO10 5DD, United Kingdom. E-Mail: jd1090@york.ac.uk}}
\maketitle

\section{The Model}
Consider the ubiquitous \cite{GaliMonacelli(2005)} model of a small open economy in its non-linear form. The only real difference here is that the capital stock is present in the model and the dynamics of inflation are summarised in a recursive way similar to the \texttt{NK\_baseline.mod} in the dynare example folder. The trade balance is specified in a slightly different way, but it makes no real difference. There are no additional frictions introduced into the model and the notation used is consistent with \cite{GaliMonacelli(2005)} as much as possible, so all of the equilibrium conditions are standard:
\begin{equation}
Y_t=C_t+I_t+NX_t
\end{equation}
\begin{equation}
NX_t=X_t-M_t
\end{equation}
\begin{equation}
X_t=\alpha\left(\frac{P_{H,t}}{E_tP_{F,t}}\right)^{-\eta}C_t^*
\end{equation}
\begin{equation}
M_t=\alpha\left(\frac{E_tP_{F,t}}{P_t}\right)^{-\eta}C_t
\end{equation}
\begin{equation}
C_{H,t}=(1-\alpha)\left(\frac{P_{H,t}}{P_{t}}\right)^{-\eta}C_t
\end{equation}
\begin{equation}
C_{F,t}=\alpha\left(\frac{E_tP_{F,t}}{P_{t}}\right)^{-\eta}C_t
\end{equation}
\begin{equation}
C_t+I_t+\mathbb{E}_t\left[D_{t+1} \mathit{\Lambda}_{t,t+1} \mathit{\Pi}_{t+1}\right]=\frac{D_t}{P_t}+\frac{W_tN_t}{P_t}+\frac{R_tK_{t-1}}{P_t}+\frac{\mathit{\Xi}_t}{P_t}
\end{equation}
\begin{equation}
\mathit{\Xi}_t=P_{H,t}Y_t-W_tN_t-R_tK_{t-1}
\end{equation}
\begin{equation}
\mathbb{E}_t\left[\mathit{\Lambda}_{t,t+1}\right]=\exp(-i_t)
\end{equation}
\begin{equation}
\mathbb{E}_t\left[\mathit{\Pi}_{t+1}\right]=\mathbb{E}_t\left[\frac{P_{t+1}}{P_t}\right]
\end{equation}
\begin{equation}
\frac{W_t}{P_t}=\frac{N^\varphi}{\mathbb{U}_{c,t}}
\end{equation}
\begin{equation}
\mathbb{U}_{c,t}=C^{-\sigma}
\end{equation}
\begin{equation}
\mathbb{E}_t\left[\mathit{\Lambda}_{t,t+1}\mathit{\Pi}_{t+1}\right]=\beta\left[\frac{\mathbb{U}_{c,t+1}}{\mathbb{U}_{c,t}}\right]
\end{equation}
\begin{equation}
\frac{R_{t+1}}{P_{t+1}}=\mathbb{E}_t\left[\left(\frac{\mathbb{U}_{c,t+1}}{\mathbb{U}_{c,t}}\right)\left(\frac{1}{\beta}-(1-\delta)\right)\right]
\end{equation}
\begin{equation}
Y=\frac{A_tK_{t-1}^\gamma N_t^{1-\gamma}}{\mathit{\Theta}_t}
\end{equation}
\begin{equation}
\frac{W_t}{P_t}=(1-\gamma)MC_t\left(\frac{Y_t}{N_t}\right)
\end{equation}
\begin{equation}
\frac{R_t}{P_t}=\gamma MC_t\left(\frac{Y_t}{K_{t-1}}\right)
\end{equation}
\begin{equation}
K_t=(1-\delta)K_{t-1}+I_t
\end{equation}
\begin{equation}
MC_t=\frac{1}{P_tA_t}\left(\frac{R_t}{\gamma}\right)^\gamma\left(\frac{W_t}{1-\gamma}\right)^{1-\gamma}
\end{equation}
\begin{equation}
P_{H,t}=\left[(1-\pi)\,\hat{P}_{H,t}^{1-\varepsilon}+\pi\,P_{H,t-1}^{1-\varepsilon}\right]^{\frac{1}{1-\varepsilon}}
\end{equation}
\begin{equation}
\hat{P}_{H,t}=\frac{P_t \mathit{\Phi}_{t,1}}{\mathit{\Phi}_{t,1}}
\end{equation}
\begin{equation}
\mathit{\Phi}_{t,1}=\left(\frac{\varepsilon}{\varepsilon-1}\right)Y_t \mathbb{U}_{c,t} MC_{t}+\theta\beta\,\mathbb{E}_t \left[\mathit{\Pi}_{t+1}^\varepsilon\,\mathit{\Phi}_{t+1,1}\right]
\end{equation}
\begin{equation}
\mathit{\Phi}_{t,2}=Y_t \mathbb{U}_{c,t}+\theta\beta\,\mathbb{E}_t\left[\mathit{\Pi}_{t+1}^{\varepsilon-1}\,\mathit{\Phi}_{t+1,2}\right]
\end{equation}
\begin{equation}
\mathit{\Theta}_{t}=\pi\mathit{\Pi}_{H,t}^\varepsilon\mathit{\Theta}_{t-1}+(1-\pi)\left(\frac{\widehat{P}_{H,t}}{P_{t}}\right)^{-\varepsilon}
\end{equation}
\begin{equation}
\mathbb{E}_t\left[\mathit{\Pi}_{H,t+1}\right]=\mathbb{E}_t\left[\frac{P_{t+1}}{P_t}\right]
\end{equation}
\begin{equation}
\mathbb{U}_{c,t}^*=C^{* -\sigma}
\end{equation}
\begin{equation}
P_t=\left[(1-(1-\mu)\alpha)\,(P_{H,t})^{1-\eta}+(1-\mu)\alpha(P_{F,t})^{1-\eta}\right]^{\frac{1}{1-\eta}}
\end{equation}
\begin{equation}
Q_t=\frac{\mathbb{U}_{c,t}^*}{\mathbb{U}_{c,t}}
\end{equation}
\begin{equation}
E_t=\frac{Q_t P_t}{P_{F,t}}
\end{equation}
\begin{equation}
\log(A_t)=\rho_a\,\log(A_{t-1})+e_{a,t},\,\,\,\,\,\rho_a\in(0,1),\,\,\,\,\,e_{a,t} \sim\,iid(0,\sigma_{a}^2)
\end{equation}
\begin{equation}
\log(C_t^*)=(1-\rho_{c})\log(C)+\rho_{c}\,\log(C_{t-1}^*)+e_{c,t},\,\,e_{c,t} \sim\,iid(0,\sigma_{c}^2)
\end{equation}
And for non-Ramsey policy case, the single mandate Taylor rule:
\begin{equation}
i_t=-\log(\beta)+\phi\,\log(\mathit{\Pi}_{t})
\end{equation}
Given the assumption that the policy \texttt{instrument} is $i_t$ and the \texttt{planner\_objective} is given by the CRRA preferences:
\begin{equation}
\frac{C_t^{1-\sigma}}{1-\sigma}-\frac{N_t^{1+\varphi}}{1+\varphi}
\end{equation}

\section{Conditional Steady State}
Derivations of the real variable steady state values must be conditional on the instrument used for the Ramsey policy, which is chosen to be the nominal interest rate $i_t$. The nominal instrument affects the demand side of the economy via the Euler equation. Specifically, it is the reciprocal of the stochastic discount factor:
$$\mathit{\Lambda}=\exp(-i)$$
The stochastic discount factor affects the CPI inflation:
$$\mathit{\Pi}=\frac{\beta}{\mathit{\Lambda}}$$
The specification of the price levels is less clear, because the steady state must be consistent with any value of the instrument, which means that there may be non-zero inflation steady state. This implies that the price level is rising over time. For this reason, I specify the CPI level as equivalent to the CPI inflation rate (which implicitly assumes that the CPI level in the previous period is always equal to unity and I'm not sure how to specify this in any other way):
$$P\equiv\mathit{\Pi}$$
Then it follows that the real marginal costs of production must equal to the inverse mark-up:
$$MC=\frac{1}{PA}\left(\frac{R}{\zeta}\right)^\zeta\left(\frac{W}{(1-\zeta)}\right)^{1-\zeta}=\frac{\varepsilon-1}{\varepsilon}$$
$$\mathit{\Phi}_{1}=\mathit{\Phi}_{2}=\frac{Y C^{-\sigma}}{1-\mathit{\Pi}\pi\beta}$$
$$\widehat{P}_H=\frac{\mathit{P \Phi}_{1}}{\mathit{\Phi}_{2}}\equiv \mathit{\Pi}$$
Then note that the trade balance holds in the steady state:
$$X=M=\alpha C\Rightarrow NX=0$$
Where the above follows from the symmetry of preferences and the consumption risk-sharing relationship:
$$Q=\left(\frac{C}{C^*}\right)^{\sigma}\equiv\frac{E P_F}{P}=1 \Rightarrow C=C^*$$
Therefore the aggregate resource constraint is given by:
$$Y=C+I$$
Where aggregate investment is obtained from the capital accumulation equation:
$$I=\delta K$$
In order to find the market clearing steady state of capital stock, consider the demand and supply schedules of capital:
$$R=\frac{1-\beta(1-\delta)}{\beta}$$
$$R=\frac{\zeta MC Y}{K}\equiv \left(\frac{\varepsilon-1}{\varepsilon}\right)\frac{\zeta Y}{K}$$
Then solving the above two equations for capital stock gives:
$$K=\left[\left(\frac{\varepsilon-1}{\varepsilon}\right)\left(\frac{\zeta\beta}{1-\beta(1-\delta)}\right)\right]Y\equiv\mathit{\Delta}_1 Y$$
Then substitute the above into the production function and solve for output:
$$Y=K^\zeta N^{1-\zeta}\equiv N \mathit{\Delta}_1^{\frac{\zeta}{1-\zeta}}$$
Then the aggregate investment is equivalent to:
$$I=\delta K=\delta \mathit{\Delta}_1 Y= \delta N \mathit{\Delta}_1^{\frac{1}{1-\zeta}}$$
Substituting out output and investment from the aggregate budget constraint identifies the steady state of aggregate consumption:
$$C=Y-I=N\left[\mathit{\Delta}_1^{\frac{\zeta}{1-\zeta}}+\delta \mathit{\Delta}_1^{\frac{1}{1-\zeta}}\right]\equiv \mathit{\Delta}_2 N$$
The labour demand schedules defines real wage:
$$\frac{W}{P}=\left(\frac{\varepsilon-1}{\varepsilon}\right)(1-\zeta)\mathit{\Delta}_1^{\frac{\zeta}{1-\zeta}}$$
Thus the aggregate hours can therefore be identified from the inverse labour supply schedule:
$$\frac{W}{P}=N^\varphi C^\sigma$$
$$\Rightarrow \left(\frac{\varepsilon-1}{\varepsilon}\right)(1-\zeta)\mathit{\Delta}_1^{\frac{\zeta}{1-\zeta}}=N^{\varphi+\sigma} \mathit{\Delta}_2^\sigma$$
$$\Rightarrow N=\left[\mathit{\Delta}_2^{-\sigma}\left(\frac{\varepsilon-1}{\varepsilon}\right)(1-\zeta)\mathit{\Delta}_1^{\frac{\zeta}{1-\zeta}}\right]^{\frac{1}{\varphi+\sigma}}$$
Then the consumption allocation between the domestic goods and foreign goods is given by:
$$C_H=(1-\alpha)C$$
$$C_F=\alpha C$$
And finally, the amount of assets held by the domestic households in the steady state is obtained from the budget constraint:
$$PC+PI+\beta D=D+WN+RK+\mathit{\Xi}$$
$$\mathit{\Xi}=P_H Y-W N-RK$$
$$(\beta-1)D=0$$
$$\Rightarrow D=0$$

\section{Dynare Code}
See \texttt{GM\_2005.mod} attached.

\bibliography{references}

\end{document}

Attachments
GM_2005.pdf
(207.5 KiB) Downloaded 148 times
GM_2005.mod
(13.54 KiB) Downloaded 132 times
Justas Dainauskas
Department of Economics and Related Studies
University of York
Heslington
York
YO10 5DD
United Kingdom
jd1090
 
Posts: 62
Joined: Wed Mar 25, 2015 11:12 am

Re: Ramsey Policy

Postby jpfeifer » Mon May 09, 2016 1:49 pm

But do you know whether the Gali Monacelli model you enter works with steady state inflation, i.e. correctly accounts for a steady state nominal interest rate bigger than the real interest rate?
------------
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

Next

Return to Dynare help

Who is online

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