To create an AR(1) matrix from the estimate, rho, see the first section in "Fast simulation of multivariate normal data with an AR(1) correlation structure."
Let's suppose both matrices are 3x3, although they can be any square dimensions. The following program computes the Kronecker product of an AR(1) correlation matrix with rho=0.8 and a unstructured matrix with estimates UN[1,2]=0.63, UN[1,3]=0.12, and UN[2,3]=0.34:
proc iml;
/* return p x p matrix whose (i,j)th element is rho^|i - j|
See https://blogs.sas.com/content/iml/2018/10/03/ar1-cholesky-root-simulation.html */
start AR1Corr(rho, p);
return rho##distance(T(1:p), T(1:p), "L1");
finish;
/* test on a matrix with rho = 0.8 */
rho = 0.8; p = 3;
AR1 = AR1Corr(rho, p);
UN = {1 0.63 0.12,
0.63 1 0.34,
0.12 0.34 1 };
K = UN@AR1;
print UN, AR1, K;
Do you have SAS/IML ?
Maybe @Rick_SAS could give you a hand.
To create an AR(1) matrix from the estimate, rho, see the first section in "Fast simulation of multivariate normal data with an AR(1) correlation structure."
Let's suppose both matrices are 3x3, although they can be any square dimensions. The following program computes the Kronecker product of an AR(1) correlation matrix with rho=0.8 and a unstructured matrix with estimates UN[1,2]=0.63, UN[1,3]=0.12, and UN[2,3]=0.34:
proc iml;
/* return p x p matrix whose (i,j)th element is rho^|i - j|
See https://blogs.sas.com/content/iml/2018/10/03/ar1-cholesky-root-simulation.html */
start AR1Corr(rho, p);
return rho##distance(T(1:p), T(1:p), "L1");
finish;
/* test on a matrix with rho = 0.8 */
rho = 0.8; p = 3;
AR1 = AR1Corr(rho, p);
UN = {1 0.63 0.12,
0.63 1 0.34,
0.12 0.34 1 };
K = UN@AR1;
print UN, AR1, K;
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.