Exponential random number generation

9 ビュー (過去 30 日間)
King Fisher
King Fisher 2012 年 1 月 27 日
hi,
How to generate the exponential random numbers from uniform random number generator?
thx

採用された回答

the cyclist
the cyclist 2012 年 1 月 27 日
lambda = 2;
x = -log(rand(1,1000000)/lambda)
  4 件のコメント
James Tursa
James Tursa 2012 年 1 月 27 日
Theoretically, one can invert the Cumulative Distribution Function and then plug uniform random numbers into that. Inverting the CDF is not always easy to accomplish, however.
the cyclist
the cyclist 2012 年 1 月 27 日
+1 to what James just wrote. If you search "generate random variate", you will find plenty to read. The book (remember those?) "Numerical Recipes" has a digestible discussion of the topic.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeRandom Number Generation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by