Octave: better workaround for bug 46282

trustregion
Sébastien Villemot 2022-01-25 11:32:08 +01:00
parent 79132ebe55
commit 9c79b0d73f
No known key found for this signature in database
GPG Key ID: 2CECE9350ECEBE4A
2 changed files with 5 additions and 7 deletions

View File

@ -28,7 +28,7 @@ function nls(eqname, params, data, range, optimizer, varargin)
% equation must have NaN values in the object.
% [4] It is assumed that the residual is additive.
% Copyright © 2021 Dynare Team
% Copyright © 2021-2022 Dynare Team
%
% This file is part of Dynare.
%
@ -182,8 +182,7 @@ write_ssr_routine(lhs, rhs, eqname, ipnames_, M_);
% Workaround for Octave bug https://savannah.gnu.org/bugs/?46282
% Octave will randomly fail to read the ssr_* file generated in the +folder
if isoctave
rename(['+' M_.fname], ['+' M_.fname '-tmp']);
rename(['+' M_.fname '-tmp'], ['+' M_.fname]);
path(path)
end
% Create a function handle returning the sum of square residuals for a given vector of parameters.

View File

@ -42,7 +42,7 @@ function nls(eqname, params, data, range, optimizer, varargin)
% is available only if the matylab optimization toolbox is installed), the
% remaining inputs are the options (key/value) passed to the optimizers.
% Copyright © 2018-2021 Dynare Team
% Copyright © 2018-2022 Dynare Team
%
% This file is part of Dynare.
%
@ -99,8 +99,7 @@ write_ssr_routine(lhs, rhs, eqname, ipnames_, M_, pacmodl);
% Workaround for Octave bug https://savannah.gnu.org/bugs/?46282
% Octave will randomly fail to read the ssr_* file generated in the +folder
if isoctave
rename(['+' M_.fname], ['+' M_.fname '-tmp']);
rename(['+' M_.fname '-tmp'], ['+' M_.fname]);
path(path)
end
% Copy (sub)sample data in a matrix.
@ -272,4 +271,4 @@ if ~noprint
dyn_table(title, preamble, afterward, oo_.pac.(pacmodl).parnames, ...
{'Estimates','t-statistic','Std. Error'}, 4, ...
[oo_.pac.(pacmodl).estimator oo_.pac.(pacmodl).student sqrt(diag(C))]);
end
end