<?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 with iwish prior and UN@AR(1) covariance in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/proc-mcmc-with-iwish-prior-and-UN-AR-1-covariance/m-p/466872#M24280</link>
    <description>&lt;P&gt;Yes, the IWISHRWM option essentially&amp;nbsp;applies the RW algorithm when you have a IWISH posterior.&amp;nbsp; In general the option remains undocumented because in anything larger than a 2x2 case, it tends not to work very well.&lt;/P&gt;</description>
    <pubDate>Fri, 01 Jun 2018 15:13:09 GMT</pubDate>
    <dc:creator>SAS_Rob</dc:creator>
    <dc:date>2018-06-01T15:13:09Z</dc:date>
    <item>
      <title>proc mcmc with iwish prior and UN@AR(1) covariance</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-mcmc-with-iwish-prior-and-UN-AR-1-covariance/m-p/466805#M24278</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What&amp;nbsp;does exactly the&amp;nbsp;IWISHDWM addition to the proc mcmc options? Looks to me it imposes the Random Walk Metropolis (RW-Metropolis)&amp;nbsp;sampler on posterior with iwish prior. I could not find&amp;nbsp;any documentation about that.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am fitting&amp;nbsp;bivariate&amp;nbsp;mixed model for longitudinal data (3 repeated measurements)&amp;nbsp;with UN&amp;amp;AR(1) covariance. Without IWISHRWM the posteriors for all Sigmas are flat and Ind-Metropolis sampler gets chosen by default. Application of IWISHRWM solves it - the&amp;nbsp;model converges to&amp;nbsp;its proc mixed equivalent.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;See below for the code; SAS version&amp;nbsp;9.04.01M3P062415.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Robert&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc mcmc data=ardata_wide_mcmc seed=1234 nbi=1000 nmc=10000 thin=10 plots=ALL IWISHRWM outpost=MODEL_bivar_UNAR1;
array Y[6] Y1_1 Y1_2 Y1_3 Y2_1 Y2_2 Y2_3;
array Mu[6];
array B0[2] B01 B02;
array B1[2] B11 B12;
array V1[2] V11 V12;
array V2[2] V21 V22;
array COV[6,6]; 
array S[2,2];
array Sigma[2,2];&lt;BR /&gt;
      CALL IDENTITY (S);

parms B0: B1: V1: V2: Sigma {0.1 0.001 0.001 0.1} Rho 0.1;

prior B0: B1: V1: V2: ~ normal(0, var=1e6);
prior Sigma ~ iwish(%eval(2+1), S);
prior Rho ~ uniform(-1,1);

/* Kronecker product matrix */
beginnodata; 
	do i = 1 to 6; 
		do j = 1 to 6;
			if (i &amp;lt;= 3 and j &amp;lt;= 3) then do;
				COV[i,j] = Sigma[1,1] * Rho**abs(i-j); 
			end;
			if (i &amp;gt; 3 and j &amp;lt;= 3) then do;
				COV[i,j] = Sigma[1,2] * Rho**abs((i-3)-j); 
			end;
			if (i &amp;lt;= 3 and j &amp;gt; 3) then do;
				COV[i,j] = Sigma[2,1] * Rho**abs(i-(j-3)); 
			end;
			if (i &amp;gt; 3 and j &amp;gt; 3) then do;
				COV[i,j] = Sigma[2,2] * Rho**abs(i-j); 
			end;
		end; 
	end; 
endnodata;

Mu[1] = B01 + B11 * X_1 + V11;
Mu[2] = B01 + B11 * X_2 + V12;
Mu[3] = B01 + B11 * X_3;
Mu[4] = B02 + B12 * X_1 + V21;
Mu[5] = B02 + B12 * X_2 + V22;
Mu[6] = B02 + B12 * X_3;

model  Y ~ mvn(Mu, COV);

run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jun 2018 11:41:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-mcmc-with-iwish-prior-and-UN-AR-1-covariance/m-p/466805#M24278</guid>
      <dc:creator>Robert_Kozarski</dc:creator>
      <dc:date>2018-06-01T11:41:52Z</dc:date>
    </item>
    <item>
      <title>Re: proc mcmc with iwish prior and UN@AR(1) covariance</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-mcmc-with-iwish-prior-and-UN-AR-1-covariance/m-p/466872#M24280</link>
      <description>&lt;P&gt;Yes, the IWISHRWM option essentially&amp;nbsp;applies the RW algorithm when you have a IWISH posterior.&amp;nbsp; In general the option remains undocumented because in anything larger than a 2x2 case, it tends not to work very well.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jun 2018 15:13:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-mcmc-with-iwish-prior-and-UN-AR-1-covariance/m-p/466872#M24280</guid>
      <dc:creator>SAS_Rob</dc:creator>
      <dc:date>2018-06-01T15:13:09Z</dc:date>
    </item>
    <item>
      <title>Re: proc mcmc with iwish prior and UN@AR(1) covariance</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/proc-mcmc-with-iwish-prior-and-UN-AR-1-covariance/m-p/466894#M24281</link>
      <description>&lt;P&gt;Thank you for your response.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What would you suggest for cases&amp;nbsp;larger than&amp;nbsp;[2,2]? I plan to carry out the analysis for UN@UN where&amp;nbsp;the TIGMA&amp;nbsp;is [3,3]&amp;nbsp;with IWISH prior (relevant part of the code below). From what I get right now I can see the Sigma and Tigma do not converge to proc mixed outcome with IWISHRWM.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot,&lt;/P&gt;&lt;P&gt;Robert&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;array S[2,2];
array Sigma[2,2];
array T[3,3];
array Tigma[3,3];

%***Set up some expandable code to create required matricies for inverse wishart prior;
CALL IDENTITY (S);
CALL IDENTITY (T);

parms Sigma {0.1 0.01 0.01 0.1};
parms Tigma {1 0.01 0.01 0.01 1 0.01 0.01 0.01 1};
parms B0: B1: V1: V2:;

prior B0: B1: V1: V2: ~ normal(0, var=1e6);
prior Sigma ~ iwish(%eval(2 + 1), S);
prior Tigma ~ iwish(%eval(3 + 1), T);

/* Kronecker product matrix */
beginnodata; 
	do i = 1 to 6; 
		do j = 1 to 6;
			if (i &amp;lt;= 3 and j &amp;lt;= 3) then do;
				COV[i,j] = Sigma[1,1] * Tigma[i,j]; 
			end;			
			if (i &amp;gt; 3 and j &amp;lt;= 3) then do;
				COV[i,j] = Sigma[1,2] * Tigma[(i-3),j]; 
			end;
			if (i &amp;lt;= 3 and j &amp;gt; 3) then do;
				COV[i,j] = Sigma[2,1] * Tigma[i,(j-3)]; 
			end;
			if (i &amp;gt; 3 and j &amp;gt; 3) then do;
				COV[i,j] = Sigma[2,2] * Tigma[(i-3),(j-3)]; 
			end;
		end; 
	end; 
endnodata;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jun 2018 15:50:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/proc-mcmc-with-iwish-prior-and-UN-AR-1-covariance/m-p/466894#M24281</guid>
      <dc:creator>Robert_Kozarski</dc:creator>
      <dc:date>2018-06-01T15:50:59Z</dc:date>
    </item>
  </channel>
</rss>

