I've spent a lot of time on this issue and I can't figure it out yet.
So, a lognormal distribution is being defined as follow:
X=e^(μ + σ Z), where Z is a standard normal variable.
Now, I want to estimate
σ from the standard deviation of the resulting random variable
X. Notice how the sigma is the sigma of the Z in the log space instead of the veritable standard deviation of the resulting X (that means: the sqrt of the second moment of X).
I've tried to start from the equation of the second moment here and here and here to estimate the variance of X from its σ, however I couldn't get wolfram alpha to invert the equation (or maybe I don't understand how to use the answer) to get σ in function of the variance of X (or in function of the standard deviation of X. Wolfram always finds that σ is equal to zero or to some imaginary numbers, and there seems to have problems with these imaginary numbers and transcendental numbers.
Also, as stated on Wikipedia, the base
e is not important in the expression
X=e^(μ + σ Z):
This relationship is true regardless of the base of the logarithmic or exponential function. if log_a(X) is normally distributed, then so is log_b(X) for any two positive numbers a or b that are not equal to 1.
I am working with base two (2) instead of the natural exponential base (e) to reduce numerical errors in binary floating point numbers when manipulating the numbers in Python.
To sum up, I am looking for a way to find σ from the standard deviation of X. I would like to do that ideally in base two, and ideally in Python. I would like to find one simple formula that works.