| 1 |
var y x; |
| 2 |
|
| 3 |
varexo e; |
| 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*x(+1))*(1+y(+1))/y; |
| 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 |
check; |
| 30 |
|
| 31 |
if beta*exp(theta*xbar+.5*theta^2*M_.Sigma_e/(1-rho)^2)>1-eps |
| 32 |
disp('The model doesn''t have a solution!') |
| 33 |
return |
| 34 |
end |
| 35 |
|
| 36 |
seed = 31415; |
| 37 |
|
| 38 |
tic |
| 39 |
extended_path(periods=10, order=4, tree=perfect, integration=unscented); |
| 40 |
dprintf('SEP(4) with perfect tree and unscented integration took %6.4f seconds.\n', toc); |
| 41 |
|
| 42 |
if ~oo_.extended_path.status |
| 43 |
error('Stochastic extended path did not find solution in integration/burnside.mod (tree=perfect, order=4, integration=unscented).') |
| 44 |
end |
| 45 |
|
| 46 |
seed = 31415; |
| 47 |
|
| 48 |
tic |
| 49 |
extended_path(periods=10, order=4, tree=perfect, number_of_quadrature_nodes=3, integration=tensor_gaussian_quadrature); |
| 50 |
dprintf('SEP(4) with perfect tree and gaussian quadrature integration took %6.4f seconds.\n', toc); |
| 51 |
|
| 52 |
if ~oo_.extended_path.status |
| 53 |
error('Stochastic extended path did not find solution in integration/burnside.mod (tree=perfect, order=4, number_of_quadrature_nodes=3, integration=tensor_gaussian_quadrature).') |
| 54 |
end |
| 55 |
|
| 56 |
seed = 31415; |
| 57 |
|
| 58 |
tic |
| 59 |
extended_path(periods=10, order=4, tree=perfect, integration=stroud); |
| 60 |
dprintf('SEP(4) with perfect tree and cubature integration took %6.4f seconds.\n', toc); |
| 61 |
|
| 62 |
if ~oo_.extended_path.status |
| 63 |
error('Stochastic extended path did not find solution in integration/burnside.mod (tree=perfect, order=4, integration=stroud).') |
| 64 |
end |
| 65 |
|
| 66 |
seed = 31415; |
| 67 |
|
| 68 |
tic |
| 69 |
extended_path(periods=10, order=4, tree=sparse, integration=unscented); |
| 70 |
dprintf('SEP(4) with sparse tree and unscented integration took %6.4f seconds.\n', toc); |
| 71 |
|
| 72 |
if ~oo_.extended_path.status |
| 73 |
error('Stochastic extended path did not find solution in integration/burnside.mod (tree=sparse, order=4, integration=unscented).') |
| 74 |
end |
| 75 |
|
| 76 |
seed = 31415; |
| 77 |
|
| 78 |
tic |
| 79 |
extended_path(periods=10, order=4, tree=sparse, number_of_quadrature_nodes=3, integration=tensor_gaussian_quadrature); |
| 80 |
dprintf('SEP(4) with sparse tree and gaussian quadrature integration took %6.4f seconds.\n', toc); |
| 81 |
|
| 82 |
if ~oo_.extended_path.status |
| 83 |
error('Stochastic extended path did not find solution in integration/burnside.mod (tree=sparse, order=4, number_of_quadrature_nodes=3, integration=tensor_gaussian_quadrature).') |
| 84 |
end |
| 85 |
|
| 86 |
seed = 31415; |
| 87 |
|
| 88 |
tic |
| 89 |
extended_path(periods=10, order=4, tree=sparse, integration=stroud); |
| 90 |
dprintf('SEP(4) with sparse tree and cubature integration took %6.4f seconds.\n', toc); |
| 91 |
|
| 92 |
if ~oo_.extended_path.status |
| 93 |
error('Stochastic extended path did not find solution in integration/burnside.mod (tree=sparse, order=4, integration=stroud).') |
| 94 |
end |