Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Johannes Pfeifer
dynare
Commits
03641585
Verified
Commit
03641585
authored
Nov 26, 2020
by
Willi Mutschler
Browse files
✅
Fix lsqnonlin in Octave
parent
25f1641d
Changes
1
Hide whitespace changes
Inline
Side-by-side
matlab/optimization/dynare_minimize_objective.m
View file @
03641585
...
...
@@ -537,7 +537,13 @@ switch minimizer_algorithm
if
options_
.
silent_optimizer
optim_options
=
optimset
(
optim_options
,
'display'
,
'off'
);
end
[
opt_par_values
,
Resnorm
,
fval
,
exitflag
,
OUTPUT
,
LAMBDA
,
JACOB
]
=
lsqnonlin
(
objective_function
,
start_par_value
,
bounds
(:,
1
),
bounds
(:,
2
),
optim_options
,
varargin
{:});
if
~
isoctave
[
opt_par_values
,
Resnorm
,
fval
,
exitflag
,
OUTPUT
,
LAMBDA
,
JACOB
]
=
lsqnonlin
(
objective_function
,
start_par_value
,
bounds
(:,
1
),
bounds
(:,
2
),
optim_options
,
varargin
{:});
else
% Under Octave, use a wrapper, since lsqnonlin() does not have a 6th arg
func
=
@
(
x
)
objective_function
(
x
,
varargin
{:});
[
opt_par_values
,
Resnorm
,
fval
,
exitflag
,
OUTPUT
,
LAMBDA
,
JACOB
]
=
lsqnonlin
(
func
,
start_par_value
,
bounds
(:,
1
),
bounds
(:,
2
),
optim_options
);
end
otherwise
if
ischar
(
minimizer_algorithm
)
if
exist
(
minimizer_algorithm
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment