turn on suggestions

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

Showing results for

- JMP User Community
- :
- Discussions
- :
- Discussions
- :
- Generating Generalized Gamma Distribution using JM...

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

Highlighted
##
##### Generating Generalized Gamma Distribution using JMP scripts

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

Oct 26, 2011 11:46 AM
(1647 views)

All,

Is there a function that would allow generating random numbers

from a generalized gamma distribution? Scripting guide has

function random gamma for generating random numbers from

Gamma distribution but I don't see anything for generalized gamma

distribution.

Thanks for your help.

-ASVP

3 REPLIES

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

Oct 26, 2011 5:46 PM
(1321 views)

I don't think you can get random numbers for a three-parameter generalized gamma distribution using the builtin generators. If it's possible I would also like to know how to do it.

However, JMP 9 can get random numbers from R. See JSL example below.

// Function that returns random numbers from

// generalized gamma distribution generated

// by R package VGAM

rgengamma = Function**(** **{**n = **100**, b = **1**, d = **1**, k = **1****}**,

R Init**()**;

R Submit**(** "

library(VGAM)

rggam <- rgengamma(100,1,2,3)

" **)**;

rggam = R Get**(** rggam **)**;

R Term**()**;

rggam

**)**;

// Example of how touse the function to populate a

// data table with n=100 random numbers

dt = New Table**(** "Generalized Gamma", New Column**(** "Random" **)** **)**;

Column**(** dt, "Random" **)** << setvalues**(** rgengamma**(** **100**, **1**, **2**, **3** **)** **)**;

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

Oct 27, 2011 10:40 AM
(1321 views)

Hi:

MS gave us a clue. From the R prompt:

>library(VGAM)

>rgengamma

and

>?rgengamma

reveals that the rgengamma returns a modified base R rgamma function

y = rgamma(n, k)

scale*y^(1/d)

In JMP, we can also use a modification of the basic "Random Gamma" function, e.g.

Current Data Table() << New Column( "JMP GenGamma",

Formula( 1*Random Gamma( 1 )^(1/2) ) );

Current Data Table() << Run Formulas;

(Of course, one will have to fiddle with the parameters to get a match)

Matching random number generators, anyone - perhaps by fixing seeds?

Best regards,

-Matt

Best

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

Oct 27, 2011 11:20 AM
(1321 views)

Thanks Matt and MS for showing a way to generate random numbers from

generalized gamma distribution.

Regards,

-ASVP