<?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: proc mcmc in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/proc-mcmc/m-p/356513#M18697</link>
    <description>&lt;P&gt;I tried unchecking the option, but no change.&lt;/P&gt;</description>
    <pubDate>Fri, 05 May 2017 18:22:46 GMT</pubDate>
    <dc:creator>KBACHU</dc:creator>
    <dc:date>2017-05-05T18:22:46Z</dc:date>
    <item>
      <title>proc mcmc</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-mcmc/m-p/356499#M18691</link>
      <description>&lt;P&gt;Trying to run this code in SAS 94 windows environment. It takes much time in SAS 9.4 compared with SAS 9.2. Any suggestions on how to improve the performance?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods _all_ close;
ods preferences;

data heights;
	input Family G$ Height @@;
	datalines;
1 F 67   1 F 66   1 F 64   1 M 71   1 M 72   2 F 63
2 F 63   2 F 67   2 M 69   2 M 68   2 M 70   3 F 63
3 M 64   4 F 67   4 F 66   4 M 67   4 M 67   4 M 69
;
run;

data input;
	set heights;

	if g eq 'F' then
		gf = 1;
	else gf = 0;
	drop g;

	if family=1 then
		do;
			indf1=1;
			indf2=0;
			indf3=0;
			indf4=0;
		end;
	else if family=2 then
		do;
			indf1=0;
			indf2=1;
			indf3=0;
			indf4=0;
		end;
	else if family=3 then
		do;
			indf1=0;
			indf2=0;
			indf3=1;
			indf4=0;
		end;
	else if family=4 then
		do;
			indf1=0;
			indf2=0;
			indf3=0;
			indf4=1;
		end;
run;

ods graphics on;

proc mcmc data=input outpost=postout nmc=50000 seed=7893 plots= (trace density) diag=none  monitor=(b0 b1) STATISTICS=summary
	statistics=interval;
	ods select  postsummaries postintervals tdpanel;;
	parms b0 0 b1 0 s2 1 s2g 1;
	prior b: ~ normal(0, var = 10000);
	prior s: ~ igamma(0.01, scale = 0.01);
	random gamma ~ normal(0, var = s2g) subject=family monitor=(gamma);
	mu = b0 + b1 * gf + gamma;
	model height ~ normal(mu, var = s2);
	ods output postintervals=pint postsummaries=psum;
run;

quit;

ods graphics off;

proc print data=pint;
run;

proc print data=psum;
run;
;
 &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P style="margin: 0in 0in 0pt;"&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 May 2017 17:44:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-mcmc/m-p/356499#M18691</guid>
      <dc:creator>KBACHU</dc:creator>
      <dc:date>2017-05-05T17:44:34Z</dc:date>
    </item>
    <item>
      <title>Re: proc mm</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-mcmc/m-p/356502#M18692</link>
      <description>&lt;P&gt;I don't know about the rest of your code but you can simplify the if/then section:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;array indf(4) indf1-indf4 (4*0); *initialize all to 0 to start with;

indf(family) = 1;	
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 05 May 2017 17:44:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-mcmc/m-p/356502#M18692</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-05-05T17:44:53Z</dc:date>
    </item>
    <item>
      <title>Re: proc mm</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-mcmc/m-p/356503#M18693</link>
      <description>Hi Reeza, Thanks for your response. This is just a sample code I am testing. I have to run this with many simulations.</description>
      <pubDate>Fri, 05 May 2017 17:47:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-mcmc/m-p/356503#M18693</guid>
      <dc:creator>KBACHU</dc:creator>
      <dc:date>2017-05-05T17:47:18Z</dc:date>
    </item>
    <item>
      <title>Re: proc mcmc</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-mcmc/m-p/356504#M18694</link>
      <description>&lt;P&gt;Ok, can I assume then you've diagnosed the performance problem/bottleneck as being in PROC MCMC?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If so, how long is it currently taking and how long did it take before?&lt;/P&gt;
&lt;P&gt;Also, in the upgrade from 9.2 to 9.4 did anything else change?&lt;/P&gt;</description>
      <pubDate>Fri, 05 May 2017 17:51:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-mcmc/m-p/356504#M18694</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-05-05T17:51:10Z</dc:date>
    </item>
    <item>
      <title>Re: proc mcmc</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-mcmc/m-p/356507#M18695</link>
      <description>&lt;P&gt;There is almost a 15 seconds delay for the same program between 92 and 94. The time will increase a lot if I run with many simulations. I beleive part of the problem is with ods graphics. I heard that a lot has been changed in ods graphics between 92 and 94&lt;/P&gt;</description>
      <pubDate>Fri, 05 May 2017 18:05:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-mcmc/m-p/356507#M18695</guid>
      <dc:creator>KBACHU</dc:creator>
      <dc:date>2017-05-05T18:05:21Z</dc:date>
    </item>
    <item>
      <title>Re: proc mcmc</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-mcmc/m-p/356512#M18696</link>
      <description>&lt;P&gt;Yes, ODS Graphics are enhanced, and creating graphs is where it seems to lag. Given your specifications I assume you want a graph though.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Have you tried turning off 'show results as generated' option? That may also speed it up, since it writes it but isn't taking the time to try and display it.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 May 2017 18:15:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-mcmc/m-p/356512#M18696</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-05-05T18:15:00Z</dc:date>
    </item>
    <item>
      <title>Re: proc mcmc</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-mcmc/m-p/356513#M18697</link>
      <description>&lt;P&gt;I tried unchecking the option, but no change.&lt;/P&gt;</description>
      <pubDate>Fri, 05 May 2017 18:22:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-mcmc/m-p/356513#M18697</guid>
      <dc:creator>KBACHU</dc:creator>
      <dc:date>2017-05-05T18:22:46Z</dc:date>
    </item>
    <item>
      <title>Re: proc mcmc</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-mcmc/m-p/356563#M18698</link>
      <description>&lt;P&gt;This wasn't under Statistical Procedures, so I've moved it there to hopefully get a better response.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS is always interested in when things change between versions, so tech support is probably a good next place to get help, if you haven't already. 9.2 to 9.4 is a big jump though...it's much easier to work with in a lot of ways.&lt;/P&gt;</description>
      <pubDate>Fri, 05 May 2017 21:49:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-mcmc/m-p/356563#M18698</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-05-05T21:49:04Z</dc:date>
    </item>
    <item>
      <title>Re: proc mcmc</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-mcmc/m-p/356588#M18699</link>
      <description>&lt;PRE&gt;
Yeah. As you said, maybe ODS Graphic cost you lots of time, 
Try close all the destinations.

ods _all_ close;
proc mcmc ..........

&lt;/PRE&gt;</description>
      <pubDate>Sat, 06 May 2017 03:24:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-mcmc/m-p/356588#M18699</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2017-05-06T03:24:31Z</dc:date>
    </item>
    <item>
      <title>Re: proc mcmc</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-mcmc/m-p/356605#M18700</link>
      <description>&lt;P&gt;1. This program takes about 2 seconds for me to run, so I am not seeing the performance problem you see. Most of that 2 seconds is&amp;nbsp;creating output.&lt;/P&gt;
&lt;P&gt;.&lt;/P&gt;
&lt;P&gt;2. In the first line&amp;nbsp;of your&amp;nbsp;program, you close all the ODS destinations. This is usually a&amp;nbsp;bad idea. Between 9.2 and 9.3, one of the biggest changes is that HTML became the default destination, instead of&amp;nbsp;LISTING. HTML is a more complex destination and is slower than LISTING. For an apples-to-apples&amp;nbsp;comparison, delete the first line and replace it with&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ODS HTML CLOSE;&lt;/P&gt;
&lt;P&gt;ODS LISTING;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3. To learn why ODS _ALL_ CLOSE is a bad idea, see &lt;A href="http://blogs.sas.com/content/iml/2015/05/28/five-reasons-ods-exclude.html" target="_self"&gt;"Five reasons to use ODS EXCLUDE to suppress output"&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 06 May 2017 09:53:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-mcmc/m-p/356605#M18700</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2017-05-06T09:53:06Z</dc:date>
    </item>
  </channel>
</rss>

