Allow shocks over multiple periods in backward model routine.

time-shift
Stéphane Adjemian(Charybdis) 2017-10-14 16:35:01 +02:00
parent 56d3adb778
commit 4b4c3db3b9
1 changed files with 4 additions and 5 deletions

View File

@ -85,9 +85,6 @@ else
if initialconditionperiod>=shock.dates(1)
error('In experiment n°%s, the shock period must follow %s!', string(initialconditionperiod))
end
if shock.nobs>1
error('Shocks over multiple periods not implemented yet!')
end
end
end
end
@ -160,10 +157,12 @@ for i=1:length(listofshocks)
% Add the shock.
if deterministicshockflag
shock = listofshocks{i};
timid = shock.dates(1)-initialconditionperiod;
timid = shock.dates-initialconditionperiod;
for j=1:shock.vobs
k = find(strcmp(shock.name{i}, exonames));
innovations(timid,k) = innovations(timid,k) + shock.data(1,j);
for l=1:length(timid)
innovations(timid(l),k) = innovations(timid(l),k) + shock.data(l,j);
end
end
else
j = find(strcmp(listofshocks{i}, exonames));