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

- Subscribe to 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
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

10-23-2012 04:18 AM

Could someone kindly help with the following?

1. I would like to generate gamma distributed random variables using two parameters alpha(shape) and beta(scale). The call function randgen(gamVar,'GAMMA',alpha) sets beta=1 and hence uses one parameter. How can I generate with the two parameters in stead of assuming one of the parameters = 1?

2. How can I generate correlated/multivariate Gamma random variables? This can probably be done using the Wishart function call, right? How exactly?

Thanks for your help in advance,

George

Accepted Solutions

Solution

2 weeks ago

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

10-23-2012 08:20 AM

1) If X is a random variable with unit scale, beta*X is a random variable with scale parameter beta.

Therefore:

call randgen(gamVar,'GAMMA',alpha);

gamVar = beta*gamVar;

2) As it says in the doc for the Wishart distribution, there are several distributions that are known as "multivariate gamma."

The Wishart distribution is best known as the distribution for the covariance of a sample drawn from a MV normal.

If you require that the marginal distributions be univariate gamma (I do), then there are several options for multivariate gamma. For bivariate gamma, see p. 586-588 of Devroye's book, Non-Uniform Random Variate Generation

For higher dimensions, I'd probably use PROC COPULA

All Replies

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

10-23-2012 08:19 AM

I got the solution to question 1 from SAS Data Steps under the section "Random numbers". The solution is x = b*rangam(seed,a); /* gamma with shape a & scale b */. Does anyone have a clue on question 2 above?

Solution

2 weeks ago

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

10-23-2012 08:20 AM

1) If X is a random variable with unit scale, beta*X is a random variable with scale parameter beta.

Therefore:

call randgen(gamVar,'GAMMA',alpha);

gamVar = beta*gamVar;

2) As it says in the doc for the Wishart distribution, there are several distributions that are known as "multivariate gamma."

The Wishart distribution is best known as the distribution for the covariance of a sample drawn from a MV normal.

If you require that the marginal distributions be univariate gamma (I do), then there are several options for multivariate gamma. For bivariate gamma, see p. 586-588 of Devroye's book, Non-Uniform Random Variate Generation

For higher dimensions, I'd probably use PROC COPULA

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

11-04-2012 12:50 AM

Thanks Rick for your reply. I am interested in the general case, bivariate or higher dimensional (indeed) with marginals being univariate gamma. Could you please illustrate with an example of how to implement this using proc copula?