| 1 |
var y x; |
| 2 |
varexo e; |
| 3 |
|
| 4 |
parameters beta theta rho xbar; |
| 5 |
xbar = 0.0179; |
| 6 |
rho = -0.139; |
| 7 |
theta = -1.5; |
| 8 |
theta = -10; |
| 9 |
beta = 0.95; |
| 10 |
|
| 11 |
model; |
| 12 |
y = beta*exp(theta*x(+1))*(1+y(+1)); |
| 13 |
x = (1-rho)*xbar + rho*x(-1)+e; |
| 14 |
end; |
| 15 |
|
| 16 |
shocks; |
| 17 |
var e; stderr 0.0348; |
| 18 |
end; |
| 19 |
|
| 20 |
initval; |
| 21 |
x = xbar; |
| 22 |
y = beta*exp(theta*xbar)/(1-beta*exp(theta*xbar)); |
| 23 |
end; |
| 24 |
|
| 25 |
resid; |
| 26 |
|
| 27 |
steady; |
| 28 |
|
| 29 |
stoch_simul(order=2,irf=0); |
| 30 |
|
| 31 |
sigma2=M_.Sigma_e; |
| 32 |
i = 1:800; |
| 33 |
a = theta*xbar*i+(theta^2*sigma2)/(2*(1-rho)^2)*(i-2*rho*(1-rho.^i)/(1-rho)+rho^2*(1-rho.^(2*i))/(1-rho^2)); |
| 34 |
a1 = theta^2*sigma2/(2*(1-rho)^2)*(i-2*rho*(1-rho.^i)/(1-rho)+rho^2*(1-rho.^(2*i))/(1-rho^2)); |
| 35 |
b = theta*rho*(1-rho.^i)/(1-rho); |
| 36 |
|
| 37 |
dr = oo_.dr; |
| 38 |
x1 = [dr.ghx(2); dr.ghu(2); dr.ghxx(2); dr.ghuu(2); dr.ghxu(2); dr.ghs2(2)]; |
| 39 |
x2 = [ |
| 40 |
sum(beta.^i.*exp(theta*xbar*i).*b*rho) |
| 41 |
sum(beta.^i.*exp(theta*xbar*i).*b) |
| 42 |
sum(beta.^i.*exp(theta*xbar*i).*(b*rho).^2) |
| 43 |
sum(beta.^i.*exp(theta*xbar*i).*b.^2) |
| 44 |
sum(beta.^i.*exp(theta*xbar*i).*b.^2*rho) |
| 45 |
sum(beta.^i.*exp(theta*xbar*i).*a1*2) |
| 46 |
]; |
| 47 |
if any(abs(x1-x2) > 1e-14); |
| 48 |
error('burnside_1 doesn''t reproduce the analytical solution'); |
| 49 |
end; |