is linearized model still needs initial values in dynare?

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.

is linearized model still needs initial values in dynare?

Postby blackeif » Sat Aug 07, 2010 1:57 pm

i write the dynare code as follows, however the matlab runs with the following message, it seems there are some mistakes in the initial values, but as i know, if the model is linearized,the initial values would all be zero, could somebody help me to solve this problem?
Configuring Dynare ...
[mex] Generalized QZ.
[mex] Sylvester equation solution.
[mex] Kronecker products.
[mex] Sparse kronecker products.
[mex] Bytecode evaluation.
[mex] k-order perturbation solver.
[mex] k-order solution simulation.

Starting Dynare (version 4.1.2).
Starting preprocessing of the model file ...
Found 24 equation(s).
Evaluating expressions...done
Computing static model derivatives:
- order 1
Computing dynamic model derivatives:
- order 1
- order 2
Processing outputs ...done
Preprocessing completed.
Starting MATLAB/Octave computing.

STEADY: numerical initial values incompatible with the following equations
17

??? Error using ==> dynare_solve
exiting ...

Error in ==> steady_ at 124
[oo_.steady_state,check] = dynare_solve([M_.fname '_static'],...

Error in ==> steady at 52
steady_;

Error in ==> BGGNPC4 at 233
steady;

Error in ==> dynare at 132
evalin('base',fname) ;

>> solve algo = 1
??? Error using ==> solve
' = ' is not a valid expression or equation.

the dynare code is:

var
Y yu C cu I iu G gu NX nxu K ku N nu Rn Rk S MC Q Z pai H epsl v;
varexo el ez eg em enx;
parameters beta theta delta alpha ingta psai cc dd zz kn cy iy gy nxy phai ingtak gamma rhor akin1 akin2 rhol rhoz rhog rhom rhonx;
beta = 0.984;
theta = 0.01;
delta = 0.025;
alpha = 0.20;
ingta = 0.9728;
psai = 0.02;
cc=0.0514;
kn = 1.5;
cy = 0.42;
iy = 0.40;
gy = 0.14;
nxy = 0.04;
dd = (1-phai)*(1-beta*phai)/phai;
zz = 1.004;
phai = 0.5884;
ingtak = 0.1626;
gamma = 0.8183;
rhor = 0.5986;
akin1 = 0.5795;
akin2 = 2.3844;
rhol = 0.8977;
rhoz = 0.7674;
rhog = 0.8875;
rhom = 0.8123;
rhonx = 0.2214;

model(linear);
Y-Y(-1)-Z-yu+yu(-1) = 0;
C-C(-1)-Z-cu+cu(-1) = 0;
I-I(-1)-Z-iu+iu(-1) = 0;
G-G(-1)-Z-gu+gu(-1) = 0;
NX-NX(-1)-Z-nxu+nxu(-1) = 0;
K-K(-1)-Z-ku+ku(-1) = 0;
N-N(-1)-Z-nu+nu(-1) = 0;
cu+Z+pai-Rn-cu(-1) = 0;
cc*(yu-ku+Z+MC)+(1-cc)*Q-Q(-1)-Rk = 0;
Rk-Rn+pai-S(-1) = 0;
phai*(Q(-1)+ku-nu)-S(-1) = 0;
ingtak*(iu-ku+Z)-Q = 0;
kn*Rk-(kn-1)*(S(-1)+Rn-pai)+nu-Z-nu(+1) = 0;
cy*cu+iy*iu+gy*gu+nxy*nxu-yu = 0;
alpha*H+(1-alpha)*ku-(1-alpha)*Z-yu = 0;
yu+MC-cu-(1+gamma)*H-epsl = 0;
pai(-1)-dd*MC(-1)-beta*pai = 0;
ku-(1-delta)*(ku(-1)-Z(-1))/zz-(1-(1-delta)/zz)*iu(-1) = 0;
Rn-rhor*Rn(-1)-(1-rhor)*(akin1*pai(-1)+akin2*Y(-1))-v = 0;
epsl-rhol*epsl(-1)-el = 0;
Z-rhoz*Z(-1)-ez = 0;
G-rhog*G(-1)-eg = 0;
NX-rhonx*NX(-1)-enx = 0;
v-rhom*v(-1)-em = 0;
end;
steady;
check;
shocks;
var el; stderr 0.01;
var eg; stderr 0.01;
var em; stderr 0.01;
var enx; stderr 0.01;
var ez; stderr 0.01;
end;
stoch_simul(periods=2000) Y, C,I,G,NX,K,N,Rn,Rk,Q,pai,H;
Attachments
BGGNPC4.mod
(1.57 KiB) Downloaded 186 times
blackeif
 
Posts: 31
Joined: Mon Apr 27, 2009 5:19 pm

Re: is linearized model still needs initial values in dynare?

Postby jpfeifer » Sun Aug 08, 2010 8:29 am

In the parameter definitions, you use

Code: Select all
dd = (1-phai)*(1-beta*phai)/phai;


but only definie phai later. So it is 0 when computing dd. Hence, dd is NaN, giving you trouble. Reverse the order and it should run.
------------
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: is linearized model still needs initial values in dynare?

Postby blackeif » Sun Aug 08, 2010 2:32 pm

thank you very much,i have found the reason and the problem is solved,but the model can not satisfy the Blanchard Kahn conditions,so if the linearized model is correct,is it right for me to only adjust the parameters to satisfy the KB? or in another word, the current parameter calibration is nor siutable? the dynare code and the machine's running message are as follows.

Configuring Dynare ...
[mex] Generalized QZ.
[mex] Sylvester equation solution.
[mex] Kronecker products.
[mex] Sparse kronecker products.
[mex] Bytecode evaluation.
[mex] k-order perturbation solver.
[mex] k-order solution simulation.

Starting Dynare (version 4.1.2).
Starting preprocessing of the model file ...
Found 24 equation(s).
Evaluating expressions...done
Computing static model derivatives:
- order 1
Computing dynamic model derivatives:
- order 1
- order 2
Processing outputs ...done
Preprocessing completed.
Starting MATLAB/Octave computing.


STEADY-STATE RESULTS:

Y 0
yu 0
C 0
cu 0
I 0
iu 0
G 0
gu 0
NX 0
nxu 0
K 0
ku 0
N 0
nu 0
Rn 0
Rk 0
S 0
MC 0
Q 0
Z 0
pai 0
H 0
epsl 0
v 0

EIGENVALUES:
Modulus Real Imaginary

0 0 0
1.033e-016 1.033e-016 0
1.525e-016 -1.525e-016 0
3.832e-016 3.832e-016 0
0.05757 0.05757 0
0.2214 0.2214 0
0.7674 0.7674 0
0.8507 0.8447 0.1012
0.8507 0.8447 -0.1012
0.8875 0.8875 0
0.8977 0.8977 0
0.9203 0.9203 0
1 1 0
1 1 0
1 1 0
1 1 0
1 1 0
1 1 0
1 1 0
1.248 1.248 0
2.082 2.082 0
2.909 -2.909 0
Inf Inf 0


There are 4 eigenvalue(s) larger than 1 in modulus
for 1 forward-looking variable(s)

The rank conditions ISN'T verified!

??? Error using ==> print_info
Blanchard Kahn conditions are not satisfied: no stable equilibrium

Error in ==> stoch_simul at 46
print_info(info, options_.noprint);

Error in ==> BGGNPC4 at 260
info = stoch_simul(var_list_);

Error in ==> dynare at 132
evalin('base',fname) ;

-----------------------------------the dynare code is:

var
Y yu C cu I iu G gu NX nxu K ku N nu Rn Rk S MC Q Z pai H epsl v;
varexo el ez eg em enx;
parameters beta theta delta alpha ingta psai cc dd zz kn cy iy gy nxy phai ingtak gamma rhor akin1 akin2 rhol rhoz rhog rhom rhonx;
beta = 0.984;
theta = 0.01;
delta = 0.025;
alpha = 0.20;
ingta = 0.9728;
psai = 0.02;
cc=0.0514;
kn = 1.5;
cy = 0.42;
iy = 0.40;
gy = 0.14;
nxy = 0.04;
dd = 0.2984;
zz = 1.004;
phai = 0.5884;
ingtak = 0.1626;
gamma = 0.8183;
rhor = 0.5986;
akin1 = 0.5795;
akin2 = 2.3844;
rhol = 0.8977;
rhoz = 0.7674;
rhog = 0.8875;
rhom = 0.8123;
rhonx = 0.2214;

model(linear);
Y-Y(-1)-Z-yu+yu(-1) = 0;
C-C(-1)-Z-cu+cu(-1) = 0;
I-I(-1)-Z-iu+iu(-1) = 0;
G-G(-1)-Z-gu+gu(-1) = 0;
NX-NX(-1)-Z-nxu+nxu(-1) = 0;
K-K(-1)-Z-ku+ku(-1) = 0;
N-N(-1)-Z-nu+nu(-1) = 0;
cu+Z+pai-Rn-cu(-1) = 0;
cc*(yu-ku+Z+MC)+(1-cc)*Q-Q(-1)-Rk = 0;
Rk-Rn+pai-S(-1) = 0;
phai*(Q(-1)+ku-nu)-S(-1) = 0;
ingtak*(iu-ku+Z)-Q = 0;
kn*Rk-(kn-1)*(S(-1)+Rn-pai)+nu-Z-nu(+1) = 0;
cy*cu+iy*iu+gy*gu+nxy*nxu-yu = 0;
alpha*H+(1-alpha)*ku-(1-alpha)*Z-yu = 0;
yu+MC-cu-(1+gamma)*H-epsl = 0;
pai(-1)-dd*MC(-1)-beta*pai = 0;
ku-(1-delta)*(ku(-1)-Z(-1))/zz-(1-(1-delta)/zz)*iu(-1) = 0;
Rn-rhor*Rn(-1)-(1-rhor)*(akin1*pai(-1)+akin2*Y(-1))-v = 0;
epsl-rhol*epsl(-1)-el = 0;
Z-rhoz*Z(-1)-ez = 0;
G-rhog*G(-1)-eg = 0;
NX-rhonx*NX(-1)-enx = 0;
v-rhom*v(-1)-em = 0;
end;
steady;
check;
shocks;
var el; stderr 0.01;
var eg; stderr 0.01;
var em; stderr 0.01;
var enx; stderr 0.01;
var ez; stderr 0.01;
end;
stoch_simul(periods=2000) Y, C,I,G,NX,K,N,Rn,Rk,Q,pai,H;
Attachments
BGGNPC4.mod
(1.55 KiB) Downloaded 91 times
blackeif
 
Posts: 31
Joined: Mon Apr 27, 2009 5:19 pm

Re: is linearized model still needs initial values in dynare?

Postby jpfeifer » Sun Aug 08, 2010 5:29 pm

In principle, you are correct. If the model is right, all you need to do, is change the parameters. However, considering that you need three eigenvalues more with modulus less than 1, it is rather likely that it is not only parameter values. Have you checked that the timing of your predetermined variables like capital conforms to the Dynare convention?
------------
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 9 guests