Two-sector DSGE, (One of the eigenvalues is close to 0/0)

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.

Two-sector DSGE, (One of the eigenvalues is close to 0/0)

Postby johnwhb » Tue Apr 01, 2014 5:24 am

Hi my friends, I wonder if anyone can help me see what is wrong with the code. This is a log-linearized two-sector DSGE, where firms use intermediate inputs. I wonder if the problem with the code is due to non-uniqueness of the solution? For theoretical reference, the code is based on http://www.imf.org/external/pubs/ft/wp/2010/wp1082.pdf.
Thanks so much for your help! I have been stuck on this for so long...
johnwhb
 
Posts: 4
Joined: Tue Apr 01, 2014 5:15 am

Re: Two-sector DSGE, (One of the eigenvalues is close to 0/0

Postby johnwhb » Tue Apr 01, 2014 5:25 am

Code: Select all
var c_1 c_2 c l_1 l_2 l p_1 p_2 p w m_11 m_12 m_21 m_22 y_1 y_2 a_1 a_2 nu;
varexo eps_a eps_nu;
parameters beta sigma varphi delta theta rho_a rho_nu eta_1 eta_2
omega_1 omega_2 kappa_1 kappa_2;

beta = 0.996;
sigma = 1;
varphi = 2;
delta = 0.3;
theta = 6;
rho_a = 0.9;
rho_nu = 0.5;
eta_1 = 0.5;
eta_2 = 0.5;
omega_1 = 0.85;
omega_2 = 0.85;
kappa_1 = (1-omega_1*beta)*(1-omega_1)/omega_1;
kappa_2 = (1-omega_2*beta)*(1-omega_2)/omega_2;



model(linear);
w - p = varphi*l + c;
y_1 = delta*(a_1 + l_1) + (1-delta)*(eta_1*m_11 + eta_2*m_12);
y_2 = delta*(a_2 + l_2) + (1-delta)*(eta_1*m_21 + eta_2*m_22);
p_1-p_1(-1) = beta*(p_1(+1)-p_1) + kappa_1*(delta*(w-a_1)+(1-delta)*(eta_1*p_1
+eta_2*p_2) - p_1);
p_2-p_2(-1) = beta*(p_2(+1)-p_2) + kappa_2*(delta*(w-a_2)+(1-delta)*(eta_1*p_1
+eta_2*p_2) - p_2);
y_1 = (1-0.583)*c_1 + (0.583)*(m_11 + m_21);
y_2 = (1-0.583)*c_2 + (0.583)*(m_12 + m_22);
l = 0.5*l_1 + 0.5*l_2;
p = 0.5*p_1 + 0.5*p_2;
c_1 = -(p_1-p) + c;
c_2 = -(p_2-p) + c;
m_11 = -(p_1 - (eta_1*p_1+eta_2*p_2)) +  (eta_1*m_11 + eta_2*m_12);
m_12 = -(p_2 - (eta_1*p_1+eta_2*p_2)) +  (eta_1*m_11 + eta_2*m_12);
m_21 = -(p_1 - (eta_1*p_1+eta_2*p_2)) +  (eta_1*m_21 + eta_2*m_22);
m_22 = -(p_2 - (eta_1*p_1+eta_2*p_2)) +  (eta_1*m_21 + eta_2*m_22);
p + c = p(-1) + c(-1) + nu;
a_1 = rho_a*a_1(-1) + eps_a;
a_2 = rho_a*a_2(-1) + eps_a;
nu = rho_nu*nu(-1) + eps_nu;
end;

steady;
check;


shocks;
var eps_a = 0.01;
var eps_nu = 0.004;   

end;

stoch_simul(order=1,irf=20);
johnwhb
 
Posts: 4
Joined: Tue Apr 01, 2014 5:15 am

Re: Two-sector DSGE, (One of the eigenvalues is close to 0/0

Postby jpfeifer » Tue Apr 01, 2014 12:42 pm

Run model_diagnostics:
MODEL_DIAGNOSTICS: The Jacobian of the static model is singular
MODEL_DIAGNOSTICS: there is 3 colinear relationships between the variables and the equations
Relation 1
Colinear variables:
c_1
c_2
c
l_1
l_2
l
p_1
p_2
p
w
m_11
m_12
m_21
m_22
y_1
y_2
Relation 2
Colinear variables:
c_1
c_2
c
l_1
l_2
l
p_1
p_2
p
w
m_11
m_12
m_21
m_22
y_1
y_2
Relation 3
Colinear variables:
c_1
c_2
c
l_1
l_2
l
p_1
p_2
p
w
m_11
m_12
m_21
m_22
y_1
y_2
Relation 1
Colinear equations
12 13 14 15

Relation 2
Colinear equations
12 13 14 15

Relation 3
Colinear equations
16 19

MODEL_DIAGNOSTICS: The presence of a singularity problem typically indicates that there is one
MODEL_DIAGNOSTICS: redundant equation entered in the model block, while another non-redundant equation
MODEL_DIAGNOSTICS: is missing. The problem often derives from Walras Law.
------------
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

Re: Two-sector DSGE, (One of the eigenvalues is close to 0/0

Postby johnwhb » Tue Apr 01, 2014 2:37 pm

Thanks so much jpfeifer! I get to run the code now. May i ask how i can put several IRF together in one graph?
johnwhb
 
Posts: 4
Joined: Tue Apr 01, 2014 5:15 am

Re: Two-sector DSGE, (One of the eigenvalues is close to 0/0

Postby jpfeifer » Tue Apr 01, 2014 2:54 pm

------------
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

Re: Two-sector DSGE, (One of the eigenvalues is close to 0/0

Postby johnwhb » Tue Apr 01, 2014 8:54 pm

Hi jpfeifer,

Sorry to bother you again, I made some changes to the code and run into the same problem again, could you help me see if it is an issue with collinearity again?Thanks very much
Code: Select all
var c_1 c_2 c l_1 l_2 l p_1 p_2 p w m_11 m_12 m_21 m_22 y_1 y_2 a_1 a_2 nu;
varexo eps_a1 eps_a2 eps_nu;
parameters beta sigma varphi delta theta rho_a rho_nu eta_1 eta_2
omega_1 omega_2 kappa_1 kappa_2;

beta = 0.996;
sigma = 1;
varphi = 2;
delta = 0.3;
theta = 6;
rho_a = 0.9;
rho_nu = 0.5;
eta_1 = 0.5;
eta_2 = 0.5;
omega_1 = 0.85;
omega_2 = 0.85;
kappa_1 = (1-omega_1*beta)*(1-omega_1)/omega_1;
kappa_2 = (1-omega_2*beta)*(1-omega_2)/omega_2;



model(linear);
w - p = varphi*l + c;
y_1 = delta*(a_1 + l_1) + (1-delta)*(eta_1*m_11 + eta_2*m_12);
y_2 = delta*(a_2 + l_2) + (1-delta)*(eta_1*m_21 + eta_2*m_22);
p_1-p_1(-1) = beta*(p_1(+1)-p_1) + kappa_1*(delta*(w-a_1)+
(1-delta)*((1/delta)*(y_1-eta_1*m_11-eta_2*m_12)-w-2*a_1) - p_1);
p_2-p_2(-1) = beta*(p_2(+1)-p_2) + kappa_2*(delta*(w-a_2)+
(1-delta)*((1/delta)*(y_2-eta_1*m_21-eta_2*m_22)-w-2*a_2) - p_2);
y_1 = (1 - (1-delta)*(theta-1)/theta)*c_1 + ((1-delta)*(theta-1)/theta)*(m_11 + m_21);
y_2 = (1 - (1-delta)*(theta-1)/theta)*c_2 + ((1-delta)*(theta-1)/theta)*(m_12 + m_22);
l = 0.5*l_1 + 0.5*l_2;
p = 0.5*p_1 + 0.5*p_2;
c_1 = -(p_1-p) + c;
c_2 = -(p_2-p) + c;
m_11 = -(p_1 - ((1/delta)*(y_1-eta_1*m_11-eta_2*m_12)-w-2*a_1)) +  (eta_1*m_11 + eta_2*m_12);
m_12 = -(p_2 - ((1/delta)*(y_2-eta_1*m_21-eta_2*m_22)-w-2*a_2)) +  (eta_1*m_11 + eta_2*m_12);
m_21 = -(p_1 - ((1/delta)*(y_1-eta_1*m_11-eta_2*m_12)-w-2*a_1)) +  (eta_1*m_21 + eta_2*m_22);
m_22 = -(p_2 - ((1/delta)*(y_2-eta_1*m_21-eta_2*m_22)-w-2*a_2)) +  (eta_1*m_21 + eta_2*m_22);
p + c = p(-1) + c(-1) + nu;
a_1 = rho_a*a_1(-1) + eps_a1;
a_2 = a_2(-1) + eps_a2;
nu = rho_nu*nu(-1) + eps_nu;
end;

steady;
check;


shocks;
var eps_a1 = 0;
var eps_a2 = 0;
var eps_nu = 0.004;   

end;

stoch_simul;
johnwhb
 
Posts: 4
Joined: Tue Apr 01, 2014 5:15 am

Re: Two-sector DSGE, (One of the eigenvalues is close to 0/0

Postby jpfeifer » Wed Apr 02, 2014 8:09 am

Just use Dynare 4.4.2 and type
Code: Select all
model_diagnostics(M_,options_,oo_)

after your model crashed.
------------
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: Google [Bot] and 3 guests