<?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: Problem of  Invalid subscript in SAS/IML Software and Matrix Computations</title>
    <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Problem-of-Invalid-subscript/m-p/389293#M3689</link>
    <description>&lt;P&gt;Thank you for your help. Problem of the subscript solved. But new problem appears:&amp;nbsp;ERROR: Not enough memory to store all matrices.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It seems that I do not have too many matrices in my code. The matrix S is always replaced.&lt;/P&gt;</description>
    <pubDate>Sat, 19 Aug 2017 03:20:51 GMT</pubDate>
    <dc:creator>supmilk</dc:creator>
    <dc:date>2017-08-19T03:20:51Z</dc:date>
    <item>
      <title>Problem of  Invalid subscript</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Problem-of-Invalid-subscript/m-p/389185#M3687</link>
      <description>&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;&amp;nbsp;the error shows as below:&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;ERROR: (execution) Invalid subscript or subscript out of range.&lt;/P&gt;&lt;P&gt;operation : [ at line 186 column 6&lt;BR /&gt;operands : T, t, *LIT1006&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;but actually, T is a 120×1 matrix, even I adjust "do t=1 to 12o" to&amp;nbsp;"do t=1 to 2", I do not understand why.&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;and the code:&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc iml;
load N;
load T;
load NT;
B_0=N*(T`);
use ba.t3;
do i=1 to 2320;
  do t=1 to 5;
  f=N[i,1];
  g=T[t,1];
  B_0[i,t]=0;
    do c=1 to 248064;
    if NT[c,1]=f &amp;amp; NT[c,2]=g then do;
      read all where(SecCode=f &amp;amp; TDate=g) into S;
      XX=0;
      XY=0;
        do ini=1 to 15;
          XX=XX+S[ini,4]*S[ini,4];
	      XY=XY+S[ini+1,4]*S[ini,4];
        end;
      b_0=XY/XX;
      B_0[i,t]=b_0;
	end;
  end;
  end;
end;
store B_0;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 18 Aug 2017 18:21:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Problem-of-Invalid-subscript/m-p/389185#M3687</guid>
      <dc:creator>supmilk</dc:creator>
      <dc:date>2017-08-18T18:21:23Z</dc:date>
    </item>
    <item>
      <title>Re: Problem of  Invalid subscript</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Problem-of-Invalid-subscript/m-p/389226#M3688</link>
      <description>&lt;P&gt;SAS is not case sensitive. 'T' and 't' represent the same variable name. Thus you load a matrix named T, but you reassign that matrix when you use "do t = 1 to 5". &amp;nbsp; Change the iterator from 't' to 'k' andupdate all the subscripts that are currently using 't'.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Aug 2017 20:20:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Problem-of-Invalid-subscript/m-p/389226#M3688</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2017-08-18T20:20:19Z</dc:date>
    </item>
    <item>
      <title>Re: Problem of  Invalid subscript</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Problem-of-Invalid-subscript/m-p/389293#M3689</link>
      <description>&lt;P&gt;Thank you for your help. Problem of the subscript solved. But new problem appears:&amp;nbsp;ERROR: Not enough memory to store all matrices.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It seems that I do not have too many matrices in my code. The matrix S is always replaced.&lt;/P&gt;</description>
      <pubDate>Sat, 19 Aug 2017 03:20:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Problem-of-Invalid-subscript/m-p/389293#M3689</guid>
      <dc:creator>supmilk</dc:creator>
      <dc:date>2017-08-19T03:20:51Z</dc:date>
    </item>
    <item>
      <title>Re: Problem of  Invalid subscript</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Problem-of-Invalid-subscript/m-p/389336#M3690</link>
      <description>&lt;P&gt;I can't tell from what you've shown.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would advise that you remove the hard-coded values for the loops and replace them with terms such as nrow(N), nrow(T), and nrow(NT), which will make your code easier to read and more portable.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The statements&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;     b_0&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;XY&lt;SPAN class="token operator"&gt;/&lt;/SPAN&gt;XX&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
      B_0&lt;SPAN class="token punctuation"&gt;[&lt;/SPAN&gt;i&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt;t&lt;SPAN class="token punctuation"&gt;]&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;b_0&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;are also wrong b/c you are overwriting b_0, which is the same as B_0.&lt;/P&gt;</description>
      <pubDate>Sat, 19 Aug 2017 18:26:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Problem-of-Invalid-subscript/m-p/389336#M3690</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2017-08-19T18:26:16Z</dc:date>
    </item>
    <item>
      <title>Re: Problem of  Invalid subscript</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Problem-of-Invalid-subscript/m-p/389391#M3691</link>
      <description>&lt;P&gt;Are&amp;nbsp;the matrices B_0 and&amp;nbsp;S actually a lot larger&amp;nbsp;than you think they are?&amp;nbsp;&amp;nbsp; Check by adding the command&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;show names;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;at strategic points to obtain a list of matrix names and sizes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 20 Aug 2017 13:06:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Problem-of-Invalid-subscript/m-p/389391#M3691</guid>
      <dc:creator>IanWakeling</dc:creator>
      <dc:date>2017-08-20T13:06:59Z</dc:date>
    </item>
    <item>
      <title>Re: Problem of  Invalid subscript</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Problem-of-Invalid-subscript/m-p/390131#M3700</link>
      <description>&lt;P&gt;I don't quite understand what hard-coded values are, would you mind to explain more details on it and how to deal with it by steps? Thanks a lot, I do need your help!&lt;/P&gt;</description>
      <pubDate>Wed, 23 Aug 2017 07:26:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Problem-of-Invalid-subscript/m-p/390131#M3700</guid>
      <dc:creator>supmilk</dc:creator>
      <dc:date>2017-08-23T07:26:47Z</dc:date>
    </item>
    <item>
      <title>Re: Problem of  Invalid subscript</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Problem-of-Invalid-subscript/m-p/390165#M3701</link>
      <description>&lt;P&gt;Rick is suggesting that if you write the loop like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;do c = 1 to nrow(NT);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;then there is no need to check the size of the matrix NT each time the program is run.&amp;nbsp; Presumably, when you wrote the code above, you had to check that NT had 248064 rows and then hardcode this value in the DO statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am worried about the potential number of iterations for the inner most loop. Depending on the data and how often the IF statement is true, then you may be trying to execute the read statement millions, may be billions of times.&amp;nbsp; This sounds inefficient and it may be better to read the contents of ba.t3 into a matrix at the beginning, and then refer to it rather than the SAS data set.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Aug 2017 09:43:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Problem-of-Invalid-subscript/m-p/390165#M3701</guid>
      <dc:creator>IanWakeling</dc:creator>
      <dc:date>2017-08-23T09:43:30Z</dc:date>
    </item>
    <item>
      <title>Re: Problem of  Invalid subscript</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Problem-of-Invalid-subscript/m-p/390193#M3702</link>
      <description>&lt;P&gt;Since we are offering advice now, I want to point out that the loop to compute XX and XY can be replaced by more&amp;nbsp;efficient statements that use vector multiplication:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* to test, create any matrix S that has at least 16 rows and at least 4 coluumns */&lt;BR /&gt;&lt;BR /&gt;/* replace current code that uses a loop... */
XX=0;
XY=0;
do ini=1 to 15;
	XX=XX+S[ini,4]*S[ini,4];
	XY=XY+S[ini+1,4]*S[ini,4];
end;
print XX XY;

/* ... with more efficient code that uses a vector inner product */
X = S[1:15,4];
Y = S[2:16,4];
XX = X` * X;
XY = X` * Y;
print XX XY;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Other loops can probably be similarly improved.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Aug 2017 12:09:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Problem-of-Invalid-subscript/m-p/390193#M3702</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2017-08-23T12:09:52Z</dc:date>
    </item>
    <item>
      <title>Re: Problem of  Invalid subscript</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Problem-of-Invalid-subscript/m-p/390244#M3703</link>
      <description>&lt;P&gt;Yes! The number of iteration is up to 2320(stocks)×120(days), totally,&amp;nbsp;&lt;SPAN&gt;248064(some are missing). And in each iteration, I need to read data of each stock in each day from ba.t3 to a matrix S. It is terribly inefficient, that one iteration cost me around 30 seconds and all the iterations will cost me 100 days, but I do not know how to improve it.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Aug 2017 14:09:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Problem-of-Invalid-subscript/m-p/390244#M3703</guid>
      <dc:creator>supmilk</dc:creator>
      <dc:date>2017-08-23T14:09:23Z</dc:date>
    </item>
    <item>
      <title>Re: Problem of  Invalid subscript</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Problem-of-Invalid-subscript/m-p/390250#M3704</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;Yes! The number of iteration is up to 2320(stocks)×120(days), totally,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;248064(some are missing). And in each iteration, I need to read data of each stock in each day from ba.t3 to a matrix S. It is terribly inefficient, that one iteration cost me around 30 seconds and all the iterations will cost me 100 days, but I do not know how to improve it.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;The way to improve it is to post sample data (maybe 3&amp;nbsp;stocks x 4 days) including the N, T, and NT matrices.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Also,&amp;nbsp;describe in words what you want the program to do. Then other programmers can make recommendations for improvements. &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Aug 2017 14:15:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Problem-of-Invalid-subscript/m-p/390250#M3704</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2017-08-23T14:15:56Z</dc:date>
    </item>
    <item>
      <title>Re: Problem of  Invalid subscript</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Problem-of-Invalid-subscript/m-p/390681#M3705</link>
      <description>&lt;P&gt;Thank you for your suggestions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;table below is a sample of my data for one stock in one day(3×3 or more are too big to list),&amp;nbsp;&amp;nbsp;matrix N is the list of distinct SecCodes, T is the list of distinct TDates, and NT is the list of all the combinations of stock code and date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The goal of my programming is to calculate an evolutionary&amp;nbsp;AR(1) for every stock in every day. The data I got has 59782508 observations, which cover half year(120 days) and 2320 stocks. So I need to read the matrices from the data for 2320*120 times, which ask for a long time to run. The efficiency of the code is a big problem for me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc iml;
load N;
load D;
load NT;
load B;
use ba.t3;
do i=2320 to 2320;
  do t=120 to 120;
  f=N[i,1];
  g=D[t,1];
  B[i,t]=0;
    do c=1 to 248064;
    if NT[c,1]=f &amp;amp; NT[c,2]=g then do;
      read all where(SecCode=f &amp;amp; TDate=g) into S;
      XX=0;
      XY=0;
        do ini=1 to 15;
          XX=XX+S[ini,4]*S[ini,4];
	      XY=XY+S[ini+1,4]*S[ini,4];
        end;
      b_0=XY/XX;
      B[i,t]=b_0;
	end;
  end;
  end;
end;
store B;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&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; &amp;nbsp; &amp;nbsp; &amp;nbsp;Obs &amp;nbsp; SecCode &amp;nbsp; &amp;nbsp; TDate &amp;nbsp; MinTime StartPrc HighPrc LowPrc EndPrc &amp;nbsp; &amp;nbsp;MinTq &amp;nbsp; &amp;nbsp; &amp;nbsp;MinTm&amp;nbsp;&lt;/P&gt;&lt;DIV class="branch"&gt;&lt;DIV align="center"&gt;&lt;TABLE cellspacing="0" cellpadding="5"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;20151008&lt;/TD&gt;&lt;TD&gt;930&lt;/TD&gt;&lt;TD&gt;10.85&lt;/TD&gt;&lt;TD&gt;10.85&lt;/TD&gt;&lt;TD&gt;10.85&lt;/TD&gt;&lt;TD&gt;10.85&lt;/TD&gt;&lt;TD&gt;2160486&lt;/TD&gt;&lt;TD&gt;23441273.1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;20151008&lt;/TD&gt;&lt;TD&gt;931&lt;/TD&gt;&lt;TD&gt;10.86&lt;/TD&gt;&lt;TD&gt;10.87&lt;/TD&gt;&lt;TD&gt;10.86&lt;/TD&gt;&lt;TD&gt;10.86&lt;/TD&gt;&lt;TD&gt;3495473&lt;/TD&gt;&lt;TD&gt;37987109.2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;20151008&lt;/TD&gt;&lt;TD&gt;932&lt;/TD&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gt;3612752.6&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="branch"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 24 Aug 2017 16:20:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Problem-of-Invalid-subscript/m-p/390681#M3705</guid>
      <dc:creator>supmilk</dc:creator>
      <dc:date>2017-08-24T16:20:55Z</dc:date>
    </item>
    <item>
      <title>Re: Problem of  Invalid subscript</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Problem-of-Invalid-subscript/m-p/390712#M3706</link>
      <description>&lt;P&gt;Well, I can't make sense of what you are telling me and there is no&amp;nbsp;way to run your program, so I give up.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Did you try using an ETS procedure? I am guessing that the best way to do this is to sort by SECCODE and TDATE and then use something like PROC AUTOREG and BY SECCODE TDATE to compute the regression coefficients.&amp;nbsp;You can use the OUTEST= option to output the regression coefficients. Be sure to &lt;A href="http://blogs.sas.com/content/iml/2015/05/26/suppress-ods.html" target="_self"&gt;use ODS EXCLUDE ALL to suppress all the tables/graphs that you don't want.&lt;/A&gt;&amp;nbsp; Your code might look somthing like this (untested)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ods exclude all;&lt;/P&gt;
&lt;P&gt;proc autoreg data=mydata plots=none outest=ParamEst;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;by SecCode TDate;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;model StartPrc = / nlags=1; &amp;nbsp; /* ??? */&lt;/P&gt;
&lt;P&gt;run;quit;&lt;/P&gt;
&lt;P&gt;ods exclude none;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Aug 2017 18:18:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Problem-of-Invalid-subscript/m-p/390712#M3706</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2017-08-24T18:18:41Z</dc:date>
    </item>
    <item>
      <title>Re: Problem of  Invalid subscript</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Problem-of-Invalid-subscript/m-p/390777#M3707</link>
      <description>&lt;P&gt;I can try to make it clear: I want split my data by SecCode and TDate, then calculate in the splitted data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The data has been sorted, but still low efficient while i and t are large.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I appreciate your help very much.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Aug 2017 21:57:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Problem-of-Invalid-subscript/m-p/390777#M3707</guid>
      <dc:creator>supmilk</dc:creator>
      <dc:date>2017-08-24T21:57:34Z</dc:date>
    </item>
  </channel>
</rss>

