<?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: help in CALL NLPQN inside PROC IML in SAS/IML Software and Matrix Computations</title>
    <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/help-in-CALL-NLPQN-inside-PROC-IML/m-p/38651#M182</link>
    <description>You didn't give the error message, so I don't know which of the errors you might be referring to.  I see a few:&lt;BR /&gt;
(1) SAS/IML indexes vectors from 1, so the expression optn=j(0,11,.) is incorrect.&lt;BR /&gt;
(2) IML uses local variables in modules, so the variables estvar,col1,col2,col3, etc, are undefined within the modules. Maybe you intended to use a GLOBAL clause?</description>
    <pubDate>Sun, 27 Mar 2011 20:34:14 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2011-03-27T20:34:14Z</dc:date>
    <item>
      <title>help in CALL NLPQN inside PROC IML</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/help-in-CALL-NLPQN-inside-PROC-IML/m-p/38650#M181</link>
      <description>There is an error during running this code, can you help me to find the mistake?&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
proc iml; &lt;BR /&gt;
start fun(K); &lt;BR /&gt;
f =  sumf; &lt;BR /&gt;
sumf=0; &lt;BR /&gt;
do i = 1 to 3; &lt;BR /&gt;
sumf = sumf + (estvar*lambda&lt;I&gt;)+ (g&lt;I&gt;* k)**2  /(lambda&lt;I&gt;+  k)**2; &lt;BR /&gt;
end; &lt;BR /&gt;
return (f); &lt;BR /&gt;
finish  fun; &lt;BR /&gt;
start con(k); &lt;BR /&gt;
c=j(4,1,0); &lt;BR /&gt;
sumc1=0; &lt;BR /&gt;
do i = 1 to 3; &lt;BR /&gt;
sumc1 = sumc1 + (col1&lt;I&gt;**2 *lambda&lt;I&gt;/(lambda&lt;I&gt;+k)**2); &lt;BR /&gt;
end; &lt;BR /&gt;
c[1]= 10-sumc1; &lt;BR /&gt;
sumc2=0; &lt;BR /&gt;
do i= 1 to 3; &lt;BR /&gt;
sumc2 = sumc2 + (col2&lt;I&gt;**2 *lambda&lt;I&gt;/(lambda&lt;I&gt;+k)**2); &lt;BR /&gt;
end; &lt;BR /&gt;
c[2]= 10-sumc2; &lt;BR /&gt;
sumc3=0; &lt;BR /&gt;
do i= 1 to 3; &lt;BR /&gt;
sumc3 = sumc3 + (col3&lt;I&gt;**2 *lambda&lt;I&gt;/(lambda&lt;I&gt;+k)**2); &lt;BR /&gt;
end; &lt;BR /&gt;
c[3]= 10-sumc3; &lt;BR /&gt;
c[4]=(max(lambda)/min(lambda))-(max(lambda)+k)/(min(lambda)+k); &lt;BR /&gt;
return (c); &lt;BR /&gt;
finish con; &lt;BR /&gt;
k=j(1,1,0); &lt;BR /&gt;
optn=j(0,11,.); optn[1]=0; optn[2]=4; optn[4]=1; optn[6]=2; &lt;BR /&gt;
optn[11]=0; optn[10]=4; &lt;BR /&gt;
call nlpqn (rc, kres,  "fun", k, optn) nlc="con"; &lt;BR /&gt;
print k; &lt;BR /&gt;
&lt;BR /&gt;
where g,l,estvar,col1,col2,col3 are vectors &lt;BR /&gt;
and k is a decision variable&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;</description>
      <pubDate>Sat, 26 Mar 2011 19:39:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/help-in-CALL-NLPQN-inside-PROC-IML/m-p/38650#M181</guid>
      <dc:creator>aya123</dc:creator>
      <dc:date>2011-03-26T19:39:06Z</dc:date>
    </item>
    <item>
      <title>Re: help in CALL NLPQN inside PROC IML</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/help-in-CALL-NLPQN-inside-PROC-IML/m-p/38651#M182</link>
      <description>You didn't give the error message, so I don't know which of the errors you might be referring to.  I see a few:&lt;BR /&gt;
(1) SAS/IML indexes vectors from 1, so the expression optn=j(0,11,.) is incorrect.&lt;BR /&gt;
(2) IML uses local variables in modules, so the variables estvar,col1,col2,col3, etc, are undefined within the modules. Maybe you intended to use a GLOBAL clause?</description>
      <pubDate>Sun, 27 Mar 2011 20:34:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/help-in-CALL-NLPQN-inside-PROC-IML/m-p/38651#M182</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2011-03-27T20:34:14Z</dc:date>
    </item>
  </channel>
</rss>

