Allow shocks over multiple periods in backward model routine.

parent 56d3adb7
......@@ -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));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment