log-normal distribution

6 views (last 30 days)
jeffhead97
jeffhead97 on 1 Feb 2021
Answered: John D'Errico on 1 Feb 2021
how "rand" has "randn" to make it Normally distributed.
does "lognrnd" have the same.
does "lognrnd" output Normally distributed or Uniformly distributed numbers
Is there a difference between differences between "lognrnd(mu,sigma,size)" and exp(randn(size)*sigma + mu)

Answers (1)

John D'Errico
John D'Errico on 1 Feb 2021
Rand does not "have" randn to make it anything. Randn is a completely different code. That they happen to be named similarly is not relevant, except to make it easy for users to remember they both produce pseudo-random deviates.
does "lognrnd" output Normally distributed or Uniformly distributed numbers
No. It outputs lognormally distributed numbers. Why would it do otherwise (thus uniform or normal?) I'd suggest it would be a good idea to read the help for these tools.
Is there a difference between differences between "lognrnd(mu,sigma,size)" and exp(randn(size)*sigma + mu)
No. They are essentially the same thing, both producing lognormally distributed sets of variates. In fact, if you look at the code for lognrnd, you will see virtually that same line of code implemented.

Products


Release

R2020b

Community Treasure Hunt

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

Start Hunting!