turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

Topic Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

01-28-2015 07:44 PM

Dr. Wicklin's text provides significant support for simulating data from correlated multivariate distributions. However, his text does not provide code for Simulating data from Correlated Multivariate Uniform Distributions. Can anyone provide some example code?

For example, could I simply change the RANNOR to RANUNI in the below code?

data MVN (type = CORR); _TYPE_='CORR';

set bhf.R;

run;

proc factor N=19 OUTSTAT=FACOUT;

run;

DATA PATTERN;

SET FACOUT;

IF _TYPE_='PATTERN';

DROP _TYPE_ _NAME_;

RUN;

PROC IML;

USE PATTERN;

READ ALL VAR _NUM_ INTO F;

F=F`;

PRINT f;

DATA = RANNOR(J(10000,19,0));

DATA = DATA`;

Z = F*DATA;

Z = Z`;

X1=Z[,1]*0.418378 + 0.01284361;

X2=Z[,2]*0.418378 + 0.06569127;

X3=Z[,3]*0.418378 + 0.02904674;

X4=Z[,4]*0.418378 + 0.01284361;

X5=Z[,5]*0.418378 + 0.02904674;

X6=Z[,6]*0.418378 + 0.09878997;

X7=Z[,7]*0.418378 + 0.02904674;

X8=Z[,8]*0.418378 + 0.043682;

X9=Z[,9]*0.418378 + 0.06569127;

X10=Z[,10]*0.418378 + 0.043682;

X11=Z[,11]*0.418378 + 0.01931489;

X12=Z[,12]*0.418378 + 0.02904674;

X13=Z[,13]*0.418378 + 0.02904674;

X14=Z[,14]*0.418378 + 0.0437;

X15=Z[,15]*0.418378 + 0.0657;

X16=Z[,16]*0.418378 + 0.02904674;

X17=Z[,17]*0.418378 + 0.043682;

X18=Z[,18]*0.418378 + 0.01931489;

X19=Z[,19]*0.418378 + 0.02904674;

Z=X1||X2||X3||X4||X5||X6||X7||X8||X9||X10||X11||X12

||X13||X14||X15||X16||X17||X18||X19;

CREATE A FROM Z [COLNAME={X1 X2 X3 X4 X5 X6 X7 X8 X9

X10 X11 X12 X13 X14 X15 X16 X17 X18 X19}];

APPEND FROM Z;

PROC MEANS DATA=A N MEAN STD SKEWNESS KURTOSIS;

VAR X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11 X12 X13 X14 X15

X16 X17 X18 X19;

PROC CORR DATA=A NOSIMPLE;

VAR X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11 X12 X13 X14 X15

X16 X17 X18 X19;

RUN;

Thanks!

Accepted Solutions

Solution

01-29-2015
12:05 PM

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to bhfield

01-29-2015 12:05 PM

A correlated MV uniform distribution is called a copula. See p. 164-173.

All Replies

Solution

01-29-2015
12:05 PM

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to bhfield

01-29-2015 12:05 PM

A correlated MV uniform distribution is called a copula. See p. 164-173.

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Rick_SAS

01-30-2015 04:23 PM

Dr. Wicklin - I think this approach may work.....you might recognize most of it!

I generated univariate uniform random variates with specified means. Then I used the approach you described in your text, namely, the Iman-Conover method to generate multivariate data with the specified marginals I just mentioned and a desired correlation structure. (I assumed the Pearson correlation was close enough to the Spearman rank correlation.)

I think it may be good enough.....

In the mean time, what is the difference between using the Iman-Conover method and any of the copula approaches? It seems like they are accomplishing the same task....

Thanks again for your support as I learn a new subject.

Brian

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to bhfield

02-02-2015 10:54 AM

Yes. The Iman-Conover method uses ideas that are similar to copulas, which is why I placed it just before the section on copulas. I also begin the section on copulas with the sentences "Each of the previous sections describes.... That is exactly what a mathematical copula does."

You will discover that special cases of the copula have been (re)discovered many times in the literature.

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to bhfield

02-02-2015 11:38 AM

BTW, there is an errata for the program on p. 162. About 6 lines from the bottom of the program, the statement in the book are

y = X[,i];

call sort(y);

X[,i] = y[rank];

The correct statements are

tmp = X[,i];

call sort(tmp);

X[,i] = tmp[rank];

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Rick_SAS

02-03-2015 08:38 AM

Thanks Dr. Wicklin. I accessed the code from your author's page, so it appears that code was corrected there. Thanks for the heads up.