PAC iterative OLS: compatibility fix for Octave < 6

time-shift
Sébastien Villemot 2021-02-04 15:33:18 +01:00
parent f094dc71f9
commit 901d8355e3
No known key found for this signature in database
GPG Key ID: 2CECE9350ECEBE4A
1 changed files with 5 additions and 1 deletions

View File

@ -22,7 +22,7 @@ function iterative_ols(eqname, params, data, range)
% equation must have NaN values in the object.
% [4] It is assumed that the residual is additive.
% Copyright (C) 2018-2019 Dynare Team
% Copyright (C) 2018-2021 Dynare Team
%
% This file is part of Dynare.
%
@ -303,6 +303,10 @@ end
% Get indices in params0 for other parameters (optimizing agents share plus parameters related to exogenous variables).
[~, params_id_2] = setdiff(1:length(ipnames_), params_id_1);
if isoctave && octave_ver_less_than('6')
% Under Octave < 6, setdiff() behaves as with the 'legacy' option (i.e. pre-R2012b behaviour)
params_id_2 = params_id_2';
end
% Get indices in params0 for the parameters associated to the exogenous variables.
params_id_3 = setdiff(params_id_2, params_id_0);