OLS: Octave compatibility fix

Cell arrays cannot be used for derefencing fields in a structure.

For some unknown reason, this was nevertheless accepted by MATLAB in this
context.
time-shift
Sébastien Villemot 2021-02-04 16:54:09 +01:00
parent 78fdd50894
commit 2ee03c7e28
No known key found for this signature in database
GPG Key ID: 2CECE9350ECEBE4A
2 changed files with 5 additions and 5 deletions

View File

@ -28,7 +28,7 @@ function ds = dyn_ols(ds, fitted_names_dict, eqtags, model_name, param_names, ds
% SPECIAL REQUIREMENTS
% dynare must have been run with the option: json=compute
% Copyright (C) 2017-2020 Dynare Team
% Copyright (C) 2017-2021 Dynare Team
%
% This file is part of Dynare.
%
@ -186,7 +186,7 @@ for i = 1:length(Y)
oo_.ols.(tag).Yhat = ...
feval(fitted_names_dict{idx, 3}, oo_.ols.(tag).Yhat);
end
ds.(oo_.ols.(tag).Yhat.name) = oo_.ols.(tag).Yhat;
ds.(oo_.ols.(tag).Yhat.name{:}) = oo_.ols.(tag).Yhat;
%% Calculate statistics
% Estimate for sigma^2
@ -233,4 +233,4 @@ for i = 1:length(Y)
[oo_.ols.(tag).beta oo_.ols.(tag).tstat oo_.ols.(tag).stderr]);
end
end
end
end

View File

@ -30,7 +30,7 @@ function ds = olsgibbs(ds, eqtag, BetaPriorExpectation, BetaPriorVariance, s2, n
% SPECIAL REQUIREMENTS
% dynare must have been run with the option: json=compute
% Copyright (C) 2018-2019 Dynare Team
% Copyright (C) 2018-2021 Dynare Team
%
% This file is part of Dynare.
%
@ -245,7 +245,7 @@ if any(idx) ...
oo_.olsgibbs.(model_name).Yhat = ...
feval(fitted_names_dict{idx, 3}, oo_.olsgibbs.(model_name).Yhat);
end
ds.(oo_.olsgibbs.(model_name).Yhat.name) = oo_.olsgibbs.(model_name).Yhat;
ds.(oo_.olsgibbs.(model_name).Yhat.name{:}) = oo_.olsgibbs.(model_name).Yhat;
% Compute and save posterior densities.
for i=1:n