A. Levin code to compute 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.

A. Levin code to compute Ramsey policy

Postby MichelJuillard » Thu Mar 23, 2006 7:47 pm

Here is code contributed byAndy Levin:
% ===================================================================================
%
% OVERVIEW
%
% This program reads a Dynare model file (as specified by the string
% variable "infilename" without the .MOD extension), generates the
% first-order conditions of the Ramsey policymaker, and writes out
% a new Dynare model (as specified by the string variable "outfilename"
% without .MOD extension) and an M-file (outfilename_lmss.m) that
% provides a linear system for obtaining the numerical steady-state
% of the Lagrange multipliers.
%
% (c) Andrew T. Levin 2005
%
% Note: This program (and associated subroutines) may be used freely
% subject to acknowledgement of the source and citation of either or
% both of the following papers (for which these routines were created):
%
% Levin, A., Lopez-Salido, J.D., 2004. "Optimal Monetary Policy with
% Endogenous Capital Accumulation", manuscript, Federal Reserve Board.
%
% Levin, A., Onatski, A., Williams, J., Williams, N., 2005. "Monetary
% Policy under Uncertainty in Microfounded Macroeconometric Models."
% In: NBER Macroeconomics Annual 2005, Gertler, M., Rogoff, K., eds.
% Cambridge, MA: MIT Press.
% ===================================================================================
Attachments
Get_Ramsey.zip
(22.52 KiB) Downloaded 1651 times
MichelJuillard
 
Posts: 680
Joined: Thu Nov 18, 2004 10:51 am

2nd order approximations

Postby JorgeFornero » Mon Jul 31, 2006 7:23 pm

Dear Professor,

I have the problem with the example of prof Levin's software for the second order approximation of the model.

I follow the first three steps of his readme.txt file, namely:

1. Create a plain-text file containing your model in dynare format...
2. In matlab, set the two string variables infilename (the name of the model file) and outfilename = 'xxx' (where xxx is the name of the new file that you're creating).
3. Now just run get_ramsey.m (which takes no explicit arguments).
You will then need to parse the dynare file created by get_ramsey.
Now to evaluate the Ramsey policy, execute the following steps:...


What does exactly
parse the file
mean? Just running dynare? When I run prof Levin's example in and out .mod created by get_ramsey it comes out that there is a big discrepancy between the number of variables and the number of equations. I suspect that all the initial values are considered as equations.

So, basically, I cannot execute the further steps of the readme file. You can find this file with the software uploaded by Levin.

Do you know this problem? Maybe you know somebody who used prof Levin's software?

Thank you very much for your help in advance.
Best regards,

Jorge A. Fornero
University of Antwerp
National Belgian Bank Project
"Price and Wage Rigidities in An Open Economy"[/quote]
Jorge Fornero
Belgium
JorgeFornero
 
Posts: 10
Joined: Thu Mar 02, 2006 2:28 pm
Location: Chile

Andy Levin's answer

Postby MichelJuillard » Sun Aug 27, 2006 8:03 pm

Dear Jorge,

In light of your question, I've expanded the instructions for the
get_ramsey code (see the new readme_get_ramsey.pdf, attached below). In particular, you should set up a dynare model file that only includes the model specifications and the initial guesses for the steady state values. (See the example file, BestSW.mod, which is included in the zip file.) Then the get_ramsey code takes this model file and creates a new model file that includes the policymaker's first-order conditions (which replace the
single-equation policy rule in the original model). If the model isn't very
big and the steady states of the lagrange multipliers can be readily
computed by the dynare nonlinear solver (executed by the "steady" command), then you can proceed by simply adding parameter values and other dynare statements into the Ramsey model file, and then feed this file to the dynare processor in the same way that you'd normally do.

Alternatively, if a good set of initial guesses is needed for the steady states of the Lagrange multipliers, then you'll want to follow the corresponding
instructions in the readme.txt file (which involves explicitly parsing the
model file using dynparse.m).

Anyway, I hope that this additional information helps clarify how to use
this code, but definitely feel free to contact me (andrew.levin@frb.gov) if
you have any further questions.

Best regards,

Andy
Attachments
readme_get_ramsey.pdf
(6.85 KiB) Downloaded 1417 times
MichelJuillard
 
Posts: 680
Joined: Thu Nov 18, 2004 10:51 am

about bestsw

Postby rrdd006 » Wed Jan 03, 2007 3:03 am

professor:

when run the sample bestsw.mod,only get the following results:

> dynare bestsw
??? Error using ==> dynare
ERROR: there are 91 equations for 195 endogenous variables

best regards :(
Duan
rrdd006
 
Posts: 4
Joined: Mon Jan 01, 2007 1:13 pm

Postby bigbigben » Fri Aug 17, 2007 2:41 am

hi, I run into the same problem, but I can't figure it out.
You can try the code along with Christiano, Motto and Rastagno
Monetary Policy and Stock Market Boom-Bust Cycles.
Check out their technical appendix and there are a lot of examples to apply the Levin algorithm on some simpler models.
bigbigben
 
Posts: 171
Joined: Sun May 28, 2006 1:19 am

Postby bigbigben » Sat Aug 18, 2007 1:15 am

The problem is due to update in Dynare. I guess the parser used in old version is quite different. If you compare the input file and output file when using Levin's code. You can find all the variables in the input file are counted twice, and that is why we always have more variables than equations. If you check the output file, you can find the keyword "var" are used twice.

We can try rewriting the "dynparse.m" in the package to get something work.
bigbigben
 
Posts: 171
Joined: Sun May 28, 2006 1:19 am

Re: A. Levin code to compute Ramsey policy

Postby squipbar » Mon Dec 22, 2008 10:31 am

Does anyone have a copy of the Levin & Lopez-Salido manuscript that keeps getting referenced in the readme file and in the code? Thanks very much,

Philip
squipbar
 


Return to Dynare contributions and examples

Who is online

Users browsing this forum: No registered users and 1 guest