| 1 |
var y x z u; |
| 2 |
|
| 3 |
varexo e f g; |
| 4 |
|
| 5 |
parameters beta theta rho xbar; |
| 6 |
xbar = 0.0179; |
| 7 |
rho = -0.139; |
| 8 |
theta = -1.5; |
| 9 |
beta = 0.95; |
| 10 |
|
| 11 |
model; |
| 12 |
1 = beta*exp(theta*u(+1))*(1+y(+1))/y; |
| 13 |
x = (1-rho)*xbar + rho*x(-1) + e; |
| 14 |
z = (1-rho)*xbar + rho*z(-1) + .3*x(-1) + f; |
| 15 |
u = (x+z)/2 + g; |
| 16 |
end; |
| 17 |
|
| 18 |
shocks; |
| 19 |
var e; stderr 0.0348; |
| 20 |
var f; stderr 0.0100; |
| 21 |
var g; stderr 0.0100; |
| 22 |
end; |
| 23 |
|
| 24 |
initval; |
| 25 |
x = xbar; |
| 26 |
z = xbar; |
| 27 |
u = xbar; |
| 28 |
y = beta*exp(theta*xbar)/(1-beta*exp(theta*xbar)); |
| 29 |
end; |
| 30 |
|
| 31 |
resid; |
| 32 |
|
| 33 |
steady; |
| 34 |
|
| 35 |
check; |
| 36 |
|
| 37 |
if beta*exp(theta*xbar+.5*theta^2*M_.Sigma_e/(1-rho)^2)>1-eps |
| 38 |
disp('The model doesn''t have a solution!') |
| 39 |
return |
| 40 |
end |
| 41 |
|
| 42 |
seed = 31415; |
| 43 |
|
| 44 |
tic |
| 45 |
extended_path(periods=10, order=2, tree=perfect, integration=unscented); |
| 46 |
dprintf('SEP(2) with perfect tree and unscented integration took %6.4f seconds.\n', toc); |
| 47 |
|
| 48 |
if ~oo_.extended_path.status |
| 49 |
error('Stochastic extended path did not find solution in integration/burnside2.mod (tree=perfect, order=2, integration=unscented).') |
| 50 |
end |
| 51 |
|
| 52 |
seed = 31415; |
| 53 |
|
| 54 |
tic |
| 55 |
extended_path(periods=10, order=2, tree=perfect, number_of_quadrature_nodes=3, integration=tensor_gaussian_quadrature); |
| 56 |
dprintf('SEP(2) with perfect tree and gaussian quadrature integration took %6.4f seconds.\n', toc); |
| 57 |
|
| 58 |
if ~oo_.extended_path.status |
| 59 |
error('Stochastic extended path did not find solution in integration/burnside2.mod (tree=perfect, order=2, number_of_quadrature_nodes=3, integration=tensor_gaussian_quadrature).') |
| 60 |
end |
| 61 |
|
| 62 |
seed = 31415; |
| 63 |
|
| 64 |
tic |
| 65 |
extended_path(periods=10, order=2, tree=perfect, integration=stroud); |
| 66 |
dprintf('SEP(2) with perfect tree and cubature integration took %6.4f seconds.\n', toc); |
| 67 |
|
| 68 |
if ~oo_.extended_path.status |
| 69 |
error('Stochastic extended path did not find solution in integration/burnside2.mod (tree=perfect, order=2, integration=stroud).') |
| 70 |
end |
| 71 |
|
| 72 |
seed = 31415; |
| 73 |
|
| 74 |
tic |
| 75 |
extended_path(periods=10, order=2, tree=sparse, integration=unscented); |
| 76 |
dprintf('SEP(2) with sparse tree and unscented integration took %6.4f seconds.\n', toc); |
| 77 |
|
| 78 |
if ~oo_.extended_path.status |
| 79 |
error('Stochastic extended path did not find solution in integration/burnside2.mod (tree=sparse, order=2, integration=unscented).') |
| 80 |
end |
| 81 |
|
| 82 |
seed = 31415; |
| 83 |
|
| 84 |
tic |
| 85 |
extended_path(periods=10, order=2, tree=sparse, number_of_quadrature_nodes=3, integration=tensor_gaussian_quadrature); |
| 86 |
dprintf('SEP(2) with sparse tree and gaussian quadrature integration took %6.4f seconds.\n', toc); |
| 87 |
|
| 88 |
if ~oo_.extended_path.status |
| 89 |
error('Stochastic extended path did not find solution in integration/burnside2.mod (tree=sparse, order=2, number_of_quadrature_nodes=3, integration=tensor_gaussian_quadrature).') |
| 90 |
end |
| 91 |
|
| 92 |
seed = 31415; |
| 93 |
|
| 94 |
tic |
| 95 |
extended_path(periods=10, order=2, tree=sparse, integration=stroud); |
| 96 |
dprintf('SEP(2) with sparse tree and cubature integration took %6.4f seconds.\n', toc); |
| 97 |
|
| 98 |
if ~oo_.extended_path.status |
| 99 |
error('Stochastic extended path did not find solution in integration/burnside2.mod (tree=sparse, order=2, integration=stroud).') |
| 100 |
end |