Allow shocks over multiple periods in backward model routine.
parent
56d3adb778
commit
4b4c3db3b9
|
@ -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));
|
||||
|
|
Loading…
Reference in New Issue