log-normal distribution
6 views (last 30 days)
Show older comments
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)
0 Comments
Answers (1)
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.
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!