Page 1 of 1

help Blanchard Kahn conditions are not satisfied

PostPosted: Tue Nov 20, 2007 3:24 am
by xgc5
I don't know what's wrong with the code. Blanchard Kahn conditions are not satisfied.

The following is dynare code about international real business cycle modle. Who can help me check it? Thank you very much!

periods 20100;

var U1,c1,y1,n1,k1,G1,a1,b1,x1,r1,w1,qa1,qb1,z1
U2,c2,y2,n2,k2,G2,a2,b2,x2,r2,w2,qa2,qb2,z2;

varexo e1,e2;

parameters mu,gama,omega,sigma,theta,delta,A11,A12,A21,A22,beta;

beta=0.99;
mu=0.34;
gama=-1;
theta=0.36;
delta=0.025;
sigma=0.9;
A11=0.97;
A12=0.025;
A21=0.025;
A22=0.97;
omega=0.8730;

model;

U1=( exp(c1)^mu*( 1-exp(n1) )^( 1-mu ) )^gama/gama;

exp(y1)=exp( z1 )*exp(k1)^theta*exp(n1)^( 1-theta );

exp(G1)=( omega*exp(a1)^( ( sigma-1 )/sigma )+( 1-omega )*exp(b1)^( ( sigma-1 )/sigma ) )^( sigma/( sigma-1 ) );

U2=( exp(c2)^mu*( 1-exp(n2) )^( 1-mu ) )^gama/gama;

exp(y2)=exp( z2 )*exp(k2)^theta*exp(n2)^( 1-theta );

exp(G2)=((1- omega)*exp(a2)^( ( sigma-1 )/sigma )+omega*exp(b2)^( ( sigma-1 )/sigma ) )^( sigma/( sigma-1 ) );


//Euler Equation

U1/exp(c1)=beta*( U1( +1 )/exp(c1( +1 )) )*( 1-delta+exp(qa1( +1 ))*exp(r1( +1 )) );

U2/exp(c2)=beta*( U2( +1 )/exp(c2( +1 )) )*( 1-delta+exp(qb2( +1 ))*exp(r2( +1 )) );

//Marginal substitution of consumption and leisure

( 1-mu )*gama*( U1/( 1-exp(n1) ) )=mu*gama*( U1/exp(c1) )*exp(w1)*exp(qa1);

( 1-mu )*gama*( U2/( 1-exp(n2) ) )=mu*gama*( U2/exp(c2) )*exp(w2)*exp(qb2);

//Production side

exp(r1)=theta*exp(y1)/exp(k1);

exp(r2)=theta*exp(y2)/exp(k2);

exp(w1)=( 1-theta )*exp(y1)/exp(n1);

exp(w2)=( 1-theta )*exp(y2)/exp(n2);

exp(qa1)=omega*exp(a1)^( -1/sigma )*exp(G1)^( 1/sigma );

exp(qb1)=( 1-omega )*exp(b1)^( -1/sigma )*exp(G1)^( 1/sigma );

exp(qa2)=( 1-omega )*exp(a2)^( -1/sigma )*exp(G2)^( 1/sigma );

exp(qb2)=omega*exp(b2)^( -1/sigma )*exp(G2)^( 1/sigma );

//Market clearing conditions

exp(c1)+exp(x1)=exp(G1);

exp(k1( +1 ))=exp(k1)*( 1-delta )+exp(x1);

exp(c2)+exp(x2)=exp(G2);

exp(k2( +1 ))=exp(k2)*( 1-delta )+exp(x2);

exp(a1)+exp(a2)=exp(y1);

exp(b1)+exp(b2)=exp(y2);

//Exogeneous shocking

z1=A11*z1( -1 )+A12*z2( -1 )+e1;

z2=A21*z1( -1 )+A22*z2( -1 )+e2;

//Risk sharing

( U1/exp(c1) )*exp(qa1)=( U2/exp(c2) )*exp(qa2);

exp(qa1)/exp(qa2)=exp(qb1)/exp(qb2);

end;

initval;
n1= -1.1803 ;
k1=1.8283 ;
qa1=-0.4023;
qb1=-0.4023;
c1=-0.7958;
a1=-0.2597;
b1=-1.9943;
z1=0;
e1=0;
n2=-1.1803;
k2=1.8283;
qa2=-0.4023;
qb2=-0.4023;
c2=-0.7958;
a2=-1.9943;
b2=-0.2579;
z2=0;
e2=0;
U1 = -1.6699;
y1 = -0.0972;
G1 = -0.4995;
U2 = -1.6699;
y2 = -0.0972;
G2 = -0.4995;
r1 = -2.9472;
r2 = -2.9472;
w1 = 0.6368;
w2 = 0.6368;

end;

steady;

check;

shocks;

var e1=0.0073^2;
var e2=0.0044^2;
var e1,e2=0.290*0.0073*0.0044;

end;

stoch_simul(order=1);

PostPosted: Sat Dec 01, 2007 6:13 pm
by MichelJuillard
The stock variables aren't written on an "end of period" basis. Check the User Guide on the timing of the variables. You may have to recompute the optimality conditions using, end of period stocks.

Kind regards

Michel