Exponential random number generation

8 vues (au cours des 30 derniers jours)
King Fisher
King Fisher le 27 Jan 2012
hi,
How to generate the exponential random numbers from uniform random number generator?
thx

Réponse acceptée

the cyclist
the cyclist le 27 Jan 2012
lambda = 2;
x = -log(rand(1,1000000)/lambda)
  4 commentaires
James Tursa
James Tursa le 27 Jan 2012
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 le 27 Jan 2012
+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.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Random Number Generation dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by