<?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: Number of iterations in NLPNM suproutine in SAS/IML Software and Matrix Computations</title>
    <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Number-of-iterations-in-NLPNM-suproutine/m-p/160599#M1495</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i'm already tried to set tc[2]=10000 but nothing improved. Is the place of "tc" in the CALL line right or not?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 09 Dec 2013 19:48:50 GMT</pubDate>
    <dc:creator>RaniaMamdouh</dc:creator>
    <dc:date>2013-12-09T19:48:50Z</dc:date>
    <item>
      <title>Number of iterations in NLPNM suproutine</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Number-of-iterations-in-NLPNM-suproutine/m-p/160589#M1485</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all;&lt;/P&gt;&lt;P&gt;How can i increase the number of iterations in proc IML, NLPNMS subroutine?&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 30 Nov 2013 20:45:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Number-of-iterations-in-NLPNM-suproutine/m-p/160589#M1485</guid>
      <dc:creator>RaniaMamdouh</dc:creator>
      <dc:date>2013-11-30T20:45:25Z</dc:date>
    </item>
    <item>
      <title>Re: Number of iterations in NLPNM suproutine</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Number-of-iterations-in-NLPNM-suproutine/m-p/160590#M1486</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The doc for the termination criteria is here: &lt;A href="http://support.sas.com/documentation/cdl/en/imlug/66112/HTML/default/viewer.htm#imlug_nonlinearoptexpls_sect019.htm" title="http://support.sas.com/documentation/cdl/en/imlug/66112/HTML/default/viewer.htm#imlug_nonlinearoptexpls_sect019.htm"&gt;SAS/IML(R) 12.3 User's Guide&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="phrase AAkeyword"&gt;tc[1]&lt;/SPAN&gt; specifies the maximum number of iterations in the optimization process. To get, say, 5000 iterations, use the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tc = j(10,1,.); /* set all to default (missing) */&lt;/P&gt;&lt;P&gt;tc[1] = 5000;&amp;nbsp; /* override default maximum iterations */&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Dec 2013 13:38:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Number-of-iterations-in-NLPNM-suproutine/m-p/160590#M1486</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2013-12-02T13:38:45Z</dc:date>
    </item>
    <item>
      <title>Re: Number of iterations in NLPNM suproutine</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Number-of-iterations-in-NLPNM-suproutine/m-p/160591#M1487</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your reply&lt;/P&gt;&lt;P&gt;but when i apply your solution also i find the same following error &lt;/P&gt;&lt;P&gt;ERROR: NMSIMP Optimization cannot be completed.&lt;/P&gt;&lt;P&gt;ERROR: NMSIMP needs more than 1000 iterations or 3000 function calls.&lt;/P&gt;&lt;P&gt;what can i do in this proplem?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Dec 2013 20:36:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Number-of-iterations-in-NLPNM-suproutine/m-p/160591#M1487</guid>
      <dc:creator>RaniaMamdouh</dc:creator>
      <dc:date>2013-12-02T20:36:59Z</dc:date>
    </item>
    <item>
      <title>Re: Number of iterations in NLPNM suproutine</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Number-of-iterations-in-NLPNM-suproutine/m-p/160592#M1488</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Looks like you need to increase the second control parameter, the maximum number of function calls, i.e.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tc[2] = 10000;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Dec 2013 20:52:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Number-of-iterations-in-NLPNM-suproutine/m-p/160592#M1488</guid>
      <dc:creator>Hutch_sas</dc:creator>
      <dc:date>2013-12-02T20:52:30Z</dc:date>
    </item>
    <item>
      <title>Re: Number of iterations in NLPNM suproutine</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Number-of-iterations-in-NLPNM-suproutine/m-p/160593#M1489</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That is a difficult question to answer, as many books and papers have been written on the topic. A few things to try:&lt;/P&gt;&lt;P&gt;1) Look at the return code to see why it is failing.&lt;/P&gt;&lt;P&gt;2) Look at the iteration history to see whether the optimization is jumping around, diverging to infinity, stuck in a valley/ridge, or some other situation.&lt;/P&gt;&lt;P&gt;3) Try a better initial guess.&lt;/P&gt;&lt;P&gt;4) Relax some of the convergence criteria. If the objective function is flat (see #1 and #2), you might not be able to converge by using the default values.&lt;/P&gt;&lt;P&gt;5) Try a different algorithm.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Dec 2013 20:54:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Number-of-iterations-in-NLPNM-suproutine/m-p/160593#M1489</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2013-12-02T20:54:58Z</dc:date>
    </item>
    <item>
      <title>Re: Number of iterations in NLPNM suproutine</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Number-of-iterations-in-NLPNM-suproutine/m-p/160594#M1490</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried these things, but i think that the problem can be in writing the routine. I will briefly describe my problem, i minimize the "cost" and i have 4 linear constrains on "x's" and three non-linear constrains on&amp;nbsp; (arl), and this is the last part of my program which i think that something wrong in it:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tc = j(10,1,.); /* set all to default (missing) */&lt;/P&gt;&lt;P&gt;tc[1] = 5000;&amp;nbsp; /* override default maximum iterations */&lt;/P&gt;&lt;P&gt;con = { 0.&amp;nbsp;&amp;nbsp; 0.&amp;nbsp;&amp;nbsp; 0.&amp;nbsp; 1.,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1.&amp;nbsp;&amp;nbsp; .&amp;nbsp;&amp;nbsp;&amp;nbsp; .&amp;nbsp;&amp;nbsp; 20.};&lt;/P&gt;&lt;P&gt;x={0.1&amp;nbsp; 0.7&amp;nbsp; 3.5&amp;nbsp; 2};&lt;/P&gt;&lt;P&gt;optn= j(1,11,.);optn[1]=0;optn[2]= 5;optn[10]=3;optn[11]=0; &lt;/P&gt;&lt;P&gt;CALL nlpnms(rc,xres,"Cost",x,optn,con,tc) nlc="arl";&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please tell me if there is wrong.&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 08 Dec 2013 21:00:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Number-of-iterations-in-NLPNM-suproutine/m-p/160594#M1490</guid>
      <dc:creator>RaniaMamdouh</dc:creator>
      <dc:date>2013-12-08T21:00:24Z</dc:date>
    </item>
    <item>
      <title>Re: Number of iterations in NLPNM suproutine</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Number-of-iterations-in-NLPNM-suproutine/m-p/160595#M1491</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't see any linear constraints for x.&amp;nbsp; All I see are ranges.&amp;nbsp; You need four additional rows for the CON matrix.&amp;nbsp; See &lt;A href="http://support.sas.com/documentation/cdl/en/imlug/66112/HTML/default/viewer.htm#imlug_nonlinearoptexpls_sect015.htm" title="http://support.sas.com/documentation/cdl/en/imlug/66112/HTML/default/viewer.htm#imlug_nonlinearoptexpls_sect015.htm"&gt;SAS/IML(R) 12.3 User's Guide&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Dec 2013 16:21:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Number-of-iterations-in-NLPNM-suproutine/m-p/160595#M1491</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2013-12-09T16:21:39Z</dc:date>
    </item>
    <item>
      <title>Re: Number of iterations in NLPNM suproutine</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Number-of-iterations-in-NLPNM-suproutine/m-p/160596#M1492</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yes, i mean that ranges for x's not linear constrains. Is there any other wrong?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Dec 2013 17:23:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Number-of-iterations-in-NLPNM-suproutine/m-p/160596#M1492</guid>
      <dc:creator>RaniaMamdouh</dc:creator>
      <dc:date>2013-12-09T17:23:05Z</dc:date>
    </item>
    <item>
      <title>Re: Number of iterations in NLPNM suproutine</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Number-of-iterations-in-NLPNM-suproutine/m-p/160597#M1493</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You might try overriding the second termination criteria, set tc[2] = 10000 and see if that affects your results. it appears that&amp;nbsp; you are running up against a limit on objective function calls.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Dec 2013 17:44:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Number-of-iterations-in-NLPNM-suproutine/m-p/160597#M1493</guid>
      <dc:creator>Hutch_sas</dc:creator>
      <dc:date>2013-12-09T17:44:27Z</dc:date>
    </item>
    <item>
      <title>Re: Number of iterations in NLPNM suproutine</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Number-of-iterations-in-NLPNM-suproutine/m-p/160598#M1494</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you show the ARL module for nonlinear contstraints?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Dec 2013 17:50:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Number-of-iterations-in-NLPNM-suproutine/m-p/160598#M1494</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2013-12-09T17:50:25Z</dc:date>
    </item>
    <item>
      <title>Re: Number of iterations in NLPNM suproutine</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Number-of-iterations-in-NLPNM-suproutine/m-p/160599#M1495</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i'm already tried to set tc[2]=10000 but nothing improved. Is the place of "tc" in the CALL line right or not?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Dec 2013 19:48:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Number-of-iterations-in-NLPNM-suproutine/m-p/160599#M1495</guid>
      <dc:creator>RaniaMamdouh</dc:creator>
      <dc:date>2013-12-09T19:48:50Z</dc:date>
    </item>
    <item>
      <title>Re: Number of iterations in NLPNM suproutine</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Number-of-iterations-in-NLPNM-suproutine/m-p/160600#M1496</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yes sure; it's as follows:&lt;/P&gt;&lt;P&gt;start arl(x);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bb0=j(3,1,0.);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; m=100;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; shift=0;&lt;/P&gt;&lt;P&gt;* L is ucl;&lt;/P&gt;&lt;P&gt;*x[1] is lamda, x[2] is L, x[3] is k;&lt;/P&gt;&lt;P&gt;* t is number of regions;&lt;/P&gt;&lt;P&gt;t=2*m+1;&lt;/P&gt;&lt;P&gt;* delta is width of each region;&lt;/P&gt;&lt;P&gt;delta=2*x[2]/t;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*now we are constructing the vector z;&lt;/P&gt;&lt;P&gt;*vector z represents different locations for the chart statistics;&lt;/P&gt;&lt;P&gt;*these are the midpoints of the t intervals;&lt;/P&gt;&lt;P&gt;z=-x[2]+.5*delta;&lt;/P&gt;&lt;P&gt;do i=2 to t;&lt;/P&gt;&lt;P&gt;k=-x[2]+(i-.5)*delta;&lt;/P&gt;&lt;P&gt;z=z//k;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;* now we are calculating the incontrol transitional probability matrix r;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; do i=1 to t;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; zz=0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; do j=1 to t;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tau1=z[j, ]+(delta/2)-z[i, ];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tau2=z[j, ]-(delta/2)-z[i, ];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if tau1&amp;lt;-(x[1]*x[3]) then fun1=tau1-(1-x[1])*x[3];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;if abs(tau1)&amp;lt;=(x[1]*x[3])then fun1=tau1/x[1];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;if tau1&amp;gt;(x[1]*x[3]) then fun1=tau1+(1-x[1])*x[3];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if tau2&amp;lt;-(x[1]*x[3]) then fun2=tau2-(1-x[1])*x[3];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;if abs(tau2)&amp;lt;=(x[1]*x[3])then fun2=tau2/x[1];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;if tau2&amp;gt;(x[1]*x[3]) then fun2=tau2+(1-x[1])*x[3];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; kone=z[i,]+fun1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ktwo=z[i,]+fun2;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pij=probnorm(kone-shift)-probnorm(ktwo-shift);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; zz=zz//pij;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if i=1 then r=zz;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; r=r||zz;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; v=j(t,1,0);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; v[((t+1)/2), ]=1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; v=t(v);&lt;/P&gt;&lt;P&gt;r=r[2:t+1,];&lt;/P&gt;&lt;P&gt;* now matrix r is t*t with the row of all zeros removed;&lt;/P&gt;&lt;P&gt;r=t(r);&lt;/P&gt;&lt;P&gt;*j(t,1,1) is tx1 vector of the value 1;&lt;/P&gt;&lt;P&gt;arl=inv((I(t)-r))*j(t,1,1);&lt;/P&gt;&lt;P&gt;arl0=v*arl;&lt;/P&gt;&lt;P&gt;bb0[1]=arl0-500;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;m=100;&lt;/P&gt;&lt;P&gt;shift=1;&lt;/P&gt;&lt;P&gt;* L is ucl;&lt;/P&gt;&lt;P&gt;*x[1] is lamda, x[2] is L, x[3] is k;&lt;/P&gt;&lt;P&gt;* t is number of regions;&lt;/P&gt;&lt;P&gt;t=2*m+1;&lt;/P&gt;&lt;P&gt;* delta is width of each region;&lt;/P&gt;&lt;P&gt;delta=2*x[2]/t;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*now we are constructing the vector z;&lt;/P&gt;&lt;P&gt;*vector z represents different locations for the chart statistics;&lt;/P&gt;&lt;P&gt;*these are the midpoints of the t intervals;&lt;/P&gt;&lt;P&gt;z=-x[2]+.5*delta;&lt;/P&gt;&lt;P&gt;do i=2 to t;&lt;/P&gt;&lt;P&gt;k=-x[2]+(i-.5)*delta;&lt;/P&gt;&lt;P&gt;z=z//k;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;* now we are calculating the incontrol transitional probability matrix r;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; do i=1 to t;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; zz=0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; do j=1 to t;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tau1=z[j, ]+(delta/2)-z[i, ];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tau2=z[j, ]-(delta/2)-z[i, ];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if tau1&amp;lt;-(x[1]*x[3]) then fun1=tau1-(1-x[1])*x[3];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;if abs(tau1)&amp;lt;=(x[1]*x[3])then fun1=tau1/x[1];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;if tau1&amp;gt;(x[1]*x[3]) then fun1=tau1+(1-x[1])*x[3];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if tau2&amp;lt;-(x[1]*x[3]) then fun2=tau2-(1-x[1])*x[3];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;if abs(tau2)&amp;lt;=(x[1]*x[3])then fun2=tau2/x[1];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;if tau2&amp;gt;(x[1]*x[3]) then fun2=tau2+(1-x[1])*x[3];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; kone=z[i,]+fun1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ktwo=z[i,]+fun2;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pij=probnorm(kone-shift)-probnorm(ktwo-shift);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; zz=zz//pij;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if i=1 then r=zz;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; r=r||zz;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; v=j(t,1,0);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; v[((t+1)/2), ]=1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; v=t(v);&lt;/P&gt;&lt;P&gt;r=r[2:t+1,];&lt;/P&gt;&lt;P&gt;* now matrix r is t*t with the row of all zeros removed;&lt;/P&gt;&lt;P&gt;r=t(r);&lt;/P&gt;&lt;P&gt;*j(t,1,1) is tx1 vector of the value 1;&lt;/P&gt;&lt;P&gt;arl=inv((I(t)-r))*j(t,1,1);&lt;/P&gt;&lt;P&gt;arl1=v*arl;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bb0[2]=12-arl1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;m=100;&lt;/P&gt;&lt;P&gt;shift=0;&lt;/P&gt;&lt;P&gt;* L is ucl;&lt;/P&gt;&lt;P&gt;*x[1] is lamda, x[2] is L, x[3] is k, x[4] is n;&lt;/P&gt;&lt;P&gt;* t is number of regions;&lt;/P&gt;&lt;P&gt;t=2*m+1;&lt;/P&gt;&lt;P&gt;* delta is width of each region;&lt;/P&gt;&lt;P&gt;delta=2*x[2]/t;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*now we are constructing the vector z;&lt;/P&gt;&lt;P&gt;*vector z represents different locations for the chart statistics;&lt;/P&gt;&lt;P&gt;*these are the midpoints of the t intervals;&lt;/P&gt;&lt;P&gt;z=-x[2]+.5*delta;&lt;/P&gt;&lt;P&gt;do i=2 to t;&lt;/P&gt;&lt;P&gt;k=-x[2]+(i-.5)*delta;&lt;/P&gt;&lt;P&gt;z=z//k;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;* now we are calculating the incontrol transitional probability matrix r;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; do i=1 to t;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; zz=0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; do j=1 to t;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tau1=z[j, ]+(delta/2)-z[i, ];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tau2=z[j, ]-(delta/2)-z[i, ];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if tau1&amp;lt;-(x[1]*x[3]) then fun1=tau1-(1-x[1])*x[3];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;if abs(tau1)&amp;lt;=(x[1]*x[3])then fun1=tau1/x[1];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;if tau1&amp;gt;(x[1]*x[3]) then fun1=tau1+(1-x[1])*x[3];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if tau2&amp;lt;-(x[1]*x[3]) then fun2=tau2-(1-x[1])*x[3];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;if abs(tau2)&amp;lt;=(x[1]*x[3])then fun2=tau2/x[1];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;if tau2&amp;gt;(x[1]*x[3]) then fun2=tau2+(1-x[1])*x[3];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; kone=z[i,]+fun1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ktwo=z[i,]+fun2;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pij=probnorm(kone-shift)-probnorm(ktwo-shift);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; zz=zz//pij;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if i=1 then r=zz;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; r=r||zz;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; v=j(t,1,0);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; v[((t+1)/2), ]=1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; v=t(v);&lt;/P&gt;&lt;P&gt;r=r[2:t+1,];&lt;/P&gt;&lt;P&gt;* now matrix r is t*t with the row of all zeros removed;&lt;/P&gt;&lt;P&gt;r=t(r);&lt;/P&gt;&lt;P&gt;*j(t,1,1) is tx1 vector of the value 1;&lt;/P&gt;&lt;P&gt;arl=inv((I(t)-r))*j(t,1,1);&lt;/P&gt;&lt;P&gt;arl0=v*arl;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;m=100;&lt;/P&gt;&lt;P&gt;shift=4;&lt;/P&gt;&lt;P&gt;* L is ucl;&lt;/P&gt;&lt;P&gt;*x[1] is lamda, x[2] is L, x[3] is k;&lt;/P&gt;&lt;P&gt;* t is number of regions;&lt;/P&gt;&lt;P&gt;t=2*m+1;&lt;/P&gt;&lt;P&gt;* delta is width of each region;&lt;/P&gt;&lt;P&gt;delta=2*x[2]/t;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*now we are constructing the vector z;&lt;/P&gt;&lt;P&gt;*vector z represents different locations for the chart statistics;&lt;/P&gt;&lt;P&gt;*these are the midpoints of the t intervals;&lt;/P&gt;&lt;P&gt;z=-x[2]+.5*delta;&lt;/P&gt;&lt;P&gt;do i=2 to t;&lt;/P&gt;&lt;P&gt;k=-x[2]+(i-.5)*delta;&lt;/P&gt;&lt;P&gt;z=z//k;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;* now we are calculating the incontrol transitional probability matrix r;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; do i=1 to t;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; zz=0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; do j=1 to t;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tau1=z[j, ]+(delta/2)-z[i, ];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tau2=z[j, ]-(delta/2)-z[i, ];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if tau1&amp;lt;-(x[1]*x[3]) then fun1=tau1-(1-x[1])*x[3];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;if abs(tau1)&amp;lt;=(x[1]*x[3])then fun1=tau1/x[1];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;if tau1&amp;gt;(x[1]*x[3]) then fun1=tau1+(1-x[1])*x[3];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if tau2&amp;lt;-(x[1]*x[3]) then fun2=tau2-(1-x[1])*x[3];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;if abs(tau2)&amp;lt;=(x[1]*x[3])then fun2=tau2/x[1];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;if tau2&amp;gt;(x[1]*x[3]) then fun2=tau2+(1-x[1])*x[3];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; kone=z[i,]+fun1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ktwo=z[i,]+fun2;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pij=probnorm(kone-shift)-probnorm(ktwo-shift);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; zz=zz//pij;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if i=1 then r=zz;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; r=r||zz;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; v=j(t,1,0);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; v[((t+1)/2), ]=1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; v=t(v);&lt;/P&gt;&lt;P&gt;r=r[2:t+1,];&lt;/P&gt;&lt;P&gt;* now matrix r is t*t with the row of all zeros removed;&lt;/P&gt;&lt;P&gt;r=t(r);&lt;/P&gt;&lt;P&gt;*j(t,1,1) is tx1 vector of the value 1;&lt;/P&gt;&lt;P&gt;arl=inv((I(t)-r))*j(t,1,1);&lt;/P&gt;&lt;P&gt;arl1=v*arl;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;c0=10;&lt;/P&gt;&lt;P&gt;c1=100;&lt;/P&gt;&lt;P&gt;gam1=1;&lt;/P&gt;&lt;P&gt;gam2=1;&lt;/P&gt;&lt;P&gt;O=0.01;&lt;/P&gt;&lt;P&gt;W=25;&lt;/P&gt;&lt;P&gt;a=0.5;&lt;/P&gt;&lt;P&gt;b=0.1;&lt;/P&gt;&lt;P&gt;F=50;&lt;/P&gt;&lt;P&gt;E=0.05;&lt;/P&gt;&lt;P&gt;T0=0;&lt;/P&gt;&lt;P&gt;T1=2;&lt;/P&gt;&lt;P&gt;T2=0;&lt;/P&gt;&lt;P&gt;h4=(x[4]*E)+(gam1*T1)+(gam2*(T2**2));&lt;/P&gt;&lt;P&gt;h1=((arl1-0.5)*(O*(F+(c1*T0*(gam1-1)))-(2*arl0*(c0+O*(((arl1-0.5)*a)+((arl1-0.5)*b*x[4])+W)+(c1*(-1+h4*O-O*((x[4]*E)+T1+T2)))))))/(2*O*arl0);&lt;/P&gt;&lt;P&gt;h2=((-2*(arl1-0.5)*(F+(c1*T0*(gam1-1))+(arl0*(a+(b*x[4]))*(1+(h4*O))))))/(O*arl0);&lt;/P&gt;&lt;P&gt;h3=(-1/(2*(O**2)*arl0))*((2*F)+(2*c0*T0*(gam1-1))-(a*T0*O)-(2*(arl1-0.5)*a*T0*O)-(2*c1*h4*T0*O)-(b*x[4]*T0*O)-(2*(arl1-0.5)*b*x[4]*T0*O)-(2*T0*W*O)+(2*F*O*((x[4]*E)+T1+T2))+(a*T0*gam1*O)+(2*(arl1-0.5)*a*T0*gam1*O)+(2*c1*h4*T0*gam1*O)+(b*x[4]*T0*gam1*O)+(2*(arl1-0.5)*b*x[4]*T0*gam1*O)+(2*T0*W*gam1*O)-(a*h4*T0*(O**2))-(b*x[4]*h4*T0*(O**2))+(a*h4*T0*gam1*(O**2))+(a*x[4]*h4*T0*gam1*(O**2))+(2*arl0*(a+b*x[4])*(1+h4*O)*(1+O*((x[4]*E)+T1+T2))));&lt;/P&gt;&lt;P&gt;h=(-h2+SQRT((h2**2)-(4*h1*h3)))/(2*h1);&lt;/P&gt;&lt;P&gt;s=(1/(O*h))-0.5;&lt;/P&gt;&lt;P&gt;r1=(c0/O)+(c1*((x[4]*E)+(h*(arl1-0.5))+(gam1*T1)+(gam2*T2))+((s*F)/arl0)+W);&lt;/P&gt;&lt;P&gt;r2=((a+(b*x[4]))/h)*((1/O)+(x[4]*E)+(h*(arl1-0.5))+(gam1*T1)+(gam2*T2));&lt;/P&gt;&lt;P&gt;r3=(1/O)+((1-gam1)*s*T0)/arl0+(x[4]*E)+(h*(arl1-0.5))+T1+T2;&lt;/P&gt;&lt;P&gt;C2=(r1+r2)/r3;&lt;/P&gt;&lt;P&gt;print C2;&lt;/P&gt;&lt;P&gt;bb0[3]=(1.005*13.355)-C2;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return (bb0);&lt;/P&gt;&lt;P&gt;finish arl;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Dec 2013 19:52:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Number-of-iterations-in-NLPNM-suproutine/m-p/160600#M1496</guid>
      <dc:creator>RaniaMamdouh</dc:creator>
      <dc:date>2013-12-09T19:52:31Z</dc:date>
    </item>
    <item>
      <title>Re: Number of iterations in NLPNM suproutine</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Number-of-iterations-in-NLPNM-suproutine/m-p/160601#M1497</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ugh. Too complicated. I don't see how to verify that the ARL module is correct.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you solve the unconstrained problem? What about with only the first or only the first 2 constraints?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Dec 2013 20:46:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Number-of-iterations-in-NLPNM-suproutine/m-p/160601#M1497</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2013-12-09T20:46:07Z</dc:date>
    </item>
    <item>
      <title>Re: Number of iterations in NLPNM suproutine</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Number-of-iterations-in-NLPNM-suproutine/m-p/160602#M1498</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if i put only the third constrain i can face the same problem, i.e. the problem isn't in the number of constrains?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Dec 2013 18:01:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Number-of-iterations-in-NLPNM-suproutine/m-p/160602#M1498</guid>
      <dc:creator>RaniaMamdouh</dc:creator>
      <dc:date>2013-12-10T18:01:39Z</dc:date>
    </item>
    <item>
      <title>Re: Number of iterations in NLPNM suproutine</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Number-of-iterations-in-NLPNM-suproutine/m-p/160603#M1499</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is it possible that the problem is in the (very complicated) nonlinear constraints? Can you show that there is a feasible solution that satisfies the constraints? If not, you will encounter this kind of non-convergence.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To give a simple example, the problem min F(x,y) s.t. y&amp;gt; -x^2 and y&amp;gt;x^2 +1 has no solution because no (x,y) pair is feasible.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Dec 2013 18:19:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Number-of-iterations-in-NLPNM-suproutine/m-p/160603#M1499</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2013-12-10T18:19:32Z</dc:date>
    </item>
    <item>
      <title>Re: Number of iterations in NLPNM suproutine</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Number-of-iterations-in-NLPNM-suproutine/m-p/160604#M1500</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN class="short_text" id="result_box" lang="en"&gt;&lt;SPAN class="hps"&gt;I'm sorry&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;for the delay&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;in&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;reply&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;because I&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;have seen your comment&lt;/SPAN&gt; &lt;SPAN class="hps alt-edited"&gt;immediately.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="short_text" id="result_box" lang="en"&gt;&lt;SPAN class="hps alt-edited"&gt;yes, there is a feasible solution satisfies the non-linear constrains. Is the place of "tc" in the CALL line right or not?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="short_text" lang="en"&gt;&lt;SPAN class="hps alt-edited"&gt;thanks&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Dec 2013 17:38:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Number-of-iterations-in-NLPNM-suproutine/m-p/160604#M1500</guid>
      <dc:creator>RaniaMamdouh</dc:creator>
      <dc:date>2013-12-26T17:38:54Z</dc:date>
    </item>
    <item>
      <title>Re: Number of iterations in NLPNM suproutine</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Number-of-iterations-in-NLPNM-suproutine/m-p/160605#M1501</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1) Give us a feasible solution&lt;/P&gt;&lt;P&gt;2) Yes, the tc arg is in the right place, but you can always use the alternative keyword-pair" syntax when in doubt:&lt;/P&gt;&lt;P&gt;CALL nlpnms(...) tc=tc&amp;nbsp; nlc="arl";&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Dec 2013 13:13:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Number-of-iterations-in-NLPNM-suproutine/m-p/160605#M1501</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2013-12-28T13:13:44Z</dc:date>
    </item>
    <item>
      <title>Re: Number of iterations in NLPNM suproutine</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Number-of-iterations-in-NLPNM-suproutine/m-p/160606#M1502</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A feasible solution is : Cost= 17.058 at n=1, h=0.28238, &lt;SPAN style="font-size: 9.0pt; font-family: 'Cambria Math','serif';"&gt;&amp;nbsp; &lt;SPAN style="font-size: 9.0pt; font-family: 'Cambria Math','serif';"&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 9.0pt; font-family: 'Cambria Math','serif';"&gt;Lammda &lt;/SPAN&gt; &lt;/SPAN&gt;=0.13199, , L=0.82698, K=2.858&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Dec 2013 17:03:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Number-of-iterations-in-NLPNM-suproutine/m-p/160606#M1502</guid>
      <dc:creator>RaniaMamdouh</dc:creator>
      <dc:date>2013-12-28T17:03:49Z</dc:date>
    </item>
  </channel>
</rss>

