views:

134

answers:

1

Perhaps this is more of a math question than a MATLAB one, not really sure. I'm using MATLAB to compute an economic model - the New Hybrid ISLM model - and there's a confusing step where the author switches the sign of the solution.

First, the author declares symbolic variables and sets up a system of difference equations. Note that the suffixes "a" and "2t" both mean "time t+1", "2a" means "time t+2" and "t" means "time t":

   %% --------------------------[2] MODEL proc-----------------------------%%    
   % Define endogenous vars  ('a' denotes t+1 values)  
       syms  y2a  pi2a  ya  pia  va  y2t pi2t yt pit vt  ;   
   % Monetary policy rule  
      ia = q1*ya+q2*pia;   
   %  ia = q1*(ya-yt)+q2*pia;  %%option speed limit policy   
   % Model equations  
       IS   = rho*y2a+(1-rho)*yt-sigma*(ia-pi2a)-ya;   
       AS   = beta*pi2a+(1-beta)*pit+alpha*ya-pia+va;  
       dum1 = ya-y2t;  
       dum2 = pia-pi2t;  
       MPs  = phi*vt-va;          

       optcon  = [IS ; AS ; dum1 ; dum2; MPs];  

Edit: The equations that are going into the matrix, as they would appear in a textbook are as follows (curly braces indicate time period values, greek letters are parameters):

First equation:

y{t+1} = rho*y{t+2} + (1-rho)*y{t} - sigma*(i{t+1}-pi{t+2})

Second equation:

pi{t+1} = beta*pi{t+2} + (1-beta)*pi{t} + alpha*y{t+1} + v{t+1}

Third and fourth are dummies:

y{t+1} = y{t+1}
pi{t+1} = pi{t+1}

Fifth is simple:

v{t+1} = phi*v{t}

Moving on, the author computes the matrix A:

    %% ------------------  [3] Linearization proc  ------------------------%%       
  % Differentiation   
     xx = [y2a  pi2a  ya  pia  va  y2t pi2t yt pit vt] ; % define vars  
     jopt = jacobian(optcon,xx);  

   % Define Linear Coefficients    
     coef = eval(jopt);  

    B =  [ -coef(:,1:5)  ] ;  
    C =  [  coef(:,6:10)  ] ;  
 % B[c(t+1)  l(t+1)  k(t+1)  z(t+1)] = C[c(t)  l(t)  k(t)  z(t)]  
    A = inv(C)*B ; %(Linearized reduced form ) 

As far as I understand, this A is the solution to the system. It's the matrix that turns time t+1 and t+2 variables into t and t+1 variables (it's a forward-looking model). My question is essentially why is it necessary to reverse the signs of all the partial derivatives in B in order to get this solution? I'm talking about this step:

B =  [ -coef(:,1:5)  ] ;

Reversing the sign here obviously reverses the sign of every component of A, but I don't have a clear understanding of why it's necessary. My apologies if the question is unclear or if this isn't the best place to ask.

+1  A: 

I think the key is that the model is forward-looking, so the slopes (the partial derivatives) need to be reversed to go backward in time. One way to think of it is to say that the jacobian() function always calculates derivatives in the forward-time direction.

You've got an output vector of states called optcon = [IS;AS;dum1;dum2;MPs], and two vectors of input states [y2 pi2 y pi v]. The input vector at time t+1 is [y2a pi2a ya pia va], and the input vector at time t is [y2t pi2t yt pit vt]. These two are concatenated into a single vector for the call to jacobian(), then separated after. The same thing could have been done in two calls. The first 5 columns of the output of jacobian() are the partial derivatives of optcon with respect to the input vector at time t+1, and the second 5 columns are with respect to the input vector at time t.

In order to get the reduced form, you need to come up with two equations for optcon at time t+1. The second half of coef is just what is needed. But the first half of coef is the equation for optcon at time t+2. The trick is to reverse the signs of the partial derivatives to get linearized coefficients that take the input vector at t+1 to the output optcon at t+1.

CraigChapman
It took me a long time to wrap my head around this, but you're right. Thanks a lot for the help.
jefflovejapan

related questions