| 1 |
/* Verify that the “datafile” option of “perfect_foresight_setup” behaves as |
| 2 |
“initval_file” (see #1663) */ |
| 3 |
|
| 4 |
var c k; |
| 5 |
varexo x; |
| 6 |
|
| 7 |
parameters alph gam delt bet aa; |
| 8 |
alph=0.5; |
| 9 |
gam=0.5; |
| 10 |
delt=0.02; |
| 11 |
bet=0.05; |
| 12 |
aa=0.5; |
| 13 |
|
| 14 |
|
| 15 |
model; |
| 16 |
c + k - aa*x*k(-1)^alph - (1-delt)*k(-1); |
| 17 |
c^(-gam) - (1+bet)^(-1)*(aa*alph*x(+1)*k^(alph-1) + 1 - delt)*c(+1)^(-gam); |
| 18 |
end; |
| 19 |
|
| 20 |
initval; |
| 21 |
x = 1; |
| 22 |
k = ((delt+bet)/(1.0*aa*alph))^(1/(alph-1)); |
| 23 |
c = aa*k^alph-delt*k; |
| 24 |
end; |
| 25 |
|
| 26 |
steady; |
| 27 |
|
| 28 |
perfect_foresight_setup(periods=200, datafile = ramst_initval_file_data_col_vec_mat); |
| 29 |
if oo_.exo_simul(2) ~= 1.2 |
| 30 |
error('datafile option problem with exogenous variable'); |
| 31 |
end |
| 32 |
if oo_.endo_simul(2, 2) ~= 13 |
| 33 |
error('datafile option problem with endogenous variable'); |
| 34 |
end |
| 35 |
|
| 36 |
perfect_foresight_solver; |