rbc_basic.mod 924 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
// Endogenous variables: consumption and capital
var c k;

// Exogenous variable: technology level
varexo A;

// Parameters declaration and calibration
parameters alpha beta gamma delta;

alpha=0.5;
beta=0.95;
gamma=0.5;
delta=0.02;

// Equilibrium conditions
model;
c + k = A*k(-1)^alpha + (1-delta)*k(-1); // Resource constraint
c^(-gamma) = beta*c(+1)^(-gamma)*(alpha*A(+1)*k^(alpha-1) + 1 - delta); // Euler equation
end;

// Steady state (analytically solved)
initval;
A = 1;
k = ((1-beta*(1-delta))/(beta*alpha*A))^(1/(alpha-1));
c = A*k^alpha-delta*k;
end;

// Check that this is indeed the steady state
steady;

// Declare a positive technological shock in period 1
shocks;
var A;
periods 1;
values 1.2;
end;

// Prepare the deterministic simulation of the model over 100 periods
perfect_foresight_setup(periods=100);

// Perform the simulation
perfect_foresight_solver;

// Display the path of consumption
rplot c;