# If $x\sim\mathcal{N}(\mu, \sigma^2)$, what is $E\left(\frac{\exp(x)}{a+\exp(x)}\right)$ for $a>0$?

Let $x\sim\mathcal{N}(\mu, \sigma^2)$ be a normal random variable. I'm interested in a new random variable, defined as $$z = \frac{\exp(x)}{a+\exp(x)},\quad x\in\mathbb{R}, a>0.$$ More specifically, I would like to find the closed form (if any) of its expected value, $\mathbb{E}[z]$, but I don't know how to proceed.

As a first step I could use an intermediate random variable $y=\exp(x)$, which follows the log-normal distribution (since $x$ is normal) and its mean and variance are given w.r.t. to $x$'s mean and variance. But again, I'm not sure if that helps.

• so mainly you want $E(z)$, isn't? – MAN-MADE Sep 11 '17 at 15:53
• The question title asks to find the distribution of the ratio which is not difficult - but the body asks for a closed-form for the expectation (which may not have a convenient closed form, or certainly is not easy). – wolfies Sep 11 '17 at 16:38
• Why the minor edit? To artificially push your question to the front page? – Did Oct 5 '17 at 14:46
• @Did: Even worse: just take a look at the edit history to see that the OP has engaged in this type of behaviour several times already. Nullgepeto, stop this or I shall flag your post to a moderator! If you want to make your post more visible offer a bounty. – Alex M. Oct 5 '17 at 15:13
• @Did, Alex M, I'd like to apologize. I indeed did this to put the question "up to recent"; didn't realize that this is a bad behavior, honestly. I'll stop this. Thanks for letting me know. – nullgeppetto Oct 6 '17 at 15:18

If we apply a random variable transformation $$Z = g(X)$$

$$f_Z(z)=f_X(g^{-1}(z))|\frac{d}{dz}g^{-1}(z)|$$

where $$g(X)=\frac{\exp[X]}{a+ \exp[X]}$$, $$f_X(x) = \frac{1}{\sqrt{2 \, \pi} \, \sigma}\exp[-\frac{(x-\mu)^2}{2\sigma^2}]$$, and $$g^{-1}(z)=\log\left(\frac{1}{\frac{1}{a\,z}-\frac{1}{a}}\right)$$

$$f_Z(z)= \frac{e^{-\frac{\left(\mu -\log \left(-\frac{a z}{z-1}\right)\right)^2}{2 \sigma ^2}}}{\sqrt{2 \pi } \sigma \left| (z-1) z\right| }$$

Finally

$$E[Z]=\int z\,f_Z(z)dz = \frac{\int \frac{z e^{-\frac{\left(\mu -\log \left(-\frac{a z}{z-1}\right)\right)^2}{2 \sigma ^2}}}{\left| (z-1) z\right| } \, dz}{\sqrt{2 \pi } \sigma }$$

$F_Z(z)=P(Z\le z)=P(\frac{1}{1+ae^{-X}}\le z) = P(Ln(\frac{az}{1-z}) \le X) = F_X(Ln(\frac{az}{1-z}) )$

So $f_Z(z)=\frac{\partial}{\partial z}F_X(Ln(\frac{az}{1-z}) ) = \frac{1}{z(1-z)} f_X(Ln(\frac{az}{1-z}))$. Where $f_X$ is the usual normal density function. I don't think this will leave you much wiser so better to go after $E[Z]$ directly.