MATLAB Answers

How to create a random gamma distributed vector with a mean of 0.1 and entries between 0 and 1?

조회 수: 21(최근 30일)
Anna Igbeta
Anna Igbeta 11 Sep 2017
댓글: Sky Sartorius 11 Sep 2017
I would like to create a random gamma distributed vector with a specific mean (0.1) and only values between 0 and 1. How ? Just how?

  댓글 수: 1

Sky Sartorius
Sky Sartorius 11 Sep 2017
The gamma distribution is unbounded, which makes it a difficult candidate for what you're trying to do without adding steps such as clipping.
Check out the beta distribution to see if that will work for you. You can use betaincinv to help generate the vector.

댓글을 달려면 로그인하십시오.

채택된 답변

José-Luis
José-Luis 11 Sep 2017
편집: José-Luis 11 Sep 2017
The gamma distribution takes two parameters: the shape and the scale. The mean of the distribution will be shape/scale.
That means that for a given mean (pun not intended), there are infinitely many gamma distributions. You'd need to pick either the scale or the shape and then get the other one, given your mean.
Also, the gamma distribution is asymptotic, if you limit it to the 0-1 interval then what you have is a truncated distribution that might be a very bad approximation of the gamma distribution depending on your selected shape and scale parameters.

  댓글 수: 0

댓글을 달려면 로그인하십시오.

추가 답변(0개)

Community Treasure Hunt

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

Start Hunting!

Translated by