<?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: Matrices in SAS/IML Software and Matrix Computations</title>
    <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Matrices/m-p/141547#M1174</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;so instead of:&lt;/P&gt;&lt;P&gt;i = ( det(a) || det(b) || det(c) )[&amp;lt;:&amp;gt;]; &lt;BR /&gt;I should use:&lt;/P&gt;&lt;P&gt;i = loc(d=max(d));&amp;nbsp; This would give me the max det value or would this give me the matrix with max determinate?&amp;nbsp; &lt;BR /&gt;I want the print out the &lt;STRONG style="text-decoration: underline;"&gt;matrix (just the matrix)&lt;/STRONG&gt; with the max determinate. &lt;/P&gt;&lt;P&gt;Every thing is fine after the &lt;STRONG style="text-decoration: underline;"&gt;then do &lt;/STRONG&gt;statement. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 02 May 2014 18:05:35 GMT</pubDate>
    <dc:creator>arbongard</dc:creator>
    <dc:date>2014-05-02T18:05:35Z</dc:date>
    <item>
      <title>Matrices</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Matrices/m-p/141543#M1170</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How would I write a function module that will input 3 identical sized matrices (not knowing the size) and retunr the one that has the largest determinant.&amp;nbsp; The function should check that the matrices are square and all the same size. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 May 2014 02:21:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Matrices/m-p/141543#M1170</guid>
      <dc:creator>arbongard</dc:creator>
      <dc:date>2014-05-02T02:21:47Z</dc:date>
    </item>
    <item>
      <title>Re: Matrices</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Matrices/m-p/141544#M1171</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How about the following?&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;start maxdet(a, b, c);&lt;/P&gt;&lt;P&gt;&amp;nbsp; nr = nrow(a) || nrow(b) || nrow(c);&lt;/P&gt;&lt;P&gt;&amp;nbsp; nc = ncol(a) || ncol(b) || ncol(c);&lt;/P&gt;&lt;P&gt;&amp;nbsp; if all(nr=nc) &amp;amp; max(nr)=min(nr) then do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; i = ( det(a) || det(b) || det(c) )[&amp;lt;:&amp;gt;];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if i = 1 then return(a);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else if i = 2 then return(b);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else if i = 3 then return(c);&lt;/P&gt;&lt;P&gt;&amp;nbsp; end; else return(.);&lt;/P&gt;&lt;P&gt;finish;&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;Not sure why you want to do this.&amp;nbsp;&amp;nbsp; What if two matrices are tied for the largest determinant?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 May 2014 09:51:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Matrices/m-p/141544#M1171</guid>
      <dc:creator>IanWakeling</dc:creator>
      <dc:date>2014-05-02T09:51:31Z</dc:date>
    </item>
    <item>
      <title>Re: Matrices</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Matrices/m-p/141545#M1172</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to figure that out.&lt;/P&gt;&lt;P&gt;I think I would want to print both of them if they were tied to show that they had a tie. how would I do that? &lt;BR /&gt;also how would I make the matrix or matrices show up in the output log. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 May 2014 14:10:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Matrices/m-p/141545#M1172</guid>
      <dc:creator>arbongard</dc:creator>
      <dc:date>2014-05-02T14:10:05Z</dc:date>
    </item>
    <item>
      <title>Re: Matrices</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Matrices/m-p/141546#M1173</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you get the three determinants into a vector called d, then you could use syntax like&amp;nbsp; i = loc(d=max(d)) to get the index numbers of all determinants equal to the max.&amp;nbsp;&amp;nbsp; You could then adapt the if statements at the end along the lines of&amp;nbsp; if any( i =1) then print a;&amp;nbsp;&amp;nbsp; etc...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 May 2014 14:32:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Matrices/m-p/141546#M1173</guid>
      <dc:creator>IanWakeling</dc:creator>
      <dc:date>2014-05-02T14:32:05Z</dc:date>
    </item>
    <item>
      <title>Re: Matrices</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Matrices/m-p/141547#M1174</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;so instead of:&lt;/P&gt;&lt;P&gt;i = ( det(a) || det(b) || det(c) )[&amp;lt;:&amp;gt;]; &lt;BR /&gt;I should use:&lt;/P&gt;&lt;P&gt;i = loc(d=max(d));&amp;nbsp; This would give me the max det value or would this give me the matrix with max determinate?&amp;nbsp; &lt;BR /&gt;I want the print out the &lt;STRONG style="text-decoration: underline;"&gt;matrix (just the matrix)&lt;/STRONG&gt; with the max determinate. &lt;/P&gt;&lt;P&gt;Every thing is fine after the &lt;STRONG style="text-decoration: underline;"&gt;then do &lt;/STRONG&gt;statement. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 May 2014 18:05:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Matrices/m-p/141547#M1174</guid>
      <dc:creator>arbongard</dc:creator>
      <dc:date>2014-05-02T18:05:35Z</dc:date>
    </item>
    <item>
      <title>Re: Matrices</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Matrices/m-p/141548#M1175</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It will give you the index number of the matrix with the max determinant.&amp;nbsp; I suggest you look into the LOC() function as it has many uses.&amp;nbsp; Either look in the documentation or read Rick's excellent blog, he has written about LOC several times:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://blogs.sas.com/content/iml/2012/11/19/beware-the-naked-loc/" title="http://blogs.sas.com/content/iml/2012/11/19/beware-the-naked-loc/"&gt;Beware the naked LOC - The DO Loop&lt;/A&gt;&lt;/P&gt;&lt;P&gt; &lt;A href="http://blogs.sas.com/content/iml/2010/09/10/the-most-useful-function-youve-never-heard-of/" title="http://blogs.sas.com/content/iml/2010/09/10/the-most-useful-function-youve-never-heard-of/"&gt;LOC: The most useful function you&amp;amp;#8217;ve never heard of - The DO Loop&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I suggest you replace the old definition of i, with:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; d = det(a) || det(b) || det(c);&lt;BR /&gt;&amp;nbsp; i = loc( d = max(d));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note there is no nakedness here as the vector of three determinants (d) must have at least one element equal to the maximum.&amp;nbsp; You now need to think about handling ties. Most of the time 'i' will be a 1x1 matrix containing the number 1,2 or 3 of the matrix a,b or c with the max determinant.&amp;nbsp; But it might be a 1x2 or a 1x3 matrix of index numbers if there are ties.&amp;nbsp; You need to add code to handle these different conditions, perhaps print a warning message about the number of ties.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 03 May 2014 08:17:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Matrices/m-p/141548#M1175</guid>
      <dc:creator>IanWakeling</dc:creator>
      <dc:date>2014-05-03T08:17:14Z</dc:date>
    </item>
  </channel>
</rss>

