MATLAB Answers

Question about 'lognrnd' function

3 views (last 30 days)
Sooyeol Im
Sooyeol Im on 3 Aug 2012
Generally, we say 'log-normal distribution with standard deviation XdB'. When I generate lognormally distributed random number, R, with dtandard deviation 8dB using 'R=lognrnd(mu, sigma)', is sigma 8 or ln8 (linear scale of 8dB)?
Oleg Komarov
Oleg Komarov on 6 Aug 2012
@Daniel and the cyclist: thanks.

Sign in to comment.

Answers (3)

Oleg Komarov
Oleg Komarov on 3 Aug 2012
Edited: Oleg Komarov on 3 Aug 2012
Reading carefully the documentation of lognrnd():
R = lognrnd(mu,sigma) returns an array of random numbers generated from the lognormal distribution with parameters mu and sigma. mu and sigma are the mean and standard deviation, respectively, of the associated normal distribution...
So, sigma is the standard deviation of
  1 Comment
Fernanda Suarez Jaimes
Fernanda Suarez Jaimes on 12 Mar 2020
Do you know how to run a regression of a time series with lognrnd?

Sign in to comment.

Daniel Shub
Daniel Shub on 3 Aug 2012
Why not just test it:
R = lognrnd(0, 8, 1e6, 1);
ans = 1.8915e+13
ans = 7.9976

the cyclist
the cyclist on 6 Aug 2012
I'm hesitant to say that it is in the dB scale, because dB is generally the base 10 logarithm, which is not the case here. However, the input parameters are the mean and standard deviation of the (natural) log of variable.
So, for example, if
>> r = lognrnd(3,7,1000000,1);
>> mean(log(r))
will be about 3, and
>> std(log(r))
will be about 7.
You can see details by typing
>> doc lognrnd

Community Treasure Hunt

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

Start Hunting!