Fixed ec matrix (rules out lag>1).
parent
36388ce28a
commit
00498d19c8
|
@ -143,7 +143,7 @@ end
|
|||
|
||||
% Initialize matrices
|
||||
oo_.(model_type).(model_name).ar = zeros(length(lhs), length(lhs), max(M_.(model_type).(model_name).max_lag));
|
||||
oo_.(model_type).(model_name).ec = zeros(length(lhs), length(ecRhsVars), max(M_.(model_type).(model_name).max_lag));
|
||||
oo_.(model_type).(model_name).ec = zeros(length(lhs), length(ecRhsVars), 1);
|
||||
oo_.(model_type).(model_name).ar_idx = lhs;
|
||||
oo_.(model_type).(model_name).ec_idx = ecRhsVars;
|
||||
|
||||
|
@ -165,11 +165,13 @@ for i = 1:length(lhs)
|
|||
elseif rhsvars{i}.ecRhsIdxs(j) > 0
|
||||
% Fill EC
|
||||
[lag, ndiffs] = findLagForVar(var, -rhsvars{i}.lags(j), 0, ecRhsVars);
|
||||
if lag==1
|
||||
if size(oo_.(model_type).(model_name).ec, 3) < lag
|
||||
oo_.(model_type).(model_name).ec(i, rhsvars{i}.ecRhsIdxs(j), lag) = 0;
|
||||
end
|
||||
oo_.(model_type).(model_name).ec(i, rhsvars{i}.ecRhsIdxs(j), lag) = ...
|
||||
oo_.(model_type).(model_name).ec(i, rhsvars{i}.ecRhsIdxs(j), lag) + g1(i, g1col);
|
||||
end
|
||||
else
|
||||
error('Shouldn''t arrive here');
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue