#!/usr/bin/env python # coding: utf-8 # # A stylized New Keynesian Model # # This notebook is part of a computational appendix that accompanies the paper. # # > MATLAB, Python, Julia: What to Choose in Economics? # >> Coleman, Lyon, Maliar, and Maliar (2017) # # In this notebook we summarize the key equations for the stylized New Keynesian model we solved in the paper. # # For more information on the model itself see section 5 of # # > Maliar, L., & Maliar, S. (2015). Merging simulation and projection approaches to solve high-dimensional problems with an application to a new Keynesian model. Quantitative Economics, 15(7), 424. http://doi.org/10.1186/s13059-014-0424-0 # The model features Calvo-type price frictions and a # Taylor (1993) rule. The economy is populated by households, final-good # firms, intermediate-good firms, a monetary authority and government. # # In the equations below, the following variables appear: # # - $\pi$: profit of intermediate good firms # - $S$, $F$: intermediate variables introduced to help notation below # - $C$: Consumption # - $G$: Level of government spending # - $Y$: Final goods production # - $L$: Labor supply # - $\Delta$: measure of price dispersion across firms (also referred to as efficiency distortion) # - $Y_N$: Natural level of final goods production -- it is the level of $Y$ in the planner's solution, or the level of $Y$ in the model without distorting taxes. # - $\bar{G}$: steady-state share of government spendint in output # - $R$: gross nominal interest rate # - $\eta_u$: exogenous preference shock to utility # - $\eta_L$: exogenous preference shock to labor dis-utility # - $\eta_B$: exogenous premium on bond returns # - $\eta_a$: log of productivity of intermediate goods firms # - $\eta_G$: government spending shock # - $\eta_R$: monetary shock to interest rate # # We also see the following parameters: # # - $\beta$: discount factor # - $\varepsilon$: Parameter in Dixit-Stiglitz aggregator over intermediate goods # - $\theta$: Calvo-parameter -- a fraction (1-$\theta$) of firms set prices optimally each period. # - $\gamma$, $\vartheta$: utility function parameters # - $\pi^*$: target inflation # - $\phi_y$, $\phi_{\pi}$, $\mu$: Taylor rule parameters # In our computation we will approximate $S_t$, $F_t$ and $C_t$ using a complete monomial of degree N. Given these three variables, we express the equilibrium conditions of the model in the following way: # # \begin{eqnarray} # \pi_{t} &=& \left(\frac{1-(1-\theta)}{\theta}\left(\frac{S_t}{F_t}\right)^{1- \varepsilon}\right)^{\frac{1}{\varepsilon-1}} \\ # \Delta _{t} &=&\left[ \left( 1-\theta \right) \left[ \frac{1-\theta \pi # _{t}^{\varepsilon -1}}{1-\theta }\right] ^{\frac{\varepsilon }{\varepsilon -1% # }}+\theta \frac{\pi _{t}^{\varepsilon }}{\Delta _{t-1}}\right] ^{-1} \\ # Y_t &=& \frac{C_t}{1-\frac{\bar{G}}{\exp\left(\eta_{G,t}\right)}} \\ # L_t &=& \frac{Y_t }{\exp\left(\eta_{a,t}\right) \Delta_t} \\ # Y_{N,t} &=& \left[ \frac{\exp \left( \eta _{a,t}\right) ^{1+\vartheta }\left[1- \frac{\bar{G}}{\exp \left( \eta _{G,t}\right)} \right] ^{-\gamma}}{\exp \left( \eta_{L,t}\right) }\right] ^{\frac{1}{\vartheta +\gamma }}\\ # R_{t} &=& \max \left\{1, \frac{\pi^*}{\beta} \left(R_{t-1} \frac{\beta}{\pi^*} \right)^{\mu} \left(\left(\frac{\pi_t}{\pi^*}\right)^{\phi_{\pi}} \left(\frac{Y_t}{Y_{N,t}} \right)^{\phi_y} \right)^{1-\mu}\exp\left(\eta_{R,t}\right) \right\}. # \end{eqnarray} # # The Euler equations are given by # # \begin{eqnarray} # S_{t} &=&\frac{\exp \left( \eta _{u,t}+\eta _{L,t}\right) }{\left[ \exp # \left( \eta _{a,t}\right) \right] ^{\vartheta +1}}\frac{\left( # G_{t}^{-1}C_{t}\right) ^{1+\vartheta }}{\left( \Delta _{t}\right) # ^{\vartheta }}+\beta \theta E_{t}\left \{ \pi _{t+1}^{\varepsilon # }S_{t+1}\right \} \\ # F_{t} &=&\exp \left( \eta _{u,t}\right) C_{t}^{1-\gamma }G_{t}^{-1}+\beta # \theta E_{t}\left \{ \pi _{t+1}^{\varepsilon -1}F_{t+1}\right \} \\ # C_{t}^{-\gamma } &=&\beta \frac{\exp \left( \eta _{B,t}\right) }{\exp \left( # \eta _{u,t}\right) }R_{t}E_{t}\left[ \frac{C_{t+1}^{-\gamma }\exp \left( # \eta _{u,t+1}\right) }{\pi _{t+1}}\right] # \end{eqnarray}