DSGE中高级教程-笔记和源代码
所属分类:其他
开发工具:matlab
文件大小:7408KB
下载次数:5
上传日期:2021-02-09 01:23:06
上 传 者:
raphaelyan
说明: dsge模型的基本语言,包括两部门和三部门nk模型
(dynare code for advance maceconomic dsge model)
文件列表:
DSGE中高级教程-笔记和源代码\Chap5_Financial_Friction\bank_zero_profit_cond.eps (148291, 2015-10-29)
DSGE中高级教程-笔记和源代码\Chap5_Financial_Friction\bank_zero_profit_cond.fig (9098, 2015-10-29)
DSGE中高级教程-笔记和源代码\Chap5_Financial_Friction\Chap5_Financial_Friction.pptx (173092, 2016-03-17)
DSGE中高级教程-笔记和源代码\Chap5_Financial_Friction\Codes\change_of_sigma\change_of_sigma.eps (35898, 2015-11-10)
DSGE中高级教程-笔记和源代码\Chap5_Financial_Friction\Codes\change_of_sigma\change_of_sigma.fig (22226, 2015-11-10)
DSGE中高级教程-笔记和源代码\Chap5_Financial_Friction\Codes\Dynare\bgg_rbc.log (7377, 2016-03-19)
DSGE中高级教程-笔记和源代码\Chap5_Financial_Friction\Codes\Dynare\bgg_rbc.m (6311, 2016-03-19)
DSGE中高级教程-笔记和源代码\Chap5_Financial_Friction\Codes\Dynare\bgg_rbc.mod (3246, 2016-03-19)
DSGE中高级教程-笔记和源代码\Chap5_Financial_Friction\Codes\Dynare\bgg_rbc_dynamic.m (6727, 2016-03-19)
DSGE中高级教程-笔记和源代码\Chap5_Financial_Friction\Codes\Dynare\bgg_rbc_irf_1.fig (29090, 2015-11-16)
DSGE中高级教程-笔记和源代码\Chap5_Financial_Friction\Codes\Dynare\bgg_rbc_irf_2.fig (13283, 2015-11-16)
DSGE中高级教程-笔记和源代码\Chap5_Financial_Friction\Codes\Dynare\bgg_rbc_IRF_sigma_e1.eps (19531, 2016-03-19)
DSGE中高级教程-笔记和源代码\Chap5_Financial_Friction\Codes\Dynare\bgg_rbc_IRF_sigma_e2.eps (13652, 2016-03-19)
DSGE中高级教程-笔记和源代码\Chap5_Financial_Friction\Codes\Dynare\bgg_rbc_results.mat (126140, 2016-03-19)
DSGE中高级教程-笔记和源代码\Chap5_Financial_Friction\Codes\Dynare\bgg_rbc_set_auxiliary_variables.m (202, 2016-03-19)
DSGE中高级教程-笔记和源代码\Chap5_Financial_Friction\Codes\Dynare\bgg_rbc_static.m (6002, 2016-03-19)
DSGE中高级教程-笔记和源代码\Chap5_Financial_Friction\Codes\Dynare\bgg_rbc_steadystate.m (1372, 2016-03-19)
DSGE中高级教程-笔记和源代码\Chap5_Financial_Friction\Codes\Dynare\find_foc_difference.m (834, 2016-03-19)
DSGE中高级教程-笔记和源代码\Chap5_Financial_Friction\Codes\Dynare\getsteadystates.m (176, 2016-03-19)
DSGE中高级教程-笔记和源代码\Chap5_Financial_Friction\Codes\Dynare\get_bank_zero_profit_diff_cond_on_Rk.m (891, 2016-03-19)
DSGE中高级教程-笔记和源代码\Chap5_Financial_Friction\Codes\Dynare\get_omega_cond_on_sigma.m (1651, 2015-11-16)
DSGE中高级教程-笔记和源代码\Chap5_Financial_Friction\Codes\Dynare\reduce_to_small_interval.m (827, 2015-11-08)
DSGE中高级教程-笔记和源代码\Chap5_Financial_Friction\Codes\Dynare\steadystate.m (1985, 2016-03-19)
DSGE中高级教程-笔记和源代码\Chap5_Financial_Friction\Codes\lognormal.txt (346, 2015-10-28)
DSGE中高级教程-笔记和源代码\Chap5_Financial_Friction\Codes\numerical_example\conditional_on_Fomegabar\find_foc_difference.m (1770, 2016-03-18)
DSGE中高级教程-笔记和源代码\Chap5_Financial_Friction\Codes\numerical_example\conditional_on_Fomegabar\find_lognormal_difference.m (232, 2015-11-06)
DSGE中高级教程-笔记和源代码\Chap5_Financial_Friction\Codes\numerical_example\conditional_on_Fomegabar\find_sigma_cond_Fomegabar.m (894, 2016-03-18)
DSGE中高级教程-笔记和源代码\Chap5_Financial_Friction\Codes\numerical_example\conditional_on_Fomegabar\get_omega_cond_Fomegabar.m (2179, 2015-11-09)
DSGE中高级教程-笔记和源代码\Chap5_Financial_Friction\Codes\numerical_example\conditional_on_Fomegabar\main.m (564, 2016-03-18)
DSGE中高级教程-笔记和源代码\Chap5_Financial_Friction\Codes\numerical_example\conditional_on_sigma\find_foc_difference.m (838, 2016-03-18)
DSGE中高级教程-笔记和源代码\Chap5_Financial_Friction\Codes\numerical_example\conditional_on_sigma\get_omega_cond_sigma.m (1619, 2015-11-08)
DSGE中高级教程-笔记和源代码\Chap5_Financial_Friction\Codes\numerical_example\conditional_on_sigma\main.m (2738, 2016-03-19)
DSGE中高级教程-笔记和源代码\Chap5_Financial_Friction\Codes\numerical_example\conditional_on_sigma\reduce_to_small_interval.m (827, 2015-11-08)
DSGE中高级教程-笔记和源代码\Chap5_Financial_Friction\FinancialFricition_notes_XY.pdf (554849, 2016-07-06)
DSGE中高级教程-笔记和源代码\Chap5_Financial_Friction\Gamma_G.eps (13614, 2015-10-29)
DSGE中高级教程-笔记和源代码\Chap5_Financial_Friction\Gamma_G.fig (15859, 2015-10-29)
DSGE中高级教程-笔记和源代码\Chap5_Financial_Friction\level_log_utility_optimal.eps (15992, 2015-10-29)
DSGE中高级教程-笔记和源代码\Chap5_Financial_Friction\level_log_utility_optimal.fig (23699, 2015-10-29)
DSGE中高级教程-笔记和源代码\Chap5_Financial_Friction\leverage_spread_on_alternative_paras_setting.eps (20706, 2015-11-09)
DSGE中高级教程-笔记和源代码\Chap5_Financial_Friction\leverage_spread_on_alternative_paras_setting.fig (26827, 2015-11-09)
... ...
%These are notes on the use of code for computing optimal monetary
%policy that was prepared by Andy Levin (Federal Reserve Board). This code
%may be used freely. However, if you use it, please include an acknowledgement,
%'the code for this is taken from Andrew Levin, Lopez-Salido, J.D., 2004.
%"Optimal Monetary Policy with Endogenous Capital Accumulation", manuscript,
%Federal Reserve Board, and Andrew Levin, 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.
%The Levin code may be downloaded from
%http://faculty.wcas.northwestern.edu/~lchrist/d16/d1606/Get_Ramsey.zip
%Dynare (another software package that can be freely used, with
%attribution) may be downloaded from
%http://faculty.wcas.northwestern.edu/~lchrist/d16/d1606/dyn_mat_v3_0***.zip
%Instructions for running the optimal policy code
%
%Make sure that dynare and Andy Levin's code are in your MATLAB path. For
%example, in my computer I enter this at the MATLAB prompt:
%
% addpath('c:\projects\solve\dynare')
% addpath('c:\projects\solve\levin')
%
%In case dynare and Levin's code are in the same path where your programs
%reside, then there is no need to bother with the addpath commands.
%
%Suppose you place the basic monetary model with the exogenous policy rule in model.mod
%To study the properties of the model with the exogenous policy rule, simply type
%
% dynare model
%
%at the MATLAB command prompt.
%
%To get model.mod ready for optimal policy, you have to do several things.
%You must have two var statements, one with the
%variables to be optimized in the Ramsey problem, and one with the rest.
%(One exception is that Util and Welf must be included in the endogenous variables list and Andy
%Levin's code, sensibly, does not optimize with respect to these variables.)
%
%The var statement with the variables to be optimized in the
%Ramsey problem must be preceded by the comment:
%
% // Endogenous variables
%
%The var statement with the other 'endogenous' variables must be preceded
%by
% // Exogenous variables
%
%In practice, you would include the name of your economic shocks in the
%latter var statement.
%
%You must have, among the equations of the model, an equation that
%specifies an exogenous policy, preceded by the statement:
%
% // Monetary Policy Rule
%
%You must apply Levin's translation code to model.mod.
%This requires making sure the model.mod file is set up correctly. You will
%need to have two additional equations. One is exactly the following
%
% Welf = Util + nbeta*Welf(+1);
%
%These exact names MUST be used. The variables, Welf and Util must be included
%in the list of endogenous variables. The parameter, nbeta, must be set and
%included in the list of parameters. nbeta is the Ramsey problem discount
%rate which you might just want to equate to the private agents'
%discount rate.
%The second equation you must include is one that defines Util
%
% Util = ..... ;
%
%where the definition of your period utility should be placed where the dots
%are. Now you are ready to apply Levin's translation code.
%At the Matlab prompt, type
%
% infilename = 'model';
% outfilename = 'model_OUT';
% get_ramsey
%
%this writes a new dynare file, model_OUT.mod, in which the monetary policy
%rule is replaced by the first order conditions associated with the
%Lagrangian representation of the Ramsey problem.
%
%Once the translation is complete, things need to be done to the new
%program, model_OUT.mod, so that it can be run by Dynare.
%
%1. three var statements must be merged - the ones for endogenous and
%exogenous variables, and the one for the multipliers.
%
%2. you need to do a little (not much!) work to compute the steady state of
%the Ramsey problem. The call to the steady state program in model.mod
%computes the steady state in the version of the model with the exogenous
%monetary policy rule. In the optimal policy problem, the policy rule has
%been dropped and replaced by the Ramsey first order conditions. With two
%exceptions, get_ramsey computes the first order conditions with respect to
%all the variables you listed in the var statement after the
%// Endogenous variables command in model_OUT.mod. The two exceptions are
%Util and Welf. Getramsey does not differentiate with respect
%to these variables, because they do not represent binding restrictions
%on the level of utility that can be achieved in the Ramsey problem (i.e.,
%we know that their multipliers would be exactly zero).
%Suppose the number of variables with which you differentiate is N (N=4 in
%modelans_OUT.mod, which is what is output by getramsey when getramsey is
%applied to modelans.mod, my answer to homework #9).
%So, application of getramsey to your model_OUT.mod program replaces the
%monetary policy rule by N first order conditions. In addition, there are
%N-1 multipliers. The steady state value of these multipliers must be
%determined, in addition to the steady state value of the
%N endogenous variables. So, the steady state problem is different in the
%Ramsey problem than it is in the model with exogenous policy.
%The good news is that getramsey takes care of the most difficult part of
%this steady state problem.
%
%The strategy for finding the steady state of the Ramsey problem is as
%follows. You specify a conjectured value for the
%steady state inflation rate, say x. Then, you compute the values of the N-1
%endogenous variables that solve the steady state
%equilibrium conditions. For this step, you can simply use the steady state
%program that you use for the case when monetary policy was exogenous).
%Then, the steady state multipliers are found which
%solve the N first order conditions of the Ramsey problem. In general, you
%will not be able to solve this system, because you only have N-1 multipliers.
%The way the problem is solved, is you adjust the value of x until the N-1
%multipliers you compute solve all N Ramsey first order conditions.
%Then you are done. In our example, life is simple. The optimal inflation
%rate in the Ramsey problem is unity. (Many problems have this form, where you
%can easily conjecture the Ramsey steady state inflation rate. To see
%a series of these problems, have a look at the examples in
% http://faculty.wcas.northwestern.edu/~lchrist/d16/d1606/ramsey.htm
%A research paper which uses getramsey, and where it is easy to conjecture
%the steady state can be found in
%http://www.faculty.econ.northwestern.edu/faculty/christiano/research/ECB/m
%irage.htm).
%
%The only painful part of the Ramsey steady state computation is the
%computation of the N-1 multipliers conditional on the steady state values
%of the endogenous variables. Fortunately, getramsey.m writes a program that
%does this for you! To see how this works, have a look at the program, ssnew.
%
%The program which computes the steady state of the N-1 equilibrium
%conditions is called sstate.m. The program which computes the steady state
%of the multipliers is Levin's endogenously generated code, model_out_lmss.m
%
%make sure ssnew appears after the parameters statement with the multipliers
%
%
%3.%model_out_lmss.m must be adjusted in two ways:
%
%a. comment out the global statements at the start of the code.
%
%b. it is a good idea to remove the following commands:
%
% if errcheck > 1e-08,
% disp('Warning: steady states of lagrange multipliers cannot be accurately determined');
% disp([' errcheck = ',num2str(errcheck,12)]);
% end;
%
%this check need not be put anywhere else because it appears at the end of ssnew.
%leaving the check in model_out_lmss.m is a nuisance because
%this program is evaluated repeatedly if you need to try out different values of x
%in the process of computing a steady
%state. Until the steady state is found, the check would generate a warning.
近期下载者:
相关文件:
收藏者: