Skip to content
Snippets Groups Projects
Verified Commit fb4cd2c9 authored by Sébastien Villemot's avatar Sébastien Villemot
Browse files

NLS estimation: workaround for Octave random failure to read the generated ssr_*.m file

(cherry picked from commit f7149d60)
parent 14fbcee2
Branches
Tags
No related merge requests found
Pipeline #6052 failed
......@@ -251,6 +251,13 @@ fprintf(fid, 'r = %s-(%s);\n', lhs, rhs);
fprintf(fid, 's = r''*r;\n');
fclose(fid);
% 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]);
end
% Create a function handle returning the sum of square residuals for a given vector of parameters.
ssrfun = @(p) feval([M_.fname '.ssr_' eqname], p, DATA, M_, oo_);
......@@ -456,4 +463,4 @@ if ~noprint
dyn_table(title, preamble, afterward, oo_.nls.(eqname).pnames, ...
{'Estimates','t-statistic','Std. Error'}, 4, ...
[oo_.nls.(eqname).beta oo_.nls.(eqname).tstat sqrt(diag(C))]);
end
\ No newline at end of file
end
......@@ -164,6 +164,13 @@ fprintf(fid, 'r = %s-(%s);\n', lhs, rhs);
fprintf(fid, 's = r''*r;\n');
fclose(fid);
% 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]);
end
% Copy (sub)sample data in a matrix.
DATA = data([range(1)-1, range]).data;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment