🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Fluorite | Level 6

## Generating multivariate data with various distributions in SAS/IML

Hi everyone,

I would like to know if there is a way to generate multiple variables where each has a certain distributional form given a covariance matrix. Specifically, I'm looking to generate three variables (X1, X2, X3) with X1~lognormal, X2~multimodal and a X3~normal distribution, and also allow for correlation among all three (given a covariance matrix).

I read about generating univariate data from each type of distribution independently and also ways to generate MVN or more complex distributions given a covariance matrix, but I can't seem to find a way to allow for different distributional forms given a covariance matrix.

highly appreciate any help.

1 ACCEPTED SOLUTION

Accepted Solutions
SAS Super FREQ

## Re: Generating multivariate data with various distributions in SAS/IML

The technique you are looking for is called a "copula." It is a multivariate distribution with a given correlation structure with specified marginal distributions for each variable.  You can use PROC COPULA in SAS if you have a SAS/ETS license. Chapter 9 of Simulating Data with SAS (Wicklin, 2013) includes SAS/IML programs that generate correlated variables for discrete variables (binary and ordinal) as well as the copula approach for continuous variables (pp. 164-170). I also describe a powerful technique called the Iman-Conover method (pp. 161-164).

You can download the programs from the book's web site.

2 REPLIES 2
SAS Super FREQ

## Re: Generating multivariate data with various distributions in SAS/IML

The technique you are looking for is called a "copula." It is a multivariate distribution with a given correlation structure with specified marginal distributions for each variable.  You can use PROC COPULA in SAS if you have a SAS/ETS license. Chapter 9 of Simulating Data with SAS (Wicklin, 2013) includes SAS/IML programs that generate correlated variables for discrete variables (binary and ordinal) as well as the copula approach for continuous variables (pp. 164-170). I also describe a powerful technique called the Iman-Conover method (pp. 161-164).

You can download the programs from the book's web site.

Fluorite | Level 6

## Re: Generating multivariate data with various distributions in SAS/IML

Many thanks for your help. Got the book and the programs and everything works well.
From The DO Loop
Want more? Visit our blog for more articles like these.
Discussion stats
• 2 replies
• 526 views
• 3 likes
• 2 in conversation