commit
0bbf9f2d82
|
@ -95,7 +95,7 @@ if jacobian_flag
|
||||||
info = 0;
|
info = 0;
|
||||||
return;
|
return;
|
||||||
end
|
end
|
||||||
disp('Randomize initial guess...')
|
disp_verbose('Randomize initial guess...',options.verbosity)
|
||||||
% Let's try random numbers for the variables initialized with the default value.
|
% Let's try random numbers for the variables initialized with the default value.
|
||||||
wrong_initial_guess_flag = true;
|
wrong_initial_guess_flag = true;
|
||||||
% First try with positive numbers.
|
% First try with positive numbers.
|
||||||
|
@ -323,7 +323,7 @@ elseif ismember(options.solve_algo, [2, 12, 4])
|
||||||
end
|
end
|
||||||
fvec = feval(f, x, arguments{:});
|
fvec = feval(f, x, arguments{:});
|
||||||
if max(abs(fvec))>tolf
|
if max(abs(fvec))>tolf
|
||||||
disp('Call solver on the full nonlinear problem.')
|
disp_verbose('Call solver on the full nonlinear problem.',options.verbosity)
|
||||||
[x, errorflag] = solver(f, x, 1:nn, 1:nn, jacobian_flag, ...
|
[x, errorflag] = solver(f, x, 1:nn, 1:nn, jacobian_flag, ...
|
||||||
options.gstep, tolf, options.solve_tolx, maxit, ...
|
options.gstep, tolf, options.solve_tolx, maxit, ...
|
||||||
options.trust_region_initial_step_bound_factor, ...
|
options.trust_region_initial_step_bound_factor, ...
|
||||||
|
|
|
@ -120,7 +120,7 @@ elseif isequal(options_.osr.opt_algo,11)
|
||||||
else
|
else
|
||||||
|
|
||||||
if ~isempty(M_.osr.param_bounds) && ~(ismember(options_.osr.opt_algo,[1,2,5,9]) || ischar(options_.osr.opt_algo))
|
if ~isempty(M_.osr.param_bounds) && ~(ismember(options_.osr.opt_algo,[1,2,5,9]) || ischar(options_.osr.opt_algo))
|
||||||
error('OSR: OSR with bounds on parameters requires a constrained optimizer, i.e. opt_algo= 1,2,5, or 9.')
|
error('OSR: OSR with bounds on parameters requires a constrained optimizer, i.e. opt_algo= 1,2 or 9.')
|
||||||
end
|
end
|
||||||
%%do actual optimization
|
%%do actual optimization
|
||||||
[p, f] = dynare_minimize_objective(str2func('osr_obj'),t0,options_.osr.opt_algo,options_,M_.osr.param_bounds,M_.param_names(i_params),[],[], i_params,...
|
[p, f] = dynare_minimize_objective(str2func('osr_obj'),t0,options_.osr.opt_algo,options_,M_.osr.param_bounds,M_.param_names(i_params),[],[], i_params,...
|
||||||
|
|
Loading…
Reference in New Issue