# Distribution of a logit transform of a normal variable

If I have a normal distribution with a given mean and variance and apply a logistic transform to it, what is the mean and variance of my transformed variable?

This seems like it has to be a well known problem, but I haven't been able to find a quick reference anywhere.

• Neither the distribution nor its moments are likely to have any simple closed form. It is definitely the case that the first two moments will not adequately describe the distribution in many circumstances (it can be rather skewed). Given these significant limitations, perhaps you could explain why you want to do this?
– whuber
Jun 18 '13 at 19:16
• There may be some value in this answer May 30 '17 at 8:35

Given $X$ ~ $N(\mu,\sigma^2)$, you seek the transformation:

$$Y = \frac{1}{1+\exp(-X)}$$

The pdf of $Y$ has domain of support on (0,1).

• If $\mu$ is zero, the pdf of $Y$ will be symmetrical on (0,1), so the mean, $E[Y] = \frac12$, for all $\sigma$.

• If $\mu$ is non-zero, the pdf is skewed, and the moment calculations do not appear easy, assuming a closed-form does exist.

Nevertheless, we can quite easily find the pdf of $Y$. You can do this using the method of transformations, or one of the alternative methods. Here, I am using the mathStatica add-on to Mathematica to do the grunt work. If $X$ has pdf f, then the pdf of $Y$, say $g(y)$ is: defined on (0,1).

Here is a plot of the pdf $g(y)$ when $\mu=0$, with various values for $\sigma$: And here is a plot of the pdf $g(y)$ when $\sigma=1$, with various values for $\mu$:

## OP wrote: This seems like it has to be a well known problem

It is a variation on the Johnson $S_B$ (bounded) system of distributions. See Johnson's 1949 paper for more details ...

• Johnson, N.L. (1949), Systems of frequency curves generated by methods of translation, Biometrika, 36, 149-176.

The moments of the $S_B$ system are extremely complicated. Johnson (1949) did obtain a solution for the mean (using his formulation, which is a bit different to the above), though it did not have a closed form.

(In response to the question in the title rather than the body, on which I have nothing to add to wolfies' answer)

Wolfies has already given the distribution of the logit-normal but I thought I'd show that it's relatively simple to derive.

Let $$X\sim N(\mu,\sigma^2)$$ and let $$Y= t(X) = 1/(1+e^{-X})$$.

$$\begin{eqnarray} P(Y\leq y) &=& P[t(X)\leq y]\\\ &=& P[X\leq t^{-1}(y)]\\ &=& P[X\leq \log(\frac{y}{1-y})]\\ &=& P[\frac{X-\mu}{\sigma}\leq \frac{\log(\frac{y}{1-y})-\mu}{\sigma}]\\ &=&\Phi(\frac{\log(\frac{y}{1-y})-\mu}{\sigma}), \, 0

and then simple differentiation to obtain the pdf

$$\begin{eqnarray} f_Y(y) &=& \frac{1}{\sigma}\frac{d\log(\frac{y}{1-y})}{dy} \phi(\frac{\log(\frac{y}{1-y})-\mu}{\sigma})\\ &=& \frac{1}{\sigma}\frac{1}{y(1-y)} \phi(\frac{\log(\frac{y}{1-y})-\mu}{\sigma}) ,\: 0

Or you could get the same thing using the formula $$f_Y(y)= f_X(t^{-1}(y)) \left|\frac{d t^{-1}(y)}{dy}\right|$$ more directly.