<?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: Question in SAS/IML Software and Matrix Computations</title>
    <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Question/m-p/137661#M1114</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you declare a 29x29 matrix then you can only reference individual elements within it by using the integers 1 to 29 as row or column subscript indices.&amp;nbsp;&amp;nbsp; You were trying to use -14 to +14 as the indices, so my suggestion was to shift it back to the correct range by adding 15.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 11 Jun 2014 11:43:47 GMT</pubDate>
    <dc:creator>IanWakeling</dc:creator>
    <dc:date>2014-06-11T11:43:47Z</dc:date>
    <item>
      <title>Question</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Question/m-p/137658#M1111</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The matrix r is (2*t-1)*(2*t-1) but is it empty..may you help me?&lt;/P&gt;&lt;P&gt;Besides, I need to start the do from a negative number is this o.k.??&lt;/P&gt;&lt;P&gt;This is the program:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc iml;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;t=15;&lt;/P&gt;&lt;P&gt;a=2*t;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;r=j(a-1,a-1,.);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; do i= (1-t) to (t-1);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; do j= (1-t) to (t-1);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; az1= -(j-i);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; az2= -(j-i);&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; bz1= -(j-i);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bz2= (j-i);&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; cz1= (j-i);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cz2= (j-i);&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; if j&amp;lt;0 then z1=az1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; z2=az2;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if j=0 then z1=bz1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; z2=bz2;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if j&amp;gt;0 then z1=cz1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; z2=cz2;&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; r[i,j]=probnorm(z2)-probnorm(z1);&lt;/P&gt;&lt;P&gt;&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; end;&lt;/P&gt;&lt;P&gt;print r;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;Waiting for your reply.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jun 2014 09:29:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Question/m-p/137658#M1111</guid>
      <dc:creator>J_m</dc:creator>
      <dc:date>2014-06-11T09:29:50Z</dc:date>
    </item>
    <item>
      <title>Re: Question</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Question/m-p/137659#M1112</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The program gives invalid subscript errors for the matrix r, since both i and j can be zero or negative.&amp;nbsp;&amp;nbsp; I suspect you need to change it to r[i+t, j+t] = ....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jun 2014 10:34:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Question/m-p/137659#M1112</guid>
      <dc:creator>IanWakeling</dc:creator>
      <dc:date>2014-06-11T10:34:41Z</dc:date>
    </item>
    <item>
      <title>Re: Question</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Question/m-p/137660#M1113</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your help.&lt;/P&gt;&lt;P&gt;I have just tried what you suggested. The matrix is now filled with numbers but they are not correct.&lt;/P&gt;&lt;P&gt;Why did you suggested putting (+t)?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jun 2014 11:25:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Question/m-p/137660#M1113</guid>
      <dc:creator>J_m</dc:creator>
      <dc:date>2014-06-11T11:25:01Z</dc:date>
    </item>
    <item>
      <title>Re: Question</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Question/m-p/137661#M1114</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you declare a 29x29 matrix then you can only reference individual elements within it by using the integers 1 to 29 as row or column subscript indices.&amp;nbsp;&amp;nbsp; You were trying to use -14 to +14 as the indices, so my suggestion was to shift it back to the correct range by adding 15.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jun 2014 11:43:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Question/m-p/137661#M1114</guid>
      <dc:creator>IanWakeling</dc:creator>
      <dc:date>2014-06-11T11:43:47Z</dc:date>
    </item>
    <item>
      <title>Re: Question</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Question/m-p/137662#M1115</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Since we don't know what numbers are correct, you need to tell us what you expect or give an example for t=3.&lt;/P&gt;&lt;P&gt;The correctness of the program depends on z2 and z1. You can check their correctness with the following:&lt;/P&gt;&lt;P&gt;1) Outside the&amp;nbsp; loop, allocate&lt;/P&gt;&lt;P&gt;Lower=j(a-1,a-1,.);&lt;/P&gt;&lt;P&gt;Upper=j(a-1,a-1,.);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) Within the loop, define&lt;/P&gt;&lt;P&gt; Lower[i+t,j+t] = z1;&lt;/P&gt;&lt;P&gt; Upper[i+t,j+t] = z2;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3) Print Lower and Upper after the loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BTW, since the normal CDF is effectively zero when z&amp;lt;-6 and is 1 when z&amp;gt;6, you can probably get by with a smaller value of t. In any case, switch from PROBNORM(z) to CDF("Normal",z), as suggested at the end of this article: &lt;A href="http://blogs.sas.com/content/iml/2013/07/10/stop-using-ranuni/" title="http://blogs.sas.com/content/iml/2013/07/10/stop-using-ranuni/"&gt; Six reasons you should stop using the RANUNI function to generate random numbers - The DO Loop&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 14 Jun 2014 10:39:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Question/m-p/137662#M1115</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2014-06-14T10:39:12Z</dc:date>
    </item>
  </channel>
</rss>

