hi, I read through this thread and some related treads but I still cannot get the code working. The simple model with two exogenous shocks is
- Code: Select all
var a, b;
varexo e, u;
parameters rho;
rho = 0.95;
model;
a = rho*a(-1) + e;
b = rho*b(-1) + u;
end;
shocks;
var e; stderr 1;
var u; stderr 1;
end;
stoch_simul(order=1);
The modified model with c is the sum of the shock e and shock u is
- Code: Select all
var a, b;
varexo e, u, c;
parameters rho;
rho = 0.95;
model;
a = rho*a(-1) + e;
b = rho*b(-1) + u;
c=e+u;
end;
shocks;
var e; stderr 1;
var u; stderr 1;
var c; stderr 2;
end;
stoch_simul(order=1);
The error I got is "ERROR: There are 3 equations but 2 endogenous variables!"
I know why I got this error but I cannot write a correct model that gives a irf of shock c which is the sum of e and u.
If I try the following code:
- Code: Select all
var a, b;
varexo u, c;
parameters rho;
rho = 0.95;
model;
a = rho*a(-1) + c-u;
b = rho*b(-1) + u;
end;
shocks;
var e; stderr 1;
var u; stderr 1;
var c; stderr 2;
end;
stoch_simul(order=1);
Then I'll introduce the correlation of shock u to a. I know in this example it makes no sense to look at the sum of shocks. I just use it simple to know how to construct the sum of shocks and get the irf. Thanks!