Code covered by the BSD License

### Highlights from Generation of Random Variates

3.66667
3.7 | 7 ratings Rate this file 68 Downloads (last 30 days) File Size: 3.36 MB File ID: #35008 Version: 1.0

# Generation of Random Variates

### James Huntley (view profile)

generates random variates from over 870 univariate distributions

File Information
Description

This code package provides a framework for generating random samples of univariate distribution functions. It has an Excel database that currently lists over 870 distributions, their parameters as well as references to source material. Using a GUI, users can select from any of these discrete or continuous distributions, specify parameter values and specify the number of samples desired. The program will graph the samples, the PDF/PMF, CDF and a histogram. These samples may also be saved to a user-named local file. The Excel database is readily extensible and a User Guide is included with the package.

Given that this is the author's first submission to Matlab Central as well as first attempt at a Matlab GUI and that there are just under 2000 files in this package, there are bound to be many bugs. The author welcomes any corrections, additions, comments or suggestions.

Acknowledgements
Required Products Statistics and Machine Learning Toolbox
MATLAB
MATLAB release MATLAB 7.8 (R2009a)
Tags for This File   Please login to tag files.
Comments and Ratings (11)
28 Aug 2014 Yashar

### Yashar (view profile)

Dear James,

Thank you very much for such a great work!

I made cdf and pdf for Poisson-Pascal distribution and then find your file. You have one more input argument called "nmax"; and whatever value you enter for "nmax" does not change the result. I think it is redundant. At least my code worked without that auxiliary argument:

y=3;
r=3;
p=0.5;
lambda=1.25;
w=(exp(-lambda)*p^y)/factorial(y);
syms j;
c=symsum(factorial(r*j+y-1)/(factorial(r*j-1)*factorial(j))*((lambda*((1-p)^r)).^j),1,Inf);
u=w*c

Maybe this comment will help you to improve the distribution treasure :)

BR,
Yashar

04 Aug 2014 mahmoud

### mahmoud (view profile)

hi
i am looking for k-distribution but i can't find it, can anyone help me?
thanks

Comment only
06 Jun 2014 Muhammad Raza

### Muhammad Raza (view profile)

How about Distribution of sum of non-identically but independly distrubuted uniform RV, is there anyone who have function for this distrubution.

Thanks

17 Mar 2014 Junhong YE

### Junhong YE (view profile)

The Gauss Hypergeom function pfq works pretty fast , compared with the one of MATLAB. But the performance may not be satisfactory, especially when integration is involved.

18 Mar 2012 Eric Diaz

### Eric Diaz (view profile)

With time, and some improvements, this could be a File Exchange treasure. Here is some good documentation on how to share data between workspaces, creating guis, program development.

http://www.mathworks.com/help/techdoc/matlab_prog/f10-60729.html

http://www.mathworks.com/help/techdoc/matlab_prog/f0-38068.html#f0-38470

http://www.mathworks.com/help/techdoc/creating_guis/f13-998449.html

http://www.mathworks.com/help/techdoc/creating_guis/f10-998580.html

http://www.mathworks.com/help/techdoc/matlab_prog/f10-60481.html

http://www.mathworks.com/help/techdoc/matlab_prog/f10-60352.html

Comment only
18 Mar 2012 Eric Diaz

### Eric Diaz (view profile)

I think Robert Howrd is being a bit harsh. This package definitely does not deserve 2 stars.

It is obviously the culmination of many years of work by the author and as such deserves much respect. So, I'm ok with having given one more rating of 5 stars to balance his 2 stars.

On the other hand, this could be an exceptionally excellent package, and it is unfortunately restricted from being so by some sub-par programming techniques, as mentioned above. So the overall rank should just be average right now.

Comment only
18 Mar 2012 Eric Diaz

### Eric Diaz (view profile)

I'd like to see less use of global variables in your programming of the GUI. It's very difficult to sort through what is causing the problems due to these. Also, I'm not sure, but I think it is generally frowned upon in application programming. It consumes more memory than needed at any given time.

Also, it appears that your reliance on xlsread is causing problems. xlsRead will call the excel server as part of it's internal program. However, not everyone has excel. In fact, I prefer to use the open source office suite called LibreOffice.

Comment only
17 Mar 2012 Eric Diaz

### Eric Diaz (view profile)

Could use some basic improvements.
1) Prepend package files to prevent naming conflicts
2) Update help documentation to reflect Matlab standards
3) GUI does seem to have some problems. A readme file would help guide the user.
Otherwise, an impressive collection.

15 Mar 2012 robert howrd

### robert howrd (view profile)

GUI is too large for screen, plots do not show up and are cut off. No way to adjust. Not possible to use as is. GUI design needs much improvement. No README file.

07 Mar 2012 Eric Diaz

### Eric Diaz (view profile)

Pretty awesome!

10 Feb 2012 Mike Sheppard