# ABCs

Hi,

I need some help about the model from McCandless ABCs of RBCs open economy model with money. Somebody tried it before who can help me? My mod file is here:

var Y H A K e P C r r_f M B X P_f w g;
varexo epsilon1 epsilon2 epsilon3;

parameters theta delta beta kapa r_poc rho1 rho2 rho3 sigma a;
theta=0.36;
delta=0.15;
beta=0.99;
kapa=4;
r_poc=0.03;
rho1=0.9;
rho2=0.9;
rho3=0.8;
sigma = 0.01;
a=0.01;

model;
%C+K-(1-delta)K(-1)+X=Y;
Y=A
(K(-1)^theta)H^(1-theta);
e/(P(+1)C(+1))=beta((e(+1)
(1+r_f))/(P(+2)C(+2)));
(P/(P(+1)C(+1)))(1+kapa
(K-K(-1)))=beta*((P(+1))/(P(+2)C(+2)))(r(+1)+(1-delta)+kapa*(K(+1)-K));
B/w+beta*(P/(P(+1)C(+1)))=0;
P
C=M;
M/P+((eB)/P)+K+(kapa/2)(K-K(-1))^2=wH+rK(-1)+(1-delta)K(-1)+((e(1+r_f(-1))B(-1))/P);
w=(1-theta)A((K(-1))^theta)
(H^(-theta));
r=thetaA((K(-1))^(theta-1))(H^(1-theta));
B=(1+r_f(-1))B(-1)+P_fX;
r_f=r_poc-a
(B/P_f);
e=P/P_f;
M=gM(-1);
A=rho1
A(-1)+epsilon1;
P_f=1-rho2+rho2*(P_f(-1))+epsilon2;
g=rho3*(g(-1))+epsilon3;

end;
resid(i);
check;

shocks;
var epsilon1; stderr 0.01;
var epsilon2; stderr 0.01;
var epsilon3; stderr 0.01;
end;

stoch_simul;

And I tried to get some results, with different initial values, but every time I got the folowing message:

Starting Dynare (version 4.1.2).
Starting preprocessing of the model file …
Substitution of endo leads >= 2: added 2 auxiliary variables and equations.
Found 17 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.

Warning: Divide by zero. This
warning will be removed in a future
release.
Consider using DBSTOP IF
NANINF when debugging.

In open_nista_static at 21
In resid at 62
In open_nista at 150
In dynare at 132
Warning: Divide by zero. This
warning will be removed in a future
release.
Consider using DBSTOP IF
NANINF when debugging.
In open_nista_static at 24
In resid at 62
In open_nista at 150
In dynare at 132
Warning: Divide by zero. This
warning will be removed in a future
release.

STEADY: numerical initial values incompatible with the following equations
Columns 1 through 5

`````` 2     3     4     6     7
``````

Columns 6 through 10

`````` 8    10    11    16    17
``````

??? Error using ==> dynare_solve at
82
exiting …

Error in ==> steady_ at 124
dynare_solve([M_.fname
’_static’],…

Error in ==> steady at 52

Error in ==> open_nista at 151

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

So i think that that there is something wrong with my model but I don’t know what because I wrote down the equation from the book. Maybe the initial values or somethink else?
Maybe somebody could help me?

Than you.

Your problem is that you did not specify intial values for the steady state in the initval statement. Hence, Dynare takes them as 0. The right hand side of equation 2 for example e/(P(+1)*C(+1)) is then 0/0. This division by 0 gives you the error message

[quote]STEADY: numerical initial values incompatible with the following equations
Columns 1 through 5

2 3 4 6 7

Columns 6 through 10

8 10 11 16 17
[/quote]

But when I try for example the attached .mod file (from the same book, just the more trivial example for the open economy) with the initial values from the book, MATLAB gives the folowing mesage:

??? Error using ==> steady_ at 132

Error in ==> steady at 52

Error in ==> open_beze at 141

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

somebody tired it?somebody could help me?

best,

Rafo
open_beze.mod (780 Bytes)

Your process for A is wrong as its steady state is 0. You should enter it as `log(A(+1))=rho*log(A)+eps;` to make it mean 1. Also, put

before the steady command to see the residuals of the equations with your starting values. Some of them are far off.