<?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: How do I improve performance for a slow IML based simulation code? in SAS/IML Software and Matrix Computations</title>
    <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/How-do-I-improve-performance-for-a-slow-IML-based-simulation/m-p/110100#M832</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Than you Ian and Rick. While I have been using SAS for over 25 years, I just started using IML a month or so ago. I will rewrite the macro within to only loop within IML. I will post my progress updates soon. Thank you again.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 11 May 2012 14:35:13 GMT</pubDate>
    <dc:creator>jhzeinab_yahoo_com</dc:creator>
    <dc:date>2012-05-11T14:35:13Z</dc:date>
    <item>
      <title>How do I improve performance for a slow IML based simulation code?</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/How-do-I-improve-performance-for-a-slow-IML-based-simulation/m-p/110097#M829</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a very slow running simulation code that uses IML. Although I am generating 10,000 samples for every iteration, I need to retain the first sample record once a calculated T statistic is greater than h value.&lt;/P&gt;&lt;P&gt;The code is running extremely slow and I could get only one iteration per day. I appreciate any help or suggestions anyone can provide. SAS cod eis attached.&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 May 2012 14:16:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/How-do-I-improve-performance-for-a-slow-IML-based-simulation/m-p/110097#M829</guid>
      <dc:creator>jhzeinab_yahoo_com</dc:creator>
      <dc:date>2012-05-10T14:16:41Z</dc:date>
    </item>
    <item>
      <title>Re: How do I improve performance for a slow IML based simulation code?</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/How-do-I-improve-performance-for-a-slow-IML-based-simulation/m-p/110098#M830</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That is very slow indeed.&amp;nbsp; I imagine most of the time spent by your program is either processing the macro code or opening/closing proc IML.&amp;nbsp; The latter you are doing around 50 million times which must bring a significant overhead.&amp;nbsp;&amp;nbsp; I think you need to rewrite the program so that all of the iterations occur within IML - no macro loops at all, use only IML do loops.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 May 2012 10:30:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/How-do-I-improve-performance-for-a-slow-IML-based-simulation/m-p/110098#M830</guid>
      <dc:creator>IanWakeling</dc:creator>
      <dc:date>2012-05-11T10:30:35Z</dc:date>
    </item>
    <item>
      <title>Re: How do I improve performance for a slow IML based simulation code?</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/How-do-I-improve-performance-for-a-slow-IML-based-simulation/m-p/110099#M831</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I agree with Ian.&lt;/P&gt;&lt;P&gt;Your program is currently structured like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%DO loops: grid in (lambda, h) space&lt;/P&gt;&lt;P&gt;%DO simulation loop (10,000 iterations)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; call PROC IML&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; write one observation&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; call PROC APPEND to append obs&lt;/P&gt;&lt;P&gt;%END simulation&lt;/P&gt;&lt;P&gt;call PROC MEANS to get mean, std, and sterr of simulation with given (lambda, h)&lt;/P&gt;&lt;P&gt;%END grid loops&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To make it more efficient, structure it like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call PROC IML&lt;/P&gt;&lt;P&gt;CREATE output var {lambda h mean std stderr}; /* open data for results */&lt;/P&gt;&lt;P&gt;DO loops: grid in (lambda, h) space&lt;/P&gt;&lt;P&gt;DO simulation loop (10,000 iterations)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; accumulate simulated data in rows of matrix&lt;/P&gt;&lt;P&gt;END simulation&lt;/P&gt;&lt;P&gt;Use SAS/IML functions (MEAN, STD,...) to get mean/std/stderr of simulation with given (lambda, h)&lt;/P&gt;&lt;P&gt;APPEND;&amp;nbsp; /* write results to data set */&lt;/P&gt;&lt;P&gt;END grid loops&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 May 2012 12:17:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/How-do-I-improve-performance-for-a-slow-IML-based-simulation/m-p/110099#M831</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2012-05-11T12:17:26Z</dc:date>
    </item>
    <item>
      <title>Re: How do I improve performance for a slow IML based simulation code?</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/How-do-I-improve-performance-for-a-slow-IML-based-simulation/m-p/110100#M832</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Than you Ian and Rick. While I have been using SAS for over 25 years, I just started using IML a month or so ago. I will rewrite the macro within to only loop within IML. I will post my progress updates soon. Thank you again.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 May 2012 14:35:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/How-do-I-improve-performance-for-a-slow-IML-based-simulation/m-p/110100#M832</guid>
      <dc:creator>jhzeinab_yahoo_com</dc:creator>
      <dc:date>2012-05-11T14:35:13Z</dc:date>
    </item>
  </channel>
</rss>

