ABCs

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.

ABCs

Postby rafo » Fri Sep 03, 2010 8:38 am

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+((e*B)/P)+K+(kapa/2)*(K-K(-1))^2=w*H+r*K(-1)+(1-delta)*K(-1)+((e*(1+r_f(-1))*B(-1))/P);
w=(1-theta)*A*((K(-1))^theta)*(H^(-theta));
r=theta*A*((K(-1))^(theta-1))*(H^(1-theta));
B=(1+r_f(-1))*B(-1)+P_f*X;
r_f=r_poc-a*(B/P_f);
e=P/P_f;
M=g*M(-1);
A=rho1*A(-1)+epsilon1;
P_f=1-rho2+rho2*(P_f(-1))+epsilon2;
g=rho3*(g(-1))+epsilon3;


end;
resid(i);
steady;
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
[oo_.steady_state,check] =
dynare_solve([M_.fname
'_static'],...

Error in ==> steady at 52
steady_;

Error in ==> open_nista at 151
steady;

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.
rafo
 
Posts: 4
Joined: Thu Jun 03, 2010 5:35 pm

Re: ABCs

Postby jpfeifer » Fri Sep 03, 2010 11:28 am

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

Postby rafo » Sat Sep 04, 2010 3:04 pm

Thank you for your answer.
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
STEADY: convergence problems

Error in ==> steady at 52
steady_;

Error in ==> open_beze at 141
steady;

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

somebody tired it?somebody could help me?

best,

Rafo
Attachments
open_beze.mod
(780 Bytes) Downloaded 116 times
rafo
 
Posts: 4
Joined: Thu Jun 03, 2010 5:35 pm

Re: ABCs

Postby jpfeifer » Sun Sep 05, 2010 7:16 am

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

before the steady command to see the residuals of the equations with your starting values. Some of them are far off.
------------
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: ABCs

Postby rafo » Mon Sep 06, 2010 8:30 am

Thank you for your help.
rafo
 
Posts: 4
Joined: Thu Jun 03, 2010 5:35 pm

Re: ABCs

Postby rafo » Mon Sep 06, 2010 8:34 am

But I have one more question about the interpretation of the output(momments, corelations, autocorrelations). Are this results given in levels or in the log-defference of the steady state or something else?

Best,

Rafael
rafo
 
Posts: 4
Joined: Thu Jun 03, 2010 5:35 pm

Re: ABCs

Postby StephaneAdjemian » Fri Sep 10, 2010 9:16 am

Hi, first order moments are in levels and second order moments are in deviations to the mean (by definition of the covariance function) which with a first order approximation is the deterministic steady state of the model.

Best, Stéphane.
Stéphane Adjemian
Université du Maine, GAINS and DynareTeam
https://stepan.adjemian.eu
StephaneAdjemian
 
Posts: 429
Joined: Wed Jan 05, 2005 4:24 pm
Location: Paris, France.


Return to Dynare help

Who is online

Users browsing this forum: Google [Bot] and 8 guests