<?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: Limiting range of variables in a function in SAS/IML Software and Matrix Computations</title>
    <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Limiting-range-of-variables-in-a-function/m-p/158181#M1452</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If I understand your quetion, there are several ways to accomplish what you are asking. The method to choose depends on whether you want to modify the computation of ue and le, or just the sums.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here are some functions that are good to know about:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/imlug/66845/HTML/default/viewer.htm#imlug_langref_sect371.htm"&gt;The REMOVE function&lt;/A&gt;.&amp;nbsp;&amp;nbsp; You can use this function if you want to remove certain elements from temp1. For example, the zero always occurs at the x_th position, so the following statement modifies temp1 so that it contains m-1 elements:&lt;BR /&gt;temp1=remove(x-i,x);&amp;nbsp; /* exclude 0 from elements */&lt;/LI&gt;&lt;LI&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/imlug/66845/HTML/default/viewer.htm#imlug_langref_sect232.htm"&gt;The LOC function:&lt;/A&gt;&amp;nbsp; Although it is not necessary here, you might need to find the indices of the elements tot satisfy some criterion before you can remove them. The LOC function enables you to find the elements. For details, see &lt;A href="http://blogs.sas.com/content/iml/2011/05/16/finding-data-that-satisfy-a-criterion/" title="http://blogs.sas.com/content/iml/2011/05/16/finding-data-that-satisfy-a-criterion/"&gt; Finding data that satisfy a criterion - The DO Loop&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I think the REMOVE function is all you need here.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 27 Jun 2014 14:09:02 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2014-06-27T14:09:02Z</dc:date>
    <item>
      <title>Limiting range of variables in a function</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Limiting-range-of-variables-in-a-function/m-p/158180#M1451</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I would like to make such a version of this function 'mhatx1' which omits x=i from the sum i.e. computes t4&lt;X&gt; where x is not equal to i. Is there some way to use logical operators in this case? Something like temp1=x-i where x-i is not equal to 0, else . ?&lt;/X&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;start mhatx1(m,p,h,pi,e);&lt;/P&gt;&lt;P&gt;t4=j(m,1);&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;do x=1 to nrow(p);&lt;/P&gt;&lt;P&gt;i=T(1:m);&lt;/P&gt;&lt;P&gt;temp1=x-i;&lt;/P&gt;&lt;P&gt;ue=Kmod(temp1,h,pi,e)#p&lt;I&gt;;&lt;/I&gt;&lt;/P&gt;&lt;P&gt;le=Kmod(temp1,h,pi,e);&lt;/P&gt;&lt;P&gt;t4&lt;X&gt;=sum(ue)/sum(le);&lt;/X&gt;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;return (t4);&lt;/P&gt;&lt;P&gt;finish;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jun 2014 12:10:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Limiting-range-of-variables-in-a-function/m-p/158180#M1451</guid>
      <dc:creator>LauriN</dc:creator>
      <dc:date>2014-06-27T12:10:37Z</dc:date>
    </item>
    <item>
      <title>Re: Limiting range of variables in a function</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Limiting-range-of-variables-in-a-function/m-p/158181#M1452</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If I understand your quetion, there are several ways to accomplish what you are asking. The method to choose depends on whether you want to modify the computation of ue and le, or just the sums.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here are some functions that are good to know about:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/imlug/66845/HTML/default/viewer.htm#imlug_langref_sect371.htm"&gt;The REMOVE function&lt;/A&gt;.&amp;nbsp;&amp;nbsp; You can use this function if you want to remove certain elements from temp1. For example, the zero always occurs at the x_th position, so the following statement modifies temp1 so that it contains m-1 elements:&lt;BR /&gt;temp1=remove(x-i,x);&amp;nbsp; /* exclude 0 from elements */&lt;/LI&gt;&lt;LI&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/imlug/66845/HTML/default/viewer.htm#imlug_langref_sect232.htm"&gt;The LOC function:&lt;/A&gt;&amp;nbsp; Although it is not necessary here, you might need to find the indices of the elements tot satisfy some criterion before you can remove them. The LOC function enables you to find the elements. For details, see &lt;A href="http://blogs.sas.com/content/iml/2011/05/16/finding-data-that-satisfy-a-criterion/" title="http://blogs.sas.com/content/iml/2011/05/16/finding-data-that-satisfy-a-criterion/"&gt; Finding data that satisfy a criterion - The DO Loop&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I think the REMOVE function is all you need here.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jun 2014 14:09:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Limiting-range-of-variables-in-a-function/m-p/158181#M1452</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2014-06-27T14:09:02Z</dc:date>
    </item>
    <item>
      <title>Re: Limiting range of variables in a function</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Limiting-range-of-variables-in-a-function/m-p/158182#M1453</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you! That REMOVE was what I was looking for, even though I just ended up removing t'th solutions of the inner functions ue and le from summations:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;start mhatx2(m,p,h,pi,e);&lt;/P&gt;&lt;P&gt;t5=j(m,1);&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;do x=1 to nrow(p);&lt;/P&gt;&lt;P&gt;i=T(1:m);&lt;/P&gt;&lt;P&gt;temp1=x-i;&lt;/P&gt;&lt;P&gt;ue=Kmod(temp1,h,pi,e)#p&lt;I&gt;;&lt;/I&gt;&lt;/P&gt;&lt;P&gt;le=Kmod(temp1,h,pi,e);&lt;/P&gt;&lt;P&gt;t5&lt;X&gt;=(sum(ue)-ue&lt;X&gt;)/(sum(le)-le&lt;X&gt;);&lt;/X&gt;&lt;/X&gt;&lt;/X&gt;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;return (t5);&lt;/P&gt;&lt;P&gt;finish;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 29 Jun 2014 13:55:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Limiting-range-of-variables-in-a-function/m-p/158182#M1453</guid>
      <dc:creator>LauriN</dc:creator>
      <dc:date>2014-06-29T13:55:28Z</dc:date>
    </item>
  </channel>
</rss>

