function check_plot(fun,xparam,SE_vec,options_,M_,estim_params_,Bounds,bayestopt_,varargin)
%function check_plot(fun,xparam,SE_vec,options_,M_,estim_params_,Bounds,bayestopt_,varargin)
% Checks the estimated local minimum of the moment's distance objective
% Copyright © 2020-2021 Dynare Team
%
% This file is part of Dynare.
%
% Dynare is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% Dynare is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see .
TeX = options_.TeX;
if ~isempty(SE_vec)
[ s_min, k ] = min(SE_vec);
end
fval = feval(fun,xparam,varargin{:});
if ~isempty(SE_vec)
skipline()
disp('LOCAL MINIMUM CHECK')
skipline()
fprintf('Fval obtained by the minimization routine: %f', fval);
skipline()
if s_min(1-ll)*xparam(kk)) && (xparam(kk)+(xparam(kk)-l1)