p olicy f unctions l ump s um t axes
play

P OLICY F UNCTIONS (L UMP -S UM T AXES ) = 0 = 0.25 = 0.50 = 0.75 - PowerPoint PPT Presentation

A N I NTRODUCTION TO N ONLINEAR S OLUTION AND E STIMATION T ECHNIQUES Alexander W. Richter Federal Reserve Bank of Dallas Nathaniel A. Throckmorton College of William & Mary The views expressed in this presentation are our own and do not


  1. A N I NTRODUCTION TO N ONLINEAR S OLUTION AND E STIMATION T ECHNIQUES Alexander W. Richter Federal Reserve Bank of Dallas Nathaniel A. Throckmorton College of William & Mary The views expressed in this presentation are our own and do not necessarily reflect the views of the Federal Reserve Bank of Dallas or the Federal Reserve System.

  2. T OOLBOX F UNCTIONS • script.m : assigns options to O and runs the algorithm • parameters.m : assigns model parameters to P • steadystate.m : assigns steady state values to S ( P ) • variables.m : outputs a structure, V , containing indices of variables, forecast errors, and shocks and variable titles • grids.m : assigns the discretized state space to G ( O , P ) • guess.m : assigns the initial conjectures to pf ( O , P , S , G ) • linmodel.m : outputs the linear transition matrix, T , the impact matrix, M , and a 2 -element vector of flags, eu , indicating existence and uniqueness of the linear solution • eqm.m : outputs a vector, R , containing the residuals to a subsystem of expectational equations that are constrained by all of the other equations in the equilibrium system R ICHTER AND T HROCKMORTON : A N I NTRODUCTION TO N ONLINEAR S OLUTION AND E STIMATION T ECHNIQUES

  3. E XAMPLE : R EAL B USINESS C YCLE M ODEL A social planner chooses { c t , k t +1 } ∞ t =0 to maximize: ∞ β t c 1 − σ � t E 0 1 − σ t =0 subject to c t + k t +1 = z t k α t + (1 − δ ) k t z t = (1 − ρ )¯ z + ρz t − 1 + ε t Optimality condition: 1 = βE t [( c t /c t +1 ) σ ( αz t +1 k α − 1 t +1 + 1 − δ ) ] � �� � ≡ Φ( z t +1 ) R ICHTER AND T HROCKMORTON : A N I NTRODUCTION TO N ONLINEAR S OLUTION AND E STIMATION T ECHNIQUES

  4. D ISCRETIZED S TATE S PACE • State variables: k t , z t • Number of grid points: N k , N z • Grid boundaries: [ k min , k max ] and [ z min , z max ] • Create evenly spaced grids: x grid = linspace ( x min , x max , N x ) , x ∈ { k, z } • State space contains N = N k × N z independent nodes • Create an array for each state variable, where every position is a unique permutation of the state space: [ k gr , z gr ] = ndgrid ( k grid , z grid ) R ICHTER AND T HROCKMORTON : A N I NTRODUCTION TO N ONLINEAR S OLUTION AND E STIMATION T ECHNIQUES

  5. F UNCTIONAL A PPROXIMATION • True RE solution only exists in special cases (e.g., δ = 1 ) • Goal: Find an approximating function that maps the state space to the optimal decision rule for consumption: c ( k, z ) ≈ P c ( k, z ) � �� � � �� � True RE Solution Approximating Function • Basic elements of the algorithm: 1. Interpolation: Linear, Least squares 2. Integration: Gauss-Hermite, Trapezoid, Rouwenhorst 3. Iteration: Time, Fixed-point R ICHTER AND T HROCKMORTON : A N I NTRODUCTION TO N ONLINEAR S OLUTION AND E STIMATION T ECHNIQUES

  6. I NITIAL C ONJECTURE Use the linear solution as a guess for P c ( k, z ) : • Linear solution from gensys.m takes the form: Y ′ = T ˆ ˆ Y + Mε where ˆ Y = [ˆ c ] T , ˆ x , and ε ∼ N (0 , σ 2 ) . k, ˆ z, ˆ x ≡ ( x t − ¯ x ) / ¯ • Convert the state space to deviations from steady state • Compute an initial conjecture for all nodes ( i = 1 , . . . , N ): [vec(ˆ ˆ z gr )] T P c = T ( c idx , [ k idx , z idx ]) k gr ) , vec(ˆ � �� � � �� � 1 × 2 2 × N • Convert ˆ c (1 + ˆ P c ) ) and assign to pf.c P c to levels ( P c = ¯ R ICHTER AND T HROCKMORTON : A N I NTRODUCTION TO N ONLINEAR S OLUTION AND E STIMATION T ECHNIQUES

  7. L OCAL A PPROXIMATION • Piecewise Linear Interpolation: 2 state variables ( k, z ) • Goal: Find the policy function value P c ( k ′ , z ′ ) • We have policy function values on nearest nodes [ P c ( k i , z j ) , P c ( k i , z j +1 ) , P c ( k i +1 , z j ) , P c ( k i +1 , z j +1 )] once we determine the grid indices, i, j • Locate the grid point to left of x ′ , x ∈ { k, z } dist = x ′ − x 1 step = x 2 − x 1 , loc = min( N x − 1 , max(1 , floor( dist / step ) + 1)) dist loc c loc a loc b ′ step ′ ′ x c x 1 x 2 x 3 x 4 x 5 x b x a R ICHTER AND T HROCKMORTON : A N I NTRODUCTION TO N ONLINEAR S OLUTION AND E STIMATION T ECHNIQUES

  8. L OCAL A PPROXIMATION • Interpolate in the k direction: P c ( k ′ , z j ) = P c ( k i , z j ) + ( k ′ − k i ) P c ( k i +1 , z j ) − P c ( k i , z j ) k i +1 − k i k ′ − k i = k i +1 − k ′ P c ( k i , z j ) + P c ( k i +1 , z j ) k i +1 − k i k i +1 − k i � �� � � �� � ω ki ω ki +1 • Then interpolate in the z direction: z ′ − z j P c ( k ′ , z ′ ) = z j +1 − z ′ P c ( k ′ , z j ) + P c ( k ′ , z j +1 ) z j +1 − z j z j +1 − z j � �� � � �� � ω zj ω zj +1 • Combine these two equations: 1 1 � � P c ( k ′ , z ′ ) = ω k i + a ω z j + b P c ( k i + a , z j + b ) a =0 b =0 R ICHTER AND T HROCKMORTON : A N I NTRODUCTION TO N ONLINEAR S OLUTION AND E STIMATION T ECHNIQUES

  9. L OCAL A PPROXIMATION • Use a nested loop or write out all of the terms in the sum to calculate the interpolated value of the policy function: nestedsum = 0; %initialize for a = 0:1 %loop for k for b = 0:1 %loop for z nestedsum = nestedsum + ... wk(1+a)*wz(1+b)*pf.c(kloc+a,zloc+b); end end • Must calculate the interpolated value for each realization of the stochastic variable(s), each of which requires calculating a different set of locations and weights • Number of loops equals the number of exogenous states R ICHTER AND T HROCKMORTON : A N I NTRODUCTION TO N ONLINEAR S OLUTION AND E STIMATION T ECHNIQUES

  10. G LOBAL A PPROXIMATION • A general class of polynomials can be written as: n � P ( x ; η ) = η i ϕ i ( x ) . i =0 • Linear interpolation is a special case of this general class (i.e., n = 1 , ϕ i ( x ) = x i , and α is chosen appropriately) • For n > 1 , ϕ i ( x ) = x i is a collection of monomials and P ( x ; η ) = η 0 + η 1 x + η 2 x 2 + · · · + η p x p • This set of monomials may lead to multicollinearity (i.e., near linear dependence among the monomials) • Bases consisting of orthogonal polynomials fix this problem (e.g., Chebyshev and Hermite Polynomials) R ICHTER AND T HROCKMORTON : A N I NTRODUCTION TO N ONLINEAR S OLUTION AND E STIMATION T ECHNIQUES

  11. E XAMPLE : M ONOMIALS • Consider the complete set of basis functions of order 2: P ( k, z ) = η 0 + η k k + η z z + η kk k 2 + η kz kz + η zz z 2 • Regressor matrix (subscripts denote grid indices):   k 2 z 2 1 k 1 z 1 k 1 z 1 1 1 k 2 z 2 1 k 2 z 2 k 2 z 2   2 2   X = . . . . . .  . . . . . .  . . . . . .   k 2 z 2 1 k N z N k N z N N N • Obtain coefficients using OLS: η = ( X T X ) − 1 X T vec( P c ( k, z )) ˆ P c ( k ′ , z ′ ) = X ′ ˆ η R ICHTER AND T HROCKMORTON : A N I NTRODUCTION TO N ONLINEAR S OLUTION AND E STIMATION T ECHNIQUES

  12. I NTEGRATION : T RAPEZOID R ULE E [Φ( z )] ≈ Pr( ε 1 )Φ( z ( ε 1 )) + Pr( ε 2 )Φ( z ( ε 2 )) ∆ ε 2 + Pr( ε 2 )Φ( z ( ε 2 )) + Pr( ε 3 )Φ( z ( ε 3 )) ∆ ε + · · · 2 + Pr( ε m − 1 )Φ( z ( ε m − 1 )) + Pr( ε m )Φ( z ( ε m )) ∆ ε 2 � � m = ∆ ε � 2 Pr( ε i )Φ( z ( ε i )) − Pr( ε 1 )Φ( z ( ε 1 )) − Pr( ε m )Φ( z ( ε m )) 2 i =1 R ICHTER AND T HROCKMORTON : A N I NTRODUCTION TO N ONLINEAR S OLUTION AND E STIMATION T ECHNIQUES

  13. I NTEGRATION : G AUSS -H ERMITE • Given a shock, ε ∼ N ( µ, σ 2 ) , � ∞ Φ( z ( ε )) e − ( ε − µ ) 2 / (2 σ 2 ) dε E [Φ( z ( ε ))] = (2 πσ 2 ) − 1 / 2 −∞ √ • Apply change of variables, υ = ( ε − µ ) / ( 2 σ ) , � ∞ √ 2 συ + µ )) e − υ 2 dυ E [Φ( z ( υ ))] = π − 1 / 2 Φ( z ( −∞ n √ � ≈ π − 1 / 2 ω i Φ( z ( 2 συ i + µ )) i =1 • ω i and υ i are Gauss-Hermite weights and nodes: ω i = 2 n +1 n ! √ π [ H n +1 ( υ i )] − 2 H n +1 is the physicists’ Hermite polynomial of order n + 1 . R ICHTER AND T HROCKMORTON : A N I NTRODUCTION TO N ONLINEAR S OLUTION AND E STIMATION T ECHNIQUES

  14. E XAMPLE : T IME I TERATION On iteration q , solve for the P q c ( k, z ) that satisfies equilibrium 1. Use log-linear solution on each node to obtain P 0 c ◮ Local: P 1 c = P 0 c η 0 = ( X T X ) − 1 X T vec( P 0 ◮ Global: ˆ c ) so P 1 η 0 c = X ˆ 2. Solve for k ′ and z ′ , given ε ′ 3. Find P q c ( k ′ , z ′ ) given the updated state ◮ Local: use piecewise linear interpolation ◮ Global: update the basis so P q η q − 1 c ( k ′ , z ′ ) = X ′ ˆ 4. Evaluate expectations (Trapezoid rule or Gauss Hermite) c ( k ′ , z ′ ) − σ ( αz ′ k ′ α − 1 + 1 − δ )] E [Φ( z ′ )] = βE [ P q R ICHTER AND T HROCKMORTON : A N I NTRODUCTION TO N ONLINEAR S OLUTION AND E STIMATION T ECHNIQUES

  15. E XAMPLE : T IME I TERATION 5. Use nonlinear solver to find a P q c ( k, z ) that satisfies the c ( k, z ) − σ = E [Φ( z ′ )] . consumption Euler equation, P q 6. Update policy function ◮ Local: P q +1 = P q c c η q = ( X T X ) − 1 X T vec( P q c ( k, z )) , P q +1 ◮ Global: ˆ η q ( k, z ) = X ˆ c 7. Calculate distance between updates ◮ Local: dist = P q c ( k, z ) − P q − 1 ( k, z ) c ◮ Global: dist = ˆ η q − ˆ η q − 1 8. If | dist | < tol , then stop. If not, then set q = q + 1 and repeat steps 2-7 using P q +1 as the new initial conjecture. c Advantage: Satisfies the equilibrium system on each node and nodes can be run in parallel. Disadvantage: Nonlinear solver must execute on each node. R ICHTER AND T HROCKMORTON : A N I NTRODUCTION TO N ONLINEAR S OLUTION AND E STIMATION T ECHNIQUES

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend