BookmarkSubscribeRSS Feed
Hlin01
Calcite | Level 5

Hi

 

If there a way to calculate the probability of x1<c, x2<c, x3<c in IML, where x1, x2, and x3 follow a MVN(0, V), where R has a compound symmetry structure, with correlation = r and variance=1?

 

Thanks.

HM

1 REPLY 1
Rick_SAS
SAS Super FREQ

No, there is not a built-in function call for multivariate normal CDFs when d>2.  For d=2 (bivariate), you can use the PROBBNRM function  and for higher-dimensions you can use Monte Carlo estimation as follows:

 

/* Monte Carlo estimation for 3-D CDF of MVN with 
   CS covariance structure */
proc iml;
call streaminit(123);
d = 3;                         /* dimension */
N = 1e7;                       /* sample size */
mean = j(1, d, 0);             /* mean of distribution */
Sigma = {1   0.5 0.5,
         0.5 1   0.5,
         0.5 0.5 1};
Z = randnormal(N, mean, I(d)); /* Z ~  MVN (0, I)  */
v0 = {0 0 0};                  /* cutoff values in each component (c,c,c) */
ComponentsInRegion = (Z < v0)[,+]; /* number of components in region */
group = (ComponentsInRegion=d);    /* all 3 components in the region? */
MCEst = mean(group);               /* proportion of obs in region */
print MCEst;

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

From The DO Loop
Want more? Visit our blog for more articles like these.
Discussion stats
  • 1 reply
  • 752 views
  • 1 like
  • 2 in conversation