From 4d696748747fb92323102ee5a7e02de8a048e556 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Adjemian=20=28Charybdis=29?= Date: Thu, 7 Mar 2019 12:31:23 +0100 Subject: [PATCH] Partially reverts 1190cab. --- matlab/+pac/+estimate/nls.m | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/matlab/+pac/+estimate/nls.m b/matlab/+pac/+estimate/nls.m index e59181246..ba52b5a2b 100644 --- a/matlab/+pac/+estimate/nls.m +++ b/matlab/+pac/+estimate/nls.m @@ -280,23 +280,23 @@ if nargin<5 end if is_gauss_newton - [params1, SSR] = gauss_newton(resfun, params0); + [params1, SSR, exitflag] = gauss_newton(resfun, params0); elseif is_lsqnonlin if ismember('levenberg-marquardt', varargin) % Levenberg Marquardt does not handle boundary constraints. - [params1, SSR] = lsqnonlin(resfun, params0, [], [], optimset(varargin{:})); + [params1, SSR, ~, exitflag] = lsqnonlin(resfun, params0, [], [], optimset(varargin{:})); else - [params1, SSR] = lsqnonlin(resfun, params0, bounds(:,1), bounds(:,2), optimset(varargin{:})); + [params1, SSR, ~, exitflag] = lsqnonlin(resfun, params0, bounds(:,1), bounds(:,2), optimset(varargin{:})); end else % Estimate the parameters by minimizing the sum of squared residuals. - [params1, SSR] = dynare_minimize_objective(ssrfun, params0, ... - minalgo, ... - options_, ... - bounds, ... - parameter_names, ... - [], ... - []); + [params1, SSR, exitflag] = dynare_minimize_objective(ssrfun, params0, ... + minalgo, ... + options_, ... + bounds, ... + parameter_names, ... + [], ... + []); end % Revert local modifications to the options.