2009-12-16 18:25:06 +01:00
|
|
|
/* Test for the initval_file() command. This file needs ramst_initval_file_data.m. It should give results similar to those of ramst.mod */
|
|
|
|
|
|
|
|
var c k;
|
|
|
|
varexo x;
|
|
|
|
|
|
|
|
parameters alph gam delt bet aa;
|
|
|
|
alph=0.5;
|
|
|
|
gam=0.5;
|
|
|
|
delt=0.02;
|
|
|
|
bet=0.05;
|
|
|
|
aa=0.5;
|
|
|
|
|
|
|
|
|
|
|
|
model;
|
|
|
|
c + k - aa*x*k(-1)^alph - (1-delt)*k(-1);
|
|
|
|
c^(-gam) - (1+bet)^(-1)*(aa*alph*x(+1)*k^(alph-1) + 1 - delt)*c(+1)^(-gam);
|
|
|
|
end;
|
|
|
|
|
|
|
|
initval;
|
|
|
|
x = 1;
|
|
|
|
k = ((delt+bet)/(1.0*aa*alph))^(1/(alph-1));
|
|
|
|
c = aa*k^alph-delt*k;
|
|
|
|
end;
|
|
|
|
|
2014-11-27 10:49:18 +01:00
|
|
|
steady;
|
2019-12-19 14:48:52 +01:00
|
|
|
|
|
|
|
initval_file(filename = ramst_initval_file_data_row_vec_mat);
|
|
|
|
if oo_.exo_simul(2) ~= 1.2
|
|
|
|
error('initval_file problem with exogenous variable');
|
|
|
|
end
|
|
|
|
if oo_.endo_simul(2, 2) ~= 13
|
|
|
|
error('initval_file option problem with endogenous variable');
|
|
|
|
end
|
2015-03-13 17:26:27 +01:00
|
|
|
perfect_foresight_setup(periods=200);
|
|
|
|
perfect_foresight_solver;
|
2009-12-16 18:25:06 +01:00
|
|
|
|
2019-12-19 14:48:52 +01:00
|
|
|
oo_.exo_simul = [];
|
|
|
|
oo_.endo_simul = [];
|
2015-03-09 08:59:48 +01:00
|
|
|
|
2014-11-27 10:49:18 +01:00
|
|
|
initval_file(filename = ramst_initval_file_data_col_vec_mat);
|
2019-12-19 14:48:52 +01:00
|
|
|
if oo_.exo_simul(2) ~= 1.2
|
|
|
|
error('initval_file problem with exogenous variable');
|
|
|
|
end
|
|
|
|
if oo_.endo_simul(2, 2) ~= 13
|
|
|
|
error('initval_file problem with endogenous variable');
|
|
|
|
end
|
|
|
|
|
2015-03-13 17:26:27 +01:00
|
|
|
perfect_foresight_setup(periods=200);
|
|
|
|
perfect_foresight_solver;
|
2014-11-27 10:49:18 +01:00
|
|
|
|
2015-03-09 08:59:48 +01:00
|
|
|
if ispc()
|
|
|
|
initval_file(filename = ramst_initval_file_excel);
|
2015-03-13 17:26:27 +01:00
|
|
|
perfect_foresight_setup(periods=200);
|
|
|
|
perfect_foresight_solver;
|
2015-03-09 08:59:48 +01:00
|
|
|
end
|