NLS estimation: workaround for Octave random failure to read the generated ssr_*.m file
parent
7083f1d692
commit
f7149d60cc
|
@ -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
|
||||
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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue