RBC Model Dynare

So I understand the code I need to use and whatnot but I think I’m unsure if I have missed something out:

In Dynare do I need a data set or anything? Im just kinda confused with what I need to do before I start coding because if I just enter the code below it will just say ‘error’ relating to var in line 1.

% Declare the endogenous variables
var c n w r k y a i;

% Declare the exogenous variables
varexo epsilon;

% Declare the parameters
parameters beta sigma rho alpha psi delta rBar cBar_yBar iBar_yBar;
beta = 0.95;
sigma = 2.0;
rho = 0.90;
alpha = 0.33;
psi = 0.50;
delta = 0.10;
rBar = 0.15;
cBar_yBar = 0.70;
iBar_yBar = 0.30;

% Declare the model
model(linear);
sigma*c + psi*n = w;
c = c(+1) - rBar/(sigma*(1-delta+rBar))*r(+1);
y = cBar_yBar*c + iBar_yBar*i;
r = a + (alpha-1)*k(-1) + (1-alpha)*n;
w = a + alpha*k(-1) - alpha*n;
k = (1-delta)*k(-1) + delta*i;
y = a + alpha*k(-1) + (1-alpha)*n;
a = rho*a(-1) + epsilon; 
end;

% Declare the initial values: set to steady state (zero deviations)
initval;
c = 0;
y = 0;
i = 0;
r = 0;
w = 0;
a = 0;
k = 0;
end;

% Declare the values you want the shocks to take
shocks;
var epsilon = 0.01^2;
end;

% Shock the model
stoch_simul;

Hi Samurai101,

You can not run a mod file line by line in Matlab. You need to call it in the command window. Also, you don’t need a data set to run the code you posted.

Check this basic video by professor Juillard for a gentle introduction on how to run your code: Introduction to Dynare and local approximation: 6. Example: A simple RBC model (4/4) - YouTube

1 Like