# How to calculate log-normal parameters using the mean and std of the given distribution

I have the mean (u) and the standard deviation (sd) of a continuous distribution (X). How do I solve for the mean (u_log) and standard deviation (sd_log) of the log of that continuous distribution (log(X))?

I am looking to draw random numbers from a log-normal distribution. The problem is, most statistical packages have a log-normal-random-number-generator function that takes the mean of log(X) and sd of log(X) as inputs.

I only have the mean of X and std of X.

How to I solve for mean(log(X)) and sd(log(X)) given those inputs.

• see below for answer: en.wikipedia.org/wiki/Log-normal_distribution In contrast, the mean, standard deviation, and variance of the non-logarithmized sample values are respectively denoted m, s.d., and v in this article. The two sets of parameters can be related as (see also #Arithmetic moments below): Apr 28, 2014 at 13:21
• This reads like routine bookwork. Is this for some subject? Jun 2, 2014 at 23:41

Let m and s be the mean and sd of $X$ on the original scale. The appropriate mean and sd on the log scale can be found after a little algebra to be
$E(\log(X)) = \log(m) - \frac{1}{2} \log [ (s/m)^2 +1]$
$sd(\log(X)) = \sqrt{\log [(s/m)^2 +1]}$