<?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: IML SVD sensitivities in SAS/IML Software and Matrix Computations</title>
    <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/IML-SVD-sensitivities/m-p/200744#M2070</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, thanks again.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Jul 2015 20:02:48 GMT</pubDate>
    <dc:creator>xtc283x</dc:creator>
    <dc:date>2015-07-12T20:02:48Z</dc:date>
    <item>
      <title>IML SVD sensitivities</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/IML-SVD-sensitivities/m-p/200740#M2066</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How sensitive is SAS/IML to two things:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Extreme values or outliers in the data -- does this influence the eigenvalues?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Very large, high dimensional data -- how much slower is the routine?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any insights into these questions would be most appreciated.sas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Jul 2015 13:35:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/IML-SVD-sensitivities/m-p/200740#M2066</guid>
      <dc:creator>xtc283x</dc:creator>
      <dc:date>2015-07-12T13:35:49Z</dc:date>
    </item>
    <item>
      <title>Re: IML SVD sensitivities</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/IML-SVD-sensitivities/m-p/200741#M2067</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The SVD on X (or, similarly, a principal component analysis on X`X) is a least-squarse technique, and consequently influenced by outliers just as OLS regression is.&amp;nbsp; You can use the MCD routine to create a ROBUST prinicipal component analysis, as shown in &lt;A href="https://support.sas.com/resources/papers/proceedings10/329-2010.pdf"&gt;Wicklin 2010.&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The SVD and eigenvalue routines can be computationally expensive.&amp;nbsp; You can use the techniques shown in the article &lt;A href="http://blogs.sas.com/content/iml/2012/05/09/the-power-method.html"&gt;"The Power Method"&lt;/A&gt; to time the computations for various size inputs.&amp;nbsp; The article shows a graph for the eigenvalue computations on square NxN matrices.&amp;nbsp; The time increases superlinearly. Run the program on your hardware to get estimates that are customerized to your configuration.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Jul 2015 17:18:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/IML-SVD-sensitivities/m-p/200741#M2067</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2015-07-12T17:18:05Z</dc:date>
    </item>
    <item>
      <title>Re: IML SVD sensitivities</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/IML-SVD-sensitivities/m-p/200742#M2068</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rick-&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; That's fantastic. Thank you! &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; I just have one more question: there's an approach to PCA that leverages the Lanczos algorithm as described here (&lt;A href="https://en.wikipedia.org/wiki/Lanczos_algorithm" title="https://en.wikipedia.org/wiki/Lanczos_algorithm"&gt;https://en.wikipedia.org/wiki/Lanczos_algorithm&lt;/A&gt; ) with the complete method described here ( &lt;A href="http://arxiv.org/abs/1412.6506" title="http://arxiv.org/abs/1412.6506"&gt;[1412.6506] Cauchy Principal Component Analysis&lt;/A&gt; ). &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Any chance the Lanczos algorithm has a pre-existing routine or module in SAS/IML?&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Jul 2015 17:50:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/IML-SVD-sensitivities/m-p/200742#M2068</guid>
      <dc:creator>xtc283x</dc:creator>
      <dc:date>2015-07-12T17:50:36Z</dc:date>
    </item>
    <item>
      <title>Re: IML SVD sensitivities</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/IML-SVD-sensitivities/m-p/200743#M2069</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No. The Lanczos algorithm is used for computing the first k eigenvalues/vectors, but it is not implemented in SAS/IML.&amp;nbsp; It is possible that the SVD used by SAS Text Mining has an option to use the Lanczos method, but you'd have to ask someone in the text mining community.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Jul 2015 19:32:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/IML-SVD-sensitivities/m-p/200743#M2069</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2015-07-12T19:32:32Z</dc:date>
    </item>
    <item>
      <title>Re: IML SVD sensitivities</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/IML-SVD-sensitivities/m-p/200744#M2070</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, thanks again.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Jul 2015 20:02:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/IML-SVD-sensitivities/m-p/200744#M2070</guid>
      <dc:creator>xtc283x</dc:creator>
      <dc:date>2015-07-12T20:02:48Z</dc:date>
    </item>
    <item>
      <title>Re: IML SVD sensitivities</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/IML-SVD-sensitivities/m-p/200745#M2071</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here's a blog post that directly addresses your question about timing eigenvalue computations:&lt;/P&gt;&lt;P&gt;&lt;A href="http://blogs.sas.com/content/iml/2015/07/13/performance-of-algorithms.html"&gt;http://blogs.sas.com/content/iml/2015/07/13/performance-of-algorithms.html&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jul 2015 11:17:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/IML-SVD-sensitivities/m-p/200745#M2071</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2015-07-13T11:17:56Z</dc:date>
    </item>
    <item>
      <title>Re: IML SVD sensitivities</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/IML-SVD-sensitivities/m-p/200746#M2072</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Great! Thank you...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Jul 2015 11:34:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/IML-SVD-sensitivities/m-p/200746#M2072</guid>
      <dc:creator>xtc283x</dc:creator>
      <dc:date>2015-07-13T11:34:28Z</dc:date>
    </item>
    <item>
      <title>Re: IML SVD sensitivities</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/IML-SVD-sensitivities/m-p/225415#M2304</link>
      <description>&lt;P&gt;Rick-&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;Thanks again for your help with developing a robust PCA. I'm a novice user of IML. I'm working with the SAS document you wrote --&lt;EM&gt;&amp;nbsp;Paper 329-2010 &amp;nbsp;&lt;/EM&gt;&lt;EM&gt;Rediscovering SAS/IML® Software:&amp;nbsp;Modern Data Analysis for the Practicing Statistician.&lt;/EM&gt;&amp;nbsp;In addition, I have your book on &lt;EM&gt;Statistical Programming with SAS/IML.&lt;/EM&gt;&amp;nbsp;The matrix I'm analyzing for the robust PCA is 40 columns by 900 rows. I have a question for you about some code in your paper:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;On page 9 you write:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;/* compute PCA of robust covariance matrix */&lt;BR /&gt;&amp;nbsp; &amp;nbsp;p = ncol(x); /* 20 variables */&lt;BR /&gt;&amp;nbsp; &amp;nbsp;RobustCov = est[3:2+p, ]; /* robust estimate of shape parameters */&lt;BR /&gt;&amp;nbsp; &amp;nbsp;call eigen(eVal, eVec, RobustCov); /* PCA = eigenvectors of RobustCov */&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can't find any documentation on the "est" function in your book. So, when you write&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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;RobustCov = est[3:2+p, ];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What exactly is that line of IML code doing? Is the "3:2+p" based on the sample data you're using? If I want to rewrite that line of code for the 40x900 matrix I'm working with, what would it look like? Currently, I'm getting errors with a simple replication of your code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cut and paste of IML error messages in my SAS log:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;p=ncol(x);&lt;BR /&gt;RobustCov=ext[3:2+p, ];&lt;BR /&gt;ERROR: (execution) Matrix has not been set to a value.&lt;/P&gt;&lt;P&gt;operation : [ at line 1231 column 14&lt;BR /&gt;operands : ext, *LIT1001, _TEM1001,&lt;/P&gt;&lt;P&gt;ext 0 row 0 col (type ?, size 0)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;*LIT1001 1 row 1 col (numeric)&lt;/P&gt;&lt;P&gt;3&lt;/P&gt;&lt;P&gt;_TEM1001 1 row 1 col (numeric)&lt;/P&gt;&lt;P&gt;39&lt;/P&gt;&lt;P&gt;statement : ASSIGN at line 1231 column 1&lt;BR /&gt;1232 call eigen(eVal, Evec, RobustCov);&lt;BR /&gt;ERROR: (execution) Character argument should be numeric.&lt;/P&gt;&lt;P&gt;operation : EIGEN at line 1232 column 1&lt;BR /&gt;operands : RobustCov&lt;/P&gt;&lt;P&gt;RobustCov 0 row 0 col (type ?, size 0)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;statement : CALL at line 1232 column 1&lt;BR /&gt;1233 VarExplained=cusum(eval)/sum(eval);&lt;BR /&gt;ERROR: (execution) Matrix has not been set to a value.&lt;/P&gt;&lt;P&gt;operation : CUSUM at line 1233 column 19&lt;BR /&gt;operands : eval&lt;/P&gt;&lt;P&gt;eVal 0 row 0 col (type ?, size 0)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;statement : ASSIGN at line 1233 column 1&lt;BR /&gt;1234 NumPC=1;&lt;BR /&gt;1235 RobustLoc=est[1,];&lt;BR /&gt;ERROR: (execution) Matrix has not been set to a value.&lt;/P&gt;&lt;P&gt;operation : [ at line 1235 column 14&lt;BR /&gt;operands : est, *LIT1004,&lt;/P&gt;&lt;P&gt;est 0 row 0 col (type ?, size 0)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;*LIT1004 1 row 1 col (numeric)&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;statement : ASSIGN at line 1235 column 1&lt;BR /&gt;1236 c=(x-RobustLoc);&lt;BR /&gt;ERROR: (execution) Matrix has not been set to a value.&lt;/P&gt;&lt;P&gt;operation : - at line 1236 column 5&lt;BR /&gt;operands : x, RobustLoc&lt;BR /&gt;x 897 rows 37 cols (numeric)&lt;/P&gt;&lt;P&gt;RobustLoc 0 row 0 col (type ?, size 0)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;statement : ASSIGN at line 1236 column 1&lt;BR /&gt;1237 Scores=c*eVec[,1:NumPC];&lt;BR /&gt;ERROR: (execution) Matrix has not been set to a value.&lt;/P&gt;&lt;P&gt;operation : [ at line 1237 column 14&lt;BR /&gt;operands : eVec, , *LIT1005, NumPC&lt;/P&gt;&lt;P&gt;Evec 0 row 0 col (type ?, size 0)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;*LIT1005 1 row 1 col (numeric)&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;NumPC 1 row 1 col (numeric)&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;statement : ASSIGN at line 1237 column 1&lt;BR /&gt;1238 print scores;&lt;BR /&gt;ERROR: Matrix Scores has not been set to a value.&lt;/P&gt;&lt;P&gt;statement : PRINT at line 1238 column 1&lt;BR /&gt;1239&lt;BR /&gt;1240 create RobustPCA var {pgm scores};&lt;BR /&gt;1241 append;&lt;BR /&gt;1242 close robustpca;&lt;BR /&gt;NOTE: The data set WORK.ROBUSTPCA has 897 observations and 2 variables.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What am I doing wrong?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;THank you,&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Sep 2015 18:04:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/IML-SVD-sensitivities/m-p/225415#M2304</guid>
      <dc:creator>xtc283x</dc:creator>
      <dc:date>2015-09-14T18:04:31Z</dc:date>
    </item>
    <item>
      <title>Re: IML SVD sensitivities</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/IML-SVD-sensitivities/m-p/225581#M2310</link>
      <description>&lt;P&gt;In SAS/IML, function calls use parentheses, so est is not a function.&amp;nbsp; Subscripting of a matrix is accomplished by using square brackets, and that is what the expression est[3:2+p, ]; is doing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The analysis on p. 9 is a continuation of the analysis on p. 8. To prevent the errors you are seeing, read the X matrix, set up the option vector, and call MCD.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The 'est' matrix was returned by the CALL MCD subroutine as the second argument. &lt;A href="http://support.sas.com/documentation/cdl/en/imlug/68150/HTML/default/viewer.htm#imlug_langref_sect252.htm" target="_self"&gt;The documentation for the MCD subroutine&lt;/A&gt; says that this matrix has p columns, where p is the number of columns of the data matrix (in your case, 40). The rows are&lt;/P&gt;&lt;DIV class="AAdeflist"&gt;&lt;SPAN class=" AAterm "&gt;&lt;SPAN class=" AAargument"&gt;est[1, ] = &lt;/SPAN&gt;&lt;/SPAN&gt;location of ellipsoid center &lt;SPAN class=" AAterm "&gt;&lt;SPAN class=" AAargument"&gt;est[2, ] = &lt;/SPAN&gt;&lt;/SPAN&gt;eigenvalues of final robust scatter matrix &lt;SPAN class=" AAterm "&gt;&lt;SPAN class=" AAargument"&gt;est[3:2+p, ] = &lt;/SPAN&gt;&lt;/SPAN&gt;the final robust scatter matrix&lt;/DIV&gt;&lt;P&gt;Thus if you define p=ncol(X), you shouldn't have to change any code.&amp;nbsp;&amp;nbsp; I assume you know that the notation y[1, ] means the first row of y. If not, read section 2.6 of my book.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Sep 2015 13:58:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/IML-SVD-sensitivities/m-p/225581#M2310</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2015-09-15T13:58:19Z</dc:date>
    </item>
    <item>
      <title>Re: IML SVD sensitivities</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/IML-SVD-sensitivities/m-p/227572#M2352</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/36940"&gt;@xtc283x﻿&lt;/a&gt;&amp;nbsp;In a private communication you said that I did not answer your question. I have re-read your post. Here are my answers to your four questions:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;&lt;EM&gt;What exactly is that line of IML code doing?&lt;/EM&gt; It extracts rows 3 through (2+p), where p is the number of variables in your problem.&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp;&lt;EM&gt;Is the "3:2+p" based on the sample data you're using?&lt;/EM&gt; No, it will work for any data.&lt;/LI&gt;
&lt;LI&gt;&lt;EM&gt;If I want to rewrite that line of code for the 40x900 matrix I'm working with, what would it look like?&lt;/EM&gt; A matrix with only 40 rows and 900 columns is degenerate. There are not enough observations to have a nonsingular&amp;nbsp;covariance matrix.&amp;nbsp; When you try to call the MCD function you will get an error like
&lt;P&gt;ERROR: The number of observations (40) must be larger than the number of variables (900).&lt;/P&gt;
&lt;/LI&gt;
&lt;LI&gt;&lt;EM&gt;What am I doing wrong?&lt;/EM&gt; You are doing two things wrong.&amp;nbsp;Your statistical error is that&amp;nbsp;you must have more rows than columns in order to run Rousseeuw’s minimum covariance determinant (MCD) algorithm.&amp;nbsp;Your programming error is that you must run the MCD analysis on p. 8 before you can extract the results from the EST matrix.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2015 19:50:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/IML-SVD-sensitivities/m-p/227572#M2352</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2015-09-28T19:50:46Z</dc:date>
    </item>
    <item>
      <title>Re: IML SVD sensitivities</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/IML-SVD-sensitivities/m-p/227622#M2353</link>
      <description>&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2015 09:38:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/IML-SVD-sensitivities/m-p/227622#M2353</guid>
      <dc:creator>xtc283x</dc:creator>
      <dc:date>2015-09-29T09:38:54Z</dc:date>
    </item>
  </channel>
</rss>

