{"id":61,"date":"2023-03-08T16:42:01","date_gmt":"2023-03-08T20:42:01","guid":{"rendered":"https:\/\/sites.nd.edu\/edennis\/?page_id=61"},"modified":"2023-12-07T14:39:05","modified_gmt":"2023-12-07T18:39:05","slug":"matlab-and-dynare-codes","status":"publish","type":"page","link":"https:\/\/sites.nd.edu\/esims\/matlab-and-dynare-codes\/","title":{"rendered":"Matlab and Dynare Codes"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">This page provides Matlab and Dynare files for a few different DSGE papers\/models. Typically, I have an &#8220;execution&#8221; .m file that sets parameters, plots IRFs, and computes moments. This execution file calls the Dynare .mod file. Please note: all links here are to pdf versions of the .m and .mod files (the Dynare files are saved as &#8220;_mod.pdf&#8221; &#8212; replace the &#8220;_&#8221; with a &#8220;.&#8221; and save as a &#8220;.mod&#8221; file). Anyone may use these files with proper acknowledgment. I make no guarantees that the codes are error free.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Carlstrom and Fuerst (1997,&nbsp;<em>AER<\/em>):\n\n\n\n\n\n\n\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/sites.nd.edu\/esims\/files\/2023\/07\/execute_cf97_new.pdf\" data-type=\"attachment\" data-id=\"634\">Execution<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/sites.nd.edu\/esims\/files\/2023\/07\/cfp2017_mod.pdf\" data-type=\"attachment\" data-id=\"619\">Dynare<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/sites.nd.edu\/esims\/files\/2023\/07\/find_cf.pdf\" data-type=\"attachment\" data-id=\"666\">Other<\/a>&nbsp;(to calibrate steady state)<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Kiyotaki and Moore (1997,&nbsp;<em>JPE<\/em>):\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/sites.nd.edu\/esims\/files\/2023\/07\/execute_km97.pdf\" data-type=\"attachment\" data-id=\"650\">Execution<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/sites.nd.edu\/esims\/files\/2023\/07\/km97_mod.pdf\" data-type=\"attachment\" data-id=\"615\">Dynare<\/a>&nbsp;<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Bernanke, Gertler, and Gilchrist (1999,&nbsp;<em>Handbook of Macroeconomics<\/em>):\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/sites.nd.edu\/esims\/files\/2023\/07\/execute_bgg99.pdf\" data-type=\"attachment\" data-id=\"633\">Execution<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/sites.nd.edu\/esims\/files\/2023\/07\/bgg_ers_mod.pdf\" data-type=\"attachment\" data-id=\"617\">Dynare<\/a><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Iacoviello (2005,&nbsp;<em>AER<\/em>):\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/sites.nd.edu\/esims\/files\/2023\/07\/execute_iacoviello_nonlin.pdf\" data-type=\"attachment\" data-id=\"652\">Execution<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/sites.nd.edu\/esims\/files\/2023\/07\/iacoviello_2005_base_nonlin_mod.pdf\" data-type=\"attachment\" data-id=\"623\">Dynare<\/a><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Jermann and Quadrini (2012,&nbsp;<em>AER<\/em>):\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/sites.nd.edu\/esims\/files\/2023\/07\/execute_jermann_quadrini_rbc.pdf\" data-type=\"attachment\" data-id=\"651\">Execution<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/sites.nd.edu\/esims\/files\/2023\/07\/jermann_quadrini_rbc_mod.pdf\" data-type=\"attachment\" data-id=\"614\">Dynare<\/a><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Schmitt-Grohe and Uribe (2012,&nbsp;<em>Econometrica<\/em>)\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/sites.nd.edu\/esims\/files\/2023\/07\/sgu_model_main.pdf\" data-type=\"attachment\" data-id=\"635\">Execution<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/sites.nd.edu\/esims\/files\/2023\/07\/sgu_model_mod.pdf\" data-type=\"attachment\" data-id=\"612\">Dynare<\/a><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Carlstrom, Fuerst, and Paustian (2017,&nbsp;<em>AEJ: Macro<\/em>):\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/sites.nd.edu\/esims\/files\/2023\/07\/execute_cfp2017.pdf\" data-type=\"attachment\" data-id=\"642\">Execution<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/sites.nd.edu\/esims\/files\/2023\/07\/cfp2017_mod.pdf\" data-type=\"attachment\" data-id=\"619\">Dynare<\/a><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Sims and Wu (2020,&nbsp;<em>JME<\/em>):\n<ul class=\"wp-block-list\">\n<li>Execution:&nbsp;<a href=\"https:\/\/sites.nd.edu\/esims\/files\/2023\/07\/execute_sw2020.pdf\" data-type=\"attachment\" data-id=\"663\">base<\/a>,&nbsp;<a href=\"https:\/\/sites.nd.edu\/esims\/files\/2023\/07\/execute_sw2020_zlb.pdf\" data-type=\"attachment\" data-id=\"662\">zlb<\/a>,&nbsp;<a href=\"https:\/\/sites.nd.edu\/esims\/files\/2023\/07\/execute_sw2020_zlb_endo_qe.pdf\" data-type=\"attachment\" data-id=\"661\">zlb w\/ endogenous QE<\/a><\/li>\n\n\n\n<li>Dynare:&nbsp;<a href=\"https:\/\/sites.nd.edu\/esims\/files\/2023\/07\/sw_2020_mod.pdf\" data-type=\"attachment\" data-id=\"629\">base<\/a>,&nbsp;<a href=\"https:\/\/sites.nd.edu\/esims\/files\/2023\/07\/sw2020_zlb_mod.pdf\" data-type=\"attachment\" data-id=\"630\">zlb<\/a>,&nbsp;<a href=\"https:\/\/sites.nd.edu\/esims\/files\/2023\/07\/sw_2020_zlb_endo_mod.pdf\" data-type=\"attachment\" data-id=\"628\">zlb w\/ endogenous QE<\/a>\n<ul class=\"wp-block-list\">\n<li>I flipped the definitions of auxiliary multipliers M1 and M2 relative to what is in the paper.<\/li>\n\n\n\n<li>One must use the occbin toolkit of Guerrieri and Iacoviello (2015,&nbsp;<em>JME<\/em>) in order to solve the ZLB parts.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>RBC model with productivity, government spending, and labor supply preference shocks:\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/sites.nd.edu\/esims\/files\/2023\/07\/execute_rbc.pdf\" data-type=\"attachment\" data-id=\"655\">Execution<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/sites.nd.edu\/esims\/files\/2023\/07\/rbc_mod.pdf\" data-type=\"attachment\" data-id=\"622\">Dynare<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/sites.nd.edu\/esims\/files\/2023\/07\/rbc_steadystate.pdf\" data-type=\"attachment\" data-id=\"658\">Steady state file<\/a>\n<ul class=\"wp-block-list\">\n<li>I solve analytically for the steady state rather than giving initial conditions<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Small-scale New Keynesian model with government spending and productivity shocks:\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/sites.nd.edu\/esims\/files\/2023\/05\/dnk_gov_spending.pdf\" data-type=\"attachment\" data-id=\"556\">Notes<\/a><\/li>\n\n\n\n<li>No ZLB\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/sites.nd.edu\/esims\/files\/2023\/07\/execute_dnk_reduced.pdf\" data-type=\"attachment\" data-id=\"641\">Execution<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/sites.nd.edu\/esims\/files\/2023\/07\/dnk_reduce_mod.pdf\" data-type=\"attachment\" data-id=\"625\">Dynare<\/a><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Deterministic peg as proxy for ZLB\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/sites.nd.edu\/esims\/files\/2023\/07\/execute_dnk_reduced_det_zlb.pdf\" data-type=\"attachment\" data-id=\"647\">Execution<\/a><\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Stochastic peg as proxy for ZLB\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/sites.nd.edu\/esims\/files\/2023\/07\/execute_dnk_reduced_stoch_zlb.pdf\" data-type=\"attachment\" data-id=\"646\">Execution<\/a><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li>Small-scale New Keynesian model with price and wage stickiness (non-linear version of model):\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/sites.nd.edu\/esims\/files\/2023\/05\/dnk_price_wage.pdf\" data-type=\"attachment\" data-id=\"557\">Notes<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www3.nd.edu\/~esims1\/execute_dnk_wage.m\">Execution<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/sites.nd.edu\/esims\/files\/2023\/07\/dnk_wage_mod.pdf\" data-type=\"attachment\" data-id=\"624\">Dynare<\/a><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>This page provides Matlab and Dynare files for a few different DSGE papers\/models. Typically, I have an &#8220;execution&#8221; .m file that sets parameters, plots IRFs, and computes moments. This execution file calls the Dynare .mod file. Please note: all links here are to pdf versions of the .m and .mod files (the Dynare files are [&hellip;]<\/p>\n","protected":false},"author":4487,"featured_media":0,"parent":0,"menu_order":4,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-61","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/sites.nd.edu\/esims\/wp-json\/wp\/v2\/pages\/61","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sites.nd.edu\/esims\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/sites.nd.edu\/esims\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/sites.nd.edu\/esims\/wp-json\/wp\/v2\/users\/4487"}],"replies":[{"embeddable":true,"href":"https:\/\/sites.nd.edu\/esims\/wp-json\/wp\/v2\/comments?post=61"}],"version-history":[{"count":23,"href":"https:\/\/sites.nd.edu\/esims\/wp-json\/wp\/v2\/pages\/61\/revisions"}],"predecessor-version":[{"id":692,"href":"https:\/\/sites.nd.edu\/esims\/wp-json\/wp\/v2\/pages\/61\/revisions\/692"}],"wp:attachment":[{"href":"https:\/\/sites.nd.edu\/esims\/wp-json\/wp\/v2\/media?parent=61"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}