Exponential random number generation

조회 수: 12 (최근 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 CenterFile Exchange에서 Random Number Generation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by