Exponential random number generation
9 次查看(过去 30 天)
显示 更早的评论
hi,
How to generate the exponential random numbers from uniform random number generator?
thx
0 个评论
采纳的回答
the cyclist
2012-1-27
lambda = 2;
x = -log(rand(1,1000000)/lambda)
x will be exponentially distributed. See, for example, http://en.wikipedia.org/wiki/Exponential_distribution#Generating_exponential_variates
4 个评论
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
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 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!