Hi Emilio,

I implemented the changes that you put into your model. So, I removed the home budget constraint, I removed the bond market clearing, and replaced it with the goods market clearing (like what you did).

I also analytically calculate the steady state and in the long run, the IRF don’t return to 0.

```
var c cstar n nstar k kstar z zstar r rstar w wstar y ystar bstar q;
predetermined_variables k kstar bstar;
varexo e estar;
parameters beta theta delta rho rhostar sigma a;
beta = 0.99;
delta = 0.025;
theta = 0.36;
a = 1;
rho = 0.906;
rhostar = 0.05;
sigma = .00852;
model;
/*
Home Economy
*/
y = exp(z) * k^theta * n^(1 - theta);
/*
Constraints for home Economy
*/
/*
FOC - intra temporal, capital accumulation, and bond accumulation
*/
a/(1-n) = (1/c) * w;
(1/c) = beta * ((1/c(+1)) * (r(+1) + 1 - delta));
beta * (1/c(+1)) = q * (1/c);
z = rho * z(-1) + rhostar * zstar(-1) + e;
r = theta * exp(z) * k^(theta - 1) * n^(1-theta);
w = (1 - theta) * exp(z) * k^(theta) * n^(-theta);
/*
Foreign Economy
*/
ystar = exp(zstar) * kstar^theta * nstar^(1 - theta);
/*
Constraints for foreign Economy
*/
cstar + kstar(+1) + q * bstar(+1) = wstar * nstar + rstar * kstar + (1 - delta) * kstar + bstar;
/*
FOC - intra temporal, capital accumulation, and bond accumulation
*/
a/(1-nstar) = (1/cstar) * wstar;
(1/cstar) = beta * ((1/cstar(+1)) * (rstar(+1) + 1 - delta));
beta * (1/cstar(+1)) = q * (1/cstar);
zstar = rho * zstar(-1) + rhostar * z(-1) + estar;
rstar = theta * exp(zstar) * kstar^(theta - 1) * nstar^(1-theta);
wstar = (1 - theta) * exp(zstar) * kstar^(theta) * nstar^(-theta);
/*
Bond market clearing
*/
y + ystar = c + cstar + k(+1) - (1-delta)*k + kstar(+1) - (1-delta)*kstar;
end;
steady_state_model;
r = (1/beta) + delta - 1;
n = 1 / (1 + (a/(1-theta)) * (1 - delta * theta * (beta/(1 + beta * delta - beta))));
k = (r / (theta * n^(1 - theta)))^(1/(theta-1));
y = k^theta * n^(1 - theta);
w = (1 - theta) * (y / n);
c = y - delta * k;
q = beta;
//b = 0;
rstar = (1/beta) + delta - 1;
nstar = 1 / (1 + (a/(1-theta)) * (1 - delta * theta * (beta/(1 + beta * delta - beta))));
kstar = (rstar / (theta * nstar^(1 - theta)))^(1/(theta-1));
ystar = kstar^theta * nstar^(1 - theta);
wstar = (1 - theta) * (ystar / nstar);
cstar = ystar - delta * kstar;
bstar = 0;
z = 0;
zstar = 0;
end;
model_diagnostics;
resid;
steady;
shocks;
var e = sigma^2;
var estar = sigma^2;
corr e, estar = 0.258;
end;
stoch_simul(hp_filter = 1600, order = 1, irf=200);
```