File: burnside_1.mod

package info (click to toggle)
dynare 6.5-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 67,796 kB
  • sloc: cpp: 79,110; ansic: 28,917; objc: 12,445; yacc: 4,537; pascal: 1,993; lex: 1,441; sh: 1,132; python: 634; makefile: 628; lisp: 163; xml: 18
file content (49 lines) | stat: -rw-r--r-- 1,073 bytes parent folder | download | duplicates (2)
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
46
47
48
49
var y x;
varexo e;

parameters beta theta rho xbar;
xbar = 0.0179;
rho = -0.139;
theta = -1.5;
theta = -10;
beta = 0.95;

model;
y = beta*exp(theta*x(+1))*(1+y(+1));
x = (1-rho)*xbar + rho*x(-1)+e;
end;

shocks;
var e; stderr 0.0348;
end;

initval;
x = xbar;
y = beta*exp(theta*xbar)/(1-beta*exp(theta*xbar));
end;

resid;

steady;

stoch_simul(order=2,irf=0);

sigma2=M_.Sigma_e;
i = 1:800;
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));
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));
b = theta*rho*(1-rho.^i)/(1-rho);

dr = oo_.dr;
x1 = [dr.ghx(2); dr.ghu(2); dr.ghxx(2); dr.ghuu(2); dr.ghxu(2); dr.ghs2(2)];
x2 = [
 sum(beta.^i.*exp(theta*xbar*i).*b*rho)
 sum(beta.^i.*exp(theta*xbar*i).*b)
 sum(beta.^i.*exp(theta*xbar*i).*(b*rho).^2)
 sum(beta.^i.*exp(theta*xbar*i).*b.^2)
 sum(beta.^i.*exp(theta*xbar*i).*b.^2*rho)
 sum(beta.^i.*exp(theta*xbar*i).*a1*2)
];
if any(abs(x1-x2) > 1e-14);
   error('burnside_1 doesn''t reproduce the analytical solution');
end;