Skip to content

finding mean and SD for a log-normal distribution

4 messages · Andras Farkas, Uwe Ligges, David Winsemius +1 more

#
On 16.05.2012 12:37, Andras Farkas wrote:
Just make use of a textbook:

meanlog <- log(6) - 0.5 * log(1 + 9/(6^2))
sdlog <- sqrt(log(1 + 9/(6^2)))

Uwe Ligges
#
On May 16, 2012, at 6:37 AM, Andras Farkas wrote:

            
I get a better match to those values with:
distrib <- rlnorm(500000,1.682,0.47071)

(Bad practice to use 'c' as an object name.)
You need to review your resources on statistical distributions. The  
Wikipedia article has the needed transformations for parameters  
between the log and untransformed scales under the section entitled  
Arithmetic moments.

So that was the basis for this test:

# mu for LN
 > log(6) - 0.5*log(1+9/6^2)
[1] 1.680188
# sigma for LN
 > sqrt( log( 1 +9/6^2))
[1] 0.4723807
 > c <- rlnorm(500000,1.680188,0.4723807)
 > d <- exp(c)
# Expected value
 > mean(c)
[1] 5.99303
# SD
 > sd(c)
[1] 2.996532

So my half-assed approximation was in better agreement with theory  
than your "other software". On the other hand you haven't really given  
us much background for this estimation process so its not possible to  
offer a solid value judgment. R has package that do distribution  
fitting, MASS has fitdistr and there is a fitdistrplus package ....  
and others I believe. There's a monograph out about R's facilities but  
at the moment I cannot put my hands on my copy. There is a  
Distributions TaskView:
http://cran.r-project.org/web/views/Distributions.html
#
On May 16, 2012, at 12:37 , Andras Farkas wrote:

            
Perhaps this was what you were looking for:
[1] 1.675003
[1] 0.4656469

Taking exp() of a log-normal rarely makes much sense. More commonly, you take log() to get a normal distribution.