% return if initial value solves the problem except if a mixed complementarity problem is to be solved (complementarity conditions may not be satisfied)
% max([NaN, 0])=0, so explicitly exclude the case where fvec contains a NaN
errorcode=-11;
return;
end
ifoptions.solve_randomize_initial_guess
ifoptions_.solve_randomize_initial_guess
ifany(~isreal(fvec))||any(~isreal(fjac(:)))
disp_verbose('dynare_solve: starting value results in complex values. Randomize initial guess...',options.verbosity)
disp_verbose('dynare_solve: starting value results in complex values. Randomize initial guess...',options_.verbosity)
else
disp_verbose('dynare_solve: starting value results in nonfinite/NaN value. Randomize initial guess...',options.verbosity)
disp_verbose('dynare_solve: starting value results in nonfinite/NaN value. Randomize initial guess...',options_.verbosity)
end
% Let's try random numbers for the variables initialized with the default value.
% return if initial value solves the problem except if a mixed complementarity problem is to be solved (complementarity conditions may not be satisfied)
% max([NaN, 0])=0, so explicitly exclude the case where fvec contains a NaN
fprintf('\nDYNARE_SOLVE (solve_algo=2|4): the Dulmage-Mendelsohn decomposition returned a non-square block. This means that the Jacobian is singular. You may want to try another value for solve_algo.\n')