Added integration test for d8ddd9ef6.

time-shift
Stéphane Adjemian (Charybdis) 2020-12-07 22:24:05 +01:00
parent a669c3765d
commit e066556d7a
Signed by: stepan
GPG Key ID: 295C1FE89E17EB3C
2 changed files with 47 additions and 0 deletions

View File

@ -116,6 +116,7 @@ MODFILES = \
histval_initval_file/sim_exo_lead_lag_initvalf.mod \
ramst_normcdf_and_friends.mod \
ramst_vec.mod \
ramst_mshocks_vec.mod \
example1_varexo_det.mod \
predetermined_variables.mod \
fs2000_ssfile.mod \

View File

@ -0,0 +1,46 @@
// Test mshocks block
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 = 2;
k = ((delt+bet)/(1.0*aa*x*alph))^(1/(alph-1));
c = aa*x*k^alph-delt*k;
end;
steady;
check;
xvalues = [1.2; 0.8; 0.8];
mshocks;
var x;
periods 1:3;
values (xvalues);
end;
perfect_foresight_setup(periods=200);
perfect_foresight_solver;
rplot c;
rplot k;
if ~all(oo_.exo_simul(M_.maximum_lag+(1:3)) == [ 2.4; 1.6; 1.6]) ...
|| ~all(oo_.exo_simul(M_.maximum_lag+(4:200)) == 2)
error("mshocks not correctly applied")
end