why the same linear equations generate different rusults?

This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location where you will have to reset your password.
Forum rules
This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location (https://forum.dynare.org) where you will have to reset your password.

why the same linear equations generate different rusults?

Postby jack_ct » Sun Dec 27, 2015 3:54 am

hello, professor Pfeifer

I am replicating the model of Gali(2005) ,i simplified your code Gali_Monacelli_2005.mod,but the same linear equations generate different rusults .
Gali2005_1.mod
Code: Select all
var
pih  x   y   ynat  rnat   r  s  pi   p
ph  e ystar  pistar n  nx  real_wage a  c deprec_rate   ;
varexo
 eps_star   eps_a ;   
parameters
    sigma eta gamma  phi epsilon theta beta  alpha
phi_pi rhoa rhoy rho  omega  sigma_a  Theta lambda kappa_a Gamma Psi;

sigma = 1;
eta = 1 ;
gamma = 1;
phi =3;
epsilon = 6;
theta = 0.75;
beta  = 0.99;
alpha = 0.4;
phi_pi = 1.5;
rhoa = 0.9;                                                               
rhoy = 0.86; 
rho  = beta^(-1)-1;
omega = sigma*gamma+(1-alpha)*(sigma*eta-1);
sigma_a =sigma/((1-alpha)+alpha*omega);
Theta=(sigma*gamma-1)+(1-alpha)*(sigma*eta-1);
lambda = (1-(beta*theta))*(1-theta)/theta;
kappa_a =lambda*(sigma_a+phi);
Gamma = (1+phi)/(sigma_a+phi);
Psi = -Theta*sigma_a/(sigma_a+phi);

model(linear);
//1. Equation (37), IS Curve
x    = x(+1) - sigma_a^(-1)*(r - pih(+1) - rnat) ;       
                       
//2. Equation (36), Philips Curve
pih  = beta * pih(+1)+ kappa_a*x;                                               

//3. Equation below (37)
rnat = -sigma_a*Gamma*(1-rhoa)*a + alpha*sigma_a*(Theta+Psi)*(ystar(+1)-ystar);

//4. Equation (35), definition natural level of output
ynat = Gamma*a + alpha*Psi*ystar;                                                 
//5. Equation above (35), definition output gap
x    = y - ynat;                                                               
//6. Equation (29)
y = ystar + sigma_a^(-1)*s;
//7. Equation (14)
pi   = pih + alpha*(s-s(-1));
//8. Equation 15 (first difference)
s    = s(-1) + e - e(-1) + pistar - pih;
//9. Constant world inflation, see p.724 (Given constant world prices)
pistar = 0;
//10. Equation (22), employment
y = a + n;
//11. Equation (31), net exports
nx = alpha*(omega/sigma-1)*s;
//12. Equation (27), defines consumption
y = c+alpha*omega/sigma*s;
//13. Above equation (11), defines real wage
real_wage = sigma*c+phi*n;
//10-12. Equations on p. 723, stochastic processes
a    = rhoa*a(-1) + eps_a;
ystar= rhoy*ystar(-1) + eps_star;
//definition consumer price level
pi   = p - p(-1);
//definition domestic price level
pih  = ph - ph(-1);
//definition nominal depreciation rate of exchange rate
deprec_rate=e-e(-1);
pih=0;
end;

shocks;
var eps_a = 1;
end;
stoch_simul(order=1,irf=20,irf_plot_threshold=0)pih ;

the result is correct
but when i change the order of equation 3 Gali2005_2.mod
Code: Select all
//1. Equation (37), IS Curve
x    = x(+1) - sigma_a^(-1)*(r - pih(+1) - rnat) ;       
//3. Equation below (37)
rnat = -sigma_a*Gamma*(1-rhoa)*a + alpha*sigma_a*(Theta+Psi)*(ystar(+1)-ystar);
//2. Equation (36), Philips Curve
pih  = beta * pih(+1)+ kappa_a*x;                                               
//4. Equation (35), definition natural level of output
ynat = Gamma*a + alpha*Psi*ystar;                                                 
//5. Equation above (35), definition output gap
x    = y - ynat;                                 

the irf of pih is strange
Code: Select all
oo_.irfs.pih_eps_a'

ans =

   1.0e-32 *

    0.5208
         0
         0
         0
         0
         0
         0
         0
         0
         0
         0
         0
         0
         0
         0
         0
         0
         0
         0
         0

the irf value of pih should be zero and the policy function is :
Code: Select all
                              pih             
s(-1)                                  0               
p(-1)                                 0             
ph(-1)                               0             
e(-1)                                 0               
a(-1)                                 0               
ystar(-1)                            0               
eps_star                             0             
eps_a                                0
Attachments
Gali2005_2.mod
(2.26 KiB) Downloaded 110 times
Gali2005_1.mod
(2.26 KiB) Downloaded 119 times
jack_ct
 
Posts: 4
Joined: Sat Dec 26, 2015 8:26 am

Re: why the same linear equations generate different rusult

Postby jpfeifer » Wed Dec 30, 2015 10:54 am

There is no difference. For all practical purposes the IRF is 0 in both cases. Just look at the scaling of the IRFs. It is 10^-30
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 8 guests