I frequently use the Minimize function in JSL to solve a non-linear equation and one thing i have noticed is that occasionally, the function may fail to reach convergence. Is there a way to get those results from the script? I am writing a script to solve the model for many different subsets of data and while I can get the parameters, minimized objective and number of iterations for each model that is solved, i don't know if it ended up on a result because it reached the max iterations, converged or failed to converge. Below is an example of the function and the results from a great post by Milo, from JMP. https://community.jmp.com/t5/JMPer-Cable/Minimize-and-Maximize-Functions-in-JSL/ba-p/36355 x = 0;
y = 0;
{objVal, iters, gradient, hessian} =
Minimize(
((2 * x ^ 2 + 12 * x * y - y * 3)),
{x( -1, 1 ), y( -1, 1 )},
<<maxIter( 200 ),
<<tolerance( 10 ^ -6 ),
<<ShowDetails( True ),
//<<UseNumericDeriv( True ), /*rarely needed*/
//<<Gradient({4*x+12*y, 12*x-3}), /*rarely needed*/
//<<Hessian({{4,12},{0}}) /*rarely needed*/
);
Show( x, y, objVal, iters, gradient, hessian ); These details below are outputted into the log window, and i'd like to get the "Convergence SUCCESS" for the results of each model I run. Any suggestions would be appreciated. nParm=2 Newton ****************************************************** Iter nFree Objective RelGrad NormGrad2 Ridge nObj nGrad nHess Parm0 Parm1 0 2 0 0.125 0.5 0 1 1 1 0 0 1 1 -0.23568 29.52863 0.514107 2048 16 1 1 0.282987 -1 2 1 -1.92154 26.15693 0.310463 16 1 1 1 0.442808 -1 3 1 -6.6297 16.7406 0.002094 4 1 1 1 0.954236 -1 4 0 -7 . 0 1 1 1 1 1 -1 Convergence SUCCESS: Gradient Time: 0.0166666666627862 x = 1; y = -1; objVal = -7; iters = 4; gradient = [-8, 9]; hessian = [4 12, 12 0];
... View more