optimal policy computation with dynare
play

Optimal policy computation with Dynare MONFISPOL workshop, Stresa - PowerPoint PPT Presentation

Optimal policy computation with Dynare MONFISPOL workshop, Stresa Michel Juillard 1 March 12, 2010 1 Bank of France and CEPREMAP Introduction Dynare currently implements two manners to compute optimal policy in DSGE models optimal rule


  1. Optimal policy computation with Dynare MONFISPOL workshop, Stresa Michel Juillard 1 March 12, 2010 1 Bank of France and CEPREMAP

  2. Introduction Dynare currently implements two manners to compute optimal policy in DSGE models ◮ optimal rule under commitment (Ramsey policy) ◮ optimal simple rules

  3. A New Keynesian model Thanks to Eleni Iliopulos! Utility function: ln C t − φ N 1 + γ t U t = 1 + γ 1 U c , t = C t U N , t − φ N γ = t

  4. Recursive equilibrium � � R t 1 1 = β E t C t C t + 1 π t + 1 � π t + 1 � π t ( π t − 1 ) = β E t ( π t + 1 − 1 ) C t C t + 1 � φ C t N γ � + ε A t N t − ε − 1 t C t A t ω ε A t N t = C t + ω 2 ( π t − 1 ) 2 ln A t = ρ ln A t − 1 + ǫ t

  5. Ramsey problem � ∞ ln C t − φ N 1 + γ � β t t max E 0 1 + γ t = 0 � 1 � �� R t 1 − β E t − µ 1 , t C t C t + 1 π t + 1 � π t � π t + 1 � ( π t − 1 ) − β E t − µ 2 , t ( π t + 1 − 1 ) C t C t + 1 � φ C t N γ �� − ε A t N t − ε − 1 t C t A t ω ε � 2 ( π t − 1 ) 2 � A t N t − C t − ω − µ 3 , t � − µ 4 , t ( ln A t − ρ ln A t − 1 − ǫ t ) µ i , t = λ i , t β t where λ i , t is a Lagrange multiplier.

  6. F .O.C. C t R t − 1 � � + 1 µ 1 , t − 1 [ 2 π t − 1 ] µ 2 , t − µ 2 , t − 1 = µ 3 , t ω ( C t π 2 t � � R t − 1 π t ( π t − 1 ) + A t N t − µ 1 , t 1 1 + µ 1 , t − 1 − µ 2 , t ( ε − 1 ) C t C 2 C 2 C 2 t π t ω t t 1 + µ 2 , t − 1 [ π t ( π t − 1 )] = µ 3 , t C 2 t A t t + φ ε φ N γ ω N γ C t ω ( ε − 1 ) = µ 3 , t A t t µ 2 , t ( γ + 1 ) − µ 2 , t N t µ 2 , t ( ε − 1 ) + µ 3 , t N t + µ 4 , t − ρβµ 4 , t + 1 = 0 C t A t A t ω � � 1 µ 1 , t β E t = 0 C t + 1 π t + 1

  7. Dynare code 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;

  8. Dynare code (continued) 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;

  9. Dynare code (continued) initval; pai=1; r=1/beta; c=0.96717; n=0.96717; a=0; 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);

  10. Ramsey policy: General nonlinear case ∞ � β τ − t U ( y τ ) E t max { y τ } ∞ τ = t τ = 0 s.t. E τ f ( y τ + 1 , y τ , y τ − 1 , ε τ ) = 0 y t ∈ R n : endogenous variables ε t ∈ R p : stochastic shocks and f : R 3 n + p → R m There are n − m free policy instruments.

  11. Lagrangian The Lagrangian is written ∞ � β τ − t U ( y τ ) − [ λ τ ] η [ f ( y τ + 1 , y τ , y τ − 1 , ε τ )] η L ( y t − 1 , ε t ) = E t τ = t where λ τ is a vector of m Lagrange multipliers We adopt tensor notations because later on we will have to deal with the second order derivatives of [ λ ( s t )] η [ F ( s t )] η γ . It turns out that it is the discounted value of the Lagrange multipliers that are stationary and not the multipliers themselves. It is therefore handy to rewrite the Lagrangian as β τ − t � U ( y τ ) − [ µ τ ] η [ f ( y τ + 1 , y τ , y τ − 1 , ε τ )] η � ∞ � L ( y t − 1 , ε t ) = E t τ = t whith µ t = λ τ /β τ − t .

  12. Optimization problem reformulated The optimization problem becomes ∞ β τ − t � U ( y τ ) − [ µ τ ] η [ f ( y τ + 1 , y τ , y τ − 1 , ε τ )] η � � E t max min { y τ } ∞ { λ τ } ∞ τ = t τ = t τ = t for y t − 1 given.

  13. First order necessary conditions Derivatives of the Lagrangian with respect to endogenous variables: � ∂ L � � = E t [ U 1 ( y t )] α − [ µ t ] η [ f 2 ( y t + 1 , y t , y t − 1 , ε t )] η ∂ y t α α � − β [ µ t + 1 ] η [ f 3 ( y t + 2 , y t + 1 , y t , ε t + 1 )] η τ = t α � ∂ L � � = E t [ U 1 ( y τ )] α − [ µ τ ] η [ f 2 ( y τ + 1 , y τ , y τ − 1 , ε τ )] η ∂ y τ α α − β [ µ τ + 1 ] η [ f 3 ( y τ + 2 , y τ + 1 , y τ , ε τ + 1 )] η α � − β − 1 [ µ τ − 1 ] η [ f 1 ( y τ , y τ − 1 , y τ − 2 , ε τ − 1 )] α τ > t

  14. First order conditions The first order conditions of this optimization problem are � E t [ U 1 ( y τ )] α − [ µ τ ] η [ f 2 ( y τ + 1 , y τ , y τ − 1 , ε τ )] η α − β [ µ τ + 1 ] η [ f 3 ( y τ + 2 , y τ + 1 , y τ , ε τ + 1 )] η α � − β − 1 [ µ τ − 1 ] η [ f 1 ( y τ , y τ − 1 , y τ − 2 , ε τ − 1 )] η = 0 α [ f ( y τ + 1 , y τ , y τ − 1 , ε τ )] η = 0 with µ t − 1 = 0 and where U 1 () is the Jacobian of function U () with respect to y τ and f i () is the first order partial derivative of f () with respect to the i th argument.

  15. Cautionary remark The First Order Conditions for optimality are only necessary conditions for a maximum. Levine, Pearlman and Pierse (2008) propose algorithms to check a sufficient condition. I still need to adapt it to the present framework where the dynamic conditions, f () are given as implicit functions and variables can be both predetermined and forward looking.

  16. Nature of the solution The above system of equations is nothing but a larger system of nonlinear rational expectation equations. As such, it can be approximated either to first order or to second order. The solution takes the form � y t � g ( y t − 2 , y t − 1 , µ t − 1 , ε t − 1 , ε t ) = ˆ µ t The optimal policy is then directly obtained as part of the set of g () functions.

  17. The steady state problem The steady state is solution of ′ � U 1 (¯ y ) − ¯ f 2 (¯ y , ¯ y , ¯ y , 0 ) + β f 3 (¯ y , ¯ y , ¯ y , 0 ) µ � + β − 1 f 1 (¯ y , ¯ y , ¯ y , 0 ) = 0 f (¯ y , ¯ y , ¯ y , 0 ) = 0

  18. Computing the steady state y , it is possible to use the first matrix equation For a given value ˜ above to obtain the value of ˜ µ that minimizes the sum of square residuals, e : M f 2 (˜ y , ˜ y , ˜ y , ˜ x , 0 ) + β f 3 (˜ y , ˜ y , ˜ y , ˜ x , 0 ) = + β − 1 f 1 (˜ y , ˜ y , ˜ y , 0 ) y ) M ′ � MM ′ � − 1 U 1 (˜ µ ′ ˜ = e ′ U 1 (˜ y ) − ˜ µ ′ M = y must satisfy the m equations Furthermore, ˜ f (˜ y , ˜ y , ˜ y , 0 ) = 0 It is possible to build a sytem of equations whith only n unkowns y , but we must provide n − m independent measures of the ˜ residuals e . Independent in the sense that the derivatives of y must be linearly independent. these measures with respect to ˜

  19. A QR trick At the steady state, the following must hold exactly U 1 (˜ y ) = ¯ µ ′ M This can only be if � � M M ⋆ = U 1 (˜ y ) is of rank m The reordered QR decomposition of M ⋆ is such that M ⋆ E Q R = ( m + 1 ) × n n × n ( m + 1 ) × ( m + 1 ) ( m + 1 ) × n where E is a permutation matrix, Q an orthogonal matrix and R a triangular matrix with diagonal elements ordered in decreasing size.

  20. A QR trick (continued) ◮ When U 1 (˜ y ) = ¯ µ ′ M doesn’t hold exactly M ⋆ is full rank ( m + 1) and the n − m last elements of R may be different from zero. µ ′ M holds exactly M ⋆ has rank m and the ◮ When U 1 (˜ y ) = ¯ n − m last elements of R are zero. ◮ The last n − m elements of the last row of R provide the n − m independent measures of the residuals e y as input ◮ In practice, we build a nonlinear function with ˜ and that returns the n − m last elements of the last row of R and f (˜ y , ˜ y , ˜ y , 0 ) . At the solution, when ˜ y = ¯ y , this function must return zeros.

  21. When an analytical solution is available Let’s write y x the n − m policy instruments and y y , the m remaining endogenous variables, such that � y ⋆ � y ⋆ = x . y ⋆ y The analytical solution is given by y ⋆ y = ˜ f ( y ⋆ x ) . We have then f ( y ⋆ , y ⋆ , y ⋆ , 0 ) = 0 Combining this analytical solution with the n − m residuals computed above, we can reduce the steady state problem to a system of n − m nonlinear equations that is much easier to solve.

  22. First order approximation of the FOCs � �� � γ − [ � α − β − 1 [ � E t [ U 11 ] αγ y t µ t ] η [ f 2 ] η µ t + 1 ] η [ f 3 ] η µ t − 1 ] η [ f 1 ] η α − β [ � α � � � �� �� � γ + β − 1 [ f 13 ] η �� � γ + � γ β [ f 13 ] η y t + 2 y t − 2 [ f 12 ] η γα + β [ f 23 ] η y t + 1 − [¯ µ ] η γα αγ γα � � �� � � �� � γ + � γ αγ + β − 1 [ f 12 ] η αγ + β − 1 [ f 11 ] η [ f 23 ] η y t − 1 [ f 33 ] η αγ + β [ f 22 ] η y t + αγ αγ �� ε t ] δ + β [ f 34 ] η ε t + 1 ] δ + β − 1 [ f 14 ] η + [ f 24 ] η ε t − 1 ]] δ αδ [ � αδ [ � αδ [ � = 0 � �� � γ + [ f 2 ] ηγ �� � γ + [ f 3 ] ηγ �� � γ + [ f 4 ] ηδ [ � ε t ] δ � E t [ f 1 ] ηγ y t + 1 y t y t − 1 = 0 y t = y t − ¯ y , � µ and f ij the second order where � µ t = µ t − ¯ derivatives corresponding to the i th and the j th argument of the f () function.

  23. The first pitfall A naive approach ot linear-quadratic appoximation that would consider a linear approximation of the dynamics of the system and a second order approximation of the objective function, ignores the second order derivatives f ij that enter in the first order approximation of the dynamics of the model under optimal policy.

Recommend


More recommend