| 1 |
// Test dates in shocks block and in perfect_foresight_setup |
| 2 |
|
| 3 |
var c k; |
| 4 |
varexo x; |
| 5 |
|
| 6 |
parameters alph gam delt bet aa; |
| 7 |
alph=0.5; |
| 8 |
gam=0.5; |
| 9 |
delt=0.02; |
| 10 |
bet=0.05; |
| 11 |
aa=0.5; |
| 12 |
|
| 13 |
|
| 14 |
model; |
| 15 |
c + k - aa*x*k(-1)^alph - (1-delt)*k(-1); |
| 16 |
c^(-gam) - (1+bet)^(-1)*(aa*alph*x(+1)*k^(alph-1) + 1 - delt)*c(+1)^(-gam); |
| 17 |
end; |
| 18 |
|
| 19 |
initval; |
| 20 |
x = 1; |
| 21 |
k = ((delt+bet)/(1.0*aa*alph))^(1/(alph-1)); |
| 22 |
c = aa*k^alph-delt*k; |
| 23 |
end; |
| 24 |
|
| 25 |
steady; |
| 26 |
|
| 27 |
check; |
| 28 |
|
| 29 |
shocks; |
| 30 |
var x; |
| 31 |
periods 2000Q2:2000Q4; |
| 32 |
values 1.2; |
| 33 |
end; |
| 34 |
|
| 35 |
perfect_foresight_setup(first_simulation_period = 2000Q1, last_simulation_period = 2049Q4); |
| 36 |
perfect_foresight_solver; |
| 37 |
|
| 38 |
if ~isequal(find(oo_.exo_simul == 1.2), (3:5)') |
| 39 |
error('Incorrect handling of dates in the shocks block') |
| 40 |
end |
| 41 |
|
| 42 |
if ~isequal(Simulated_time_series.dates, dates('1999Q4'):dates('2050Q1')) |
| 43 |
error('Incorrect Simulated_time_series object') |
| 44 |
end |