Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
dynare
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dynare
dynare
Commits
fb4cd2c9
Verified
Commit
fb4cd2c9
authored
3 years ago
by
Sébastien Villemot
Browse files
Options
Downloads
Patches
Plain Diff
NLS estimation: workaround for Octave random failure to read the generated ssr_*.m file
(cherry picked from commit
f7149d60
)
parent
14fbcee2
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Pipeline
#6052
failed
3 years ago
Stage: build
Stage: test
Stage: pkg
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
matlab/+estimate/nls.m
+8
-1
8 additions, 1 deletion
matlab/+estimate/nls.m
matlab/+pac/+estimate/nls.m
+7
-0
7 additions, 0 deletions
matlab/+pac/+estimate/nls.m
with
15 additions
and
1 deletion
matlab/+estimate/nls.m
+
8
−
1
View file @
fb4cd2c9
...
...
@@ -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
This diff is collapsed.
Click to expand it.
matlab/+pac/+estimate/nls.m
+
7
−
0
View file @
fb4cd2c9
...
...
@@ -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
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment