# Lognormal distributions with different mean, but same standard deviation

How to transform a lognormally distributed set of data, so that the new data have a new mean but the same standard deviation as the original data?

Simply shifting the original data by the difference between the means (as done for transforming a normal distribution under same constraints), leads to negative values for some values of the transformed lognormal data!

• The mean and variance of the lognormal distribution are both functions of the mean and variance of the underlying normal distribution. So you can't change the mean without changing the variance also and consequently the standard deviation. – Michael R. Chernick Nov 10 '17 at 3:49
• Is it possible to preserve variance of the lognormal, but allow the underlying normal distribution to have a different variance than the original underlying normal distribution? I mean since I know the target mean (new value) and the target variance (=old variance), I can calculate the mu and sigma "parameters" for the transformed data? Now my question is given the new mu and sigma parameters, how can I transform the old data? I see X = exp(mu+sigma*z) where z is the normal standard distribution...but how to relate to the old data? – floatingnode Nov 10 '17 at 4:11

Since data never have lognormal distributions, let's analyze lognormal random variables and then come back to the question of data.

Suppose, then, that $X$ is a random variable with a lognormal distribution. By definition this means $Y=\log(X)$ is almost surely defined and has a Normal$(\mu,\sigma^2)$ distribution for some parameters $\mu$ and $\sigma \gt 0$. In terms of these parameters,

$$E[X] = e^{\mu + \sigma^2/2}$$

and

$$\operatorname{Var}(X) = E[X]^2\left(e^{\sigma^2}-1\right) = e^{2\mu + \sigma^2}\left(e^{\sigma^2}-1\right).$$

(See https://stats.stackexchange.com/a/116657/919 for a derivation.)

We have a great many options to transform $X$ into a new variable $X^\prime$. Among these, the simplest and most natural will correspond to affine transformations of $Y$ to $Y^\prime = \log(X^\prime)$; that is, suppose

$$Y^\prime = a Y + b$$

for some numbers $a$ and $b$, which we proceed to find. In this case the distribution of $Y^\prime$ is still Normal with parameters $$\mu^\prime = a\mu + b$$ and $$(\sigma^\prime)^2 = a^2\sigma^2.$$

Therefore

$$E[X^\prime] = e^{\mu^\prime +(\sigma^\prime)^2/2} = e^{a\mu +b + a^2\sigma^2/2}.$$

Moreover, we want the new variance to be the same as the old, whence

$$e^{2\mu + \sigma^2}\left(e^{\sigma^2}-1\right) = \operatorname{Var}(X) = \operatorname{Var}{X^\prime} = e^{2(a\mu+b) + a^2\sigma^2}\left(e^{a^2\sigma^2}-1\right).$$

Typically there are no solutions (if $E[X^\prime]$ is too small) or two solutions. Writing $m=\log E[X^\prime]$ for the logarithm of the target mean, let

$$d = \log\left(1 - e^{\sigma^2 - 2m + 2\mu} + e^{2\sigma^2 - 2m + 2\mu}\right).$$

Then there is a solution provided $d \ge 0$ and the solution(s) are

$$a = \pm\frac{\sqrt{d}}{\sigma};\quad b = m - \mu a - \frac{d}{2}.$$

Finally, note that the transformation can be expressed directly in terms of $X$ as

$$X^\prime = e^{Y^\prime} = e^{aY + b} = e^{a\log(X)+b} = e^b X^a.$$

It rescales a power of $X$.

As an illustration, the blue area shows the density function of a Lognormal$(0,1)$ distribution while the red area shows that of a Lognormal distribution with the same standard deviation and mean of $e^m=4$.

Finally, you might consider applying a comparable transformation to the data: to the extent the data look like they come from a lognormal distribution, this scaled power transformation will produce a new dataset that also looks lognormally distributed with a parent distribution of the same standard deviation. Accordingly, the new data should have almost the same SD as the original data--but, depending on how you estimate the parameters of the parent distribution, the SDs might not exactly be the same.

• Thanks a lot for this detailed reply and step by step derivation. It is very helpful. Much appreciated. – floatingnode Nov 10 '17 at 21:23
• Exploring a bit more on the same question: I am looking to transform the data such that the transformed data has a new simple (arithmetic) mean, but the same "simple" standard deviation (I mean the mean and SD being calculated not in the lognormal way)? Does this question make sense? – floatingnode Nov 13 '17 at 16:55