Solving a Dynamic Equilibrium Model
Total Page:16
File Type:pdf, Size:1020Kb
Solving a Dynamic Equilibrium Model Jes´us Fern´andez-Villaverde University of Pennsylvania 1 Basic RBC Social Planner’s problem: • ∞ t max E β log ct + ψ log (1 lt) { − } tX=0 α zt 1 α ct + kt+1 = k (e lt) − +(1 δ) kt, t>0 t − ∀ zt = ρzt 1 + εt, εt (0, σ) − ∼ N This is a dynamic optimization problem. • 2 Computing the RBC The previous problem does not have a known “paper and pencil” so- • lution. We will work with an approximation: Perturbation Theory. • We will undertake a first order perturbation of the model. • How well will the approximation work? • 3 Equilibrium Conditions From the household problem+firms’s problem+aggregate conditions: 1 1 α 1 zt 1 α = βEt 1+αkt − (e lt) − δ ct (ct+1 − ) c ³ ´ t α zt 1 α 1 ψ =(1 α) kt (e lt) − lt− 1 lt − − α zt 1 α ct + kt+1 = k (e lt) − +(1 δ) kt t − zt = ρzt 1 + εt − 4 Finding a Deterministic Solution We search for the first component of the solution. • If σ =0, the equilibrium conditions are: • 1 1 α 1 1 α = β 1+αkt − lt − δ ct ct+1 − ³ ´ ct α α ψ =(1 α) kt lt− 1 lt − − α 1 α ct + kt+1 = k l − +(1 δ) kt t t − 5 Steady State The equilibrium conditions imply a steady state: • 1 1 = β 1+αkα 1l1 α δ c c − − − c ³ ´ ψ =(1 α) kαl α 1 l − − − α 1 α c + δk = k l − The first equation can be written as: • 1 =1+αkα 1l1 α δ β − − − 6 Solving the Steady State Solution: µ k = Ω + ϕµ l = ϕk c = Ωk α 1 α y = k l − 1 1 1 1 α 1 α 1 α where ϕ = 1+δ − , Ω = ϕ δ and µ = (1 α) ϕ . α β − − − ψ − − ³ ³ ´´ 7 Linearization I Loglinearization or linearization? • Advantages and disadvantages • We can linearize and perform later a change of variables. • 8 Linearization II We linearize: 1 1 α 1 zt 1 α = βEt 1+αkt − (e lt) − δ ct (ct+1 − ) c ³ ´ t α zt 1 α 1 ψ =(1 α) kt (e lt) − lt− 1 lt − − α zt 1 α ct + kt+1 = k (e lt) − +(1 δ) kt t − zt = ρzt 1 + εt − around l, k, and c with a First-order Taylor Expansion. 9 Linearization III We get: 1 y 1 (ct+1 c)+α (1 α) β zt+1+ (ct c)=Et −c y − − k y −c − α (α 1) β (kt+1 k)+α (1 α) β (lt+1 l) ( − k2 − − kl − ) 1 1 α α (ct c)+ (lt l)=(1 α) zt + (kt k) (lt l) c − (1 l) − − k − − l − − y (1 α) z + α (k k)+(1 α) (l l) (c c)+(k k)= t k t −l t t t+1 µ − − − ¶ − − +(1 δ)(kt k) − − zt = ρzt 1 + εt − 10 Rewriting the System I Or: α1 (ct c)=Et α1 (ct+1 c)+α2zt+1 + α3 (kt+1 k)+α4 (lt+1 l) − { − − − } α (ct c)=α5zt + c (kt k)+α6 (lt l) − k − − (ct c)+(kt+1 k)=α7zt + α8 (kt k)+α9 (lt l) − − − − zt = ρzt 1 + εt − 11 Rewriting the System II where 1 y α1 = α2 = α (1 α) β −c y − ky α3 = α (α 1) β α4 = α (1 α) β − k2 − kl α 1 α5 =(1 α) c α6 = + c − − l (1 l) αµ − ¶ α7 =(1 α) y α8 = y k +(1 δ) (1−α) α 1 α − α9 = y −l y = k l − 12 Rewriting the System III After some algebra the system is reduced to: A (kt+1 k)+B (kt k)+C (lt l)+Dzt =0 − − − Et (G (kt+1 k)+H (kt k)+J (lt+1 l)+K (lt l)+Lzt+1 + Mzt)=0 − − − − Etzt+1 = ρzt 13 Guess Policy Functions We guess policy functions of the form (kt+1 k)=P (kt k)+Qzt and − − (lt l)=R (kt k)+Szt,plugtheminandget: − − A (P (kt k)+Qzt)+B (kt k) − − +C (R (kt k)+Szt)+Dzt =0 − G (P (kt k)+Qzt)+H (kt k)+J (R (P (kt k)+Qzt)+SNzt) − − − +K (R (kt k)+Szt)+(LN + M) zt =0 − 14 Solving the System I Since these equations need to hold for any value (kt+1 k)orzt we need − to equate each coefficient to zero, on (kt k): − AP + B + CR =0 GP + H + JRP + KR =0 and on zt: AQ + CS + D =0 (G + JR) Q + JSN + KS + LN + M =0 15 Solving the System II We have a system of four equations on four unknowns. • TosolveitnotethatR = 1 (AP + B)= 1 AP 1 B • −C −C − C Then: • B K GC KB HC P 2 + + P + − =0 µA J − JA¶ JA a quadratic equation on P . 16 Solving the System III We have two solutions: • 0.5 1 B K GC B K GC 2 KB HC P = + + 4 − −2 −A − J JA ± õA J − JA¶ − JA ! one stable and another unstable. If we pick the stable root and find R = 1 (AP + B)wehavetoa • −C system of two linear equations on two unknowns with solution: D (JN + K)+CLN + CM Q = − AJN + AK CG CJR ALN AM−+ DG−+ DJR S = − − AJN + AK CG CJR − − 17 Practical Implementation How do we do this in practice? • Solving quadratic equations: “A Toolkit for Analyzing Nonlinear Dy- • namic Stochastic Models Easily” by Harald Uhlig. Using dynare. • 18 General Structure of Linearized System Given m states xt,ncontrols yt, and k exogenous stochastic processes zt+1, we have: Axt + Bxt 1 + Cyt + Dzt =0 − Et (Fxt+1 + Gxt + Hxt 1 + Jyt+1 + Kyt + Lzt+1 + Mzt)=0 − Etzt+1 = Nzt where C is of size l n, l n and of rank n, that F is of size (m + n l) × ≥ − × n, and that N has only stable eigenvalues. 19 Policy Functions We guess policy functions of the form: xt = Pxt 1 + Qzt − yt = Rxt 1 + Szt − where P, Q, R, and S are matrices such that the computed equilibrium is stable. 20 Policy Functions For simplicity, suppose l = n. See Uhlig for general case (I have never be in the situation where l = n did not hold). Then: 1. P satisfies the matrix quadratic equation: F JC 1A P 2 JC 1B G + KC 1A P KC 1B +H =0 − − − − − − − − The³ equilibrium´ is stable³ iff max (abs (eig (P )))´ < 1. 2. R is given by: R = C 1 (AP + B) − − 21 3. Q satisfies: N F JC 1A + I JR + FP + G KC 1A vec (Q) 0 ⊗ − − k ⊗ − − ³ = vec ´JC 1D ³ L N + KC 1D M ´ − − − − ³³ ´ ´ 4. S satisfies: S = C 1 (AQ + D) − − 22 How to Solve Quadratic Equations To solve ΨP 2 ΓP Θ =0 − − for the m m matrix P : × 1. Define the 2m 2m matrices: × ΓΘ Ψ 0 Ξ = , and ∆ = m " Im 0m # " 0m Im # 2. Let s be the generalized eigenvector and λ be the corresponding generalized eigenvalue of Ξ with respect to ∆. Then we can write s = λx ,x for some x m. 0 0 0 ∈ < £ ¤ 23 3. If there are m generalized eigenvalues λ1, λ2,...,λm together with gen- eralized eigenvectors s1,...,sm of Ξ with respect to ∆, written as m s = λx ,x for some x and if (x1, ..., xm) is linearly inde- 0 i0 i0 i ∈ < pendent,h then:i 1 P = ΩΛΩ− is a solution to the matrix quadratic equation where Ω =[x1,...,xm] and Λ =[λ1, ..., λm]. The solution of P is stable if max λ < 1. | i| Conversely, any diagonalizable solution P canbewritteninthisway. 24 How to Implement This Solver Available Code: 1. My own code: undeter1.m. 2. Uhlig’s web page: http://www.wiwi.hu-berlin.de/wpol/html/toolkit.htm 25 An Alternative Dynare What is Dynare? A platform for the solution, simulation, and estima- • tion of DSGE models in economics. Developed by Michel Juilliard and collaborators. • Iamoneofthem:) • http://www.cepremap.cnrs.fr/dynare/ • 26 Dynare takes a more “blackbox approach”. • However, you can access the files... • ...and it is very easy to use. • Short tutorial. • 27 Our Benchmark Model We are now ready to compute our benchmark model. • We begin finding the steady state. • As before, a variable x with no time index represent the value of that • variable in the steady state. 28 Steady State I From the first order conditions of the household:. • c σ = βc σ (r +1 δ) − − − } R c σ = βc σ − − π γ σ ψl = c− w We forget the money condition because the central bank, through • open market operations, will supply all the needed money to support the chosen interest rate. Also,wenormalizethepriceleveltoone. • 29 Steady State II From the problem of the intermediate good producer: • α w k = l 1 α r − Also: • 1 α α 1 − 1 1 α α mc = w − r µ1 α¶ µα¶ −p ε ∗ = mc p ε 1 − where A =1. 30 Steady State III Now, since p = p: • ∗ 1 1 α 1 α ε 1 − w1 αrα = − 1 α α − ε µ − ¶ µ ¶ By markets clearing: • α 1 α c + δk = y = k l − wherewehaveusedthefactthatx = δk and that: A =1 v The Taylor rule will be trivially satisfied and we can drop it from the • computation. 31 Steady State IV Our steady state equations, cancelling redundant constants are: • 1 r = 1+δ β − 1 R = π β γ σ ψl = c− w α w k = l 1 α r 1 α α− 1 − 1 1 α α ε 1 w − r = − µ1 α¶ µα¶ ε − α 1 α c + δk = k l − A system of six equations on six unknowns.