<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Getting Results from Minimize function in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Getting-Results-from-Minimize-function/m-p/227485#M45127</link>
    <description>&lt;P&gt;After the Minimize() returns, you could call the Get Log() function. The syntax is list = Get Log( &amp;lt; n &amp;gt; ). The result is a list of lines from the Log window. The optional integer argument allows you to select the first n lines (n positive) or the last n lines (n negative).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then you can examine the result of the convergence.&lt;/P&gt;</description>
    <pubDate>Fri, 27 Sep 2019 11:26:27 GMT</pubDate>
    <dc:creator>Mark_Bailey</dc:creator>
    <dc:date>2019-09-27T11:26:27Z</dc:date>
    <item>
      <title>Getting Results from Minimize function</title>
      <link>https://community.jmp.com/t5/Discussions/Getting-Results-from-Minimize-function/m-p/227399#M45119</link>
      <description>&lt;P&gt;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.&amp;nbsp; Is there a way to get those results from the script?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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.&amp;nbsp; Below is an example of the function and the results from a great post by Milo, from JMP.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.jmp.com/t5/JMPer-Cable/Minimize-and-Maximize-Functions-in-JSL/ba-p/36355" target="_blank"&gt;https://community.jmp.com/t5/JMPer-Cable/Minimize-and-Maximize-Functions-in-JSL/ba-p/36355&lt;/A&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;x = 0;
y = 0;
{objVal, iters, gradient, hessian} =
Minimize(
 ((2 * x ^ 2 + 12 * x * y - y * 3)),
 {x( -1, 1 ), y( -1, 1 )},
 &amp;lt;&amp;lt;maxIter( 200 ),
 &amp;lt;&amp;lt;tolerance( 10 ^ -6 ),
 &amp;lt;&amp;lt;ShowDetails( True ),
 //&amp;lt;&amp;lt;UseNumericDeriv( True ), /*rarely needed*/
 //&amp;lt;&amp;lt;Gradient({4*x+12*y, 12*x-3}), /*rarely needed*/
 //&amp;lt;&amp;lt;Hessian({{4,12},{0}}) /*rarely needed*/
);
Show( x, y, objVal, iters, gradient, hessian ); &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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.&amp;nbsp; Any suggestions would be appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;nParm=2 Newton ******************************************************&lt;/P&gt;&lt;P&gt;Iter nFree Objective RelGrad NormGrad2 Ridge nObj nGrad nHess Parm0 Parm1&lt;BR /&gt;0 2 0 0.125 0.5 0 1 1 1 0 0&lt;BR /&gt;1 1 -0.23568 29.52863 0.514107 2048 16 1 1 0.282987 -1&lt;BR /&gt;2 1 -1.92154 26.15693 0.310463 16 1 1 1 0.442808 -1&lt;BR /&gt;3 1 -6.6297 16.7406 0.002094 4 1 1 1 0.954236 -1&lt;BR /&gt;4 0 -7 . 0 1 1 1 1 1 -1&lt;BR /&gt;&lt;STRONG&gt;Convergence SUCCESS: Gradient&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Time: 0.0166666666627862&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;x = 1;&lt;BR /&gt;y = -1;&lt;BR /&gt;objVal = -7;&lt;BR /&gt;iters = 4;&lt;BR /&gt;gradient = [-8, 9];&lt;BR /&gt;hessian = [4 12, 12 0];&lt;/P&gt;</description>
      <pubDate>Thu, 26 Sep 2019 21:25:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Getting-Results-from-Minimize-function/m-p/227399#M45119</guid>
      <dc:creator>bfoulkes</dc:creator>
      <dc:date>2019-09-26T21:25:30Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Results from Minimize function</title>
      <link>https://community.jmp.com/t5/Discussions/Getting-Results-from-Minimize-function/m-p/227485#M45127</link>
      <description>&lt;P&gt;After the Minimize() returns, you could call the Get Log() function. The syntax is list = Get Log( &amp;lt; n &amp;gt; ). The result is a list of lines from the Log window. The optional integer argument allows you to select the first n lines (n positive) or the last n lines (n negative).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then you can examine the result of the convergence.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Sep 2019 11:26:27 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Getting-Results-from-Minimize-function/m-p/227485#M45127</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2019-09-27T11:26:27Z</dc:date>
    </item>
    <item>
      <title>Re: Getting Results from Minimize function</title>
      <link>https://community.jmp.com/t5/Discussions/Getting-Results-from-Minimize-function/m-p/227487#M45129</link>
      <description>&lt;P&gt;thank&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/5358"&gt;@Mark_Bailey&lt;/a&gt;&amp;nbsp; That is what i ended up doing.&amp;nbsp; I clear the log, then use get log() to grab the window and then cycle through to pull out the item with the term "convergence".&amp;nbsp; I am hoping there is a more direct way to get it though.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Sep 2019 11:56:19 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Getting-Results-from-Minimize-function/m-p/227487#M45129</guid>
      <dc:creator>bfoulkes</dc:creator>
      <dc:date>2019-09-27T11:56:19Z</dc:date>
    </item>
  </channel>
</rss>

