How to sample data that would follow gamma distribution?

5 views (last 30 days)
I have data (randomly distributed). From these data I would like to take a sample that would follow gamma distribution.
Is there an easy way to do this?
  2 Comments
Patrik Ek
Patrik Ek on 24 Jan 2014
Edited: Patrik Ek on 24 Jan 2014
What do you mean? Should you not use the correct distribution? Gamma distribution is often used to calculate waiting time expected lifetime and in that case sample should be either lifetime of time for/between (or similar) an occurency. Is it something like this you are after? What I mean is what is the sample and what do you want to do with them?
kashi
kashi on 24 Jan 2014
No, the original distribution is of no interest to me (we can assume it's more or less uniform) - I need a subset of original data that would follow gamma distribution.
Theoretically, I could generate random numbers from gamma distribution, convert them into frequency, and then sample with the that frequency from the bins of my original data, but there must be an easier way...

Sign in to comment.

Answers (2)

John D'Errico
John D'Errico on 24 Jan 2014
Edited: John D'Errico on 24 Jan 2014
You need an explicit SUBSET? of your original data that follows a gamma distribution? Sorry, but this seems to be a pretty uncommon thing to do, and there is surely no simple way to do so. You need to be far more clear about your problem if you want a good answer.
If you already know the distribution, then just use a tool for that express purpose. Find it in the STATS toolbox. If you don't know the gamma distribution, just estimate the gamma parameters, then see above.
Of course, if you really need an explicit subset of the data you already have, then it does NOT follow a Gamma distribution, since that distribution is a continuous thing. ANY value can occur, at least any positive value. If you will insist on a sampling from the set you already have, this is a discrete set, so just use a sampling tool designed for that purpose. Again, see the Stats TB.
Again, you either need to think more carefully about what you are asking to do, or be more clear, since the crystal bar is so foggy today.

Image Analyst
Image Analyst on 24 Jan 2014
RANDRAW has nearly every probability distribution you could possibly ever want: http://www.mathworks.com/matlabcentral/fileexchange/7309-randraw

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!