2
$\begingroup$

Is there an analytical solution for the expected value of log sigmoid function to a normal distribution. This corresponds to the following integral:

$$ \int_{-\infty}^{+\infty} \log\left(\frac{1}{1+\exp(-x)}\right) \frac{1}{\sqrt{2\pi\sigma^2}} \exp\left(-\frac{(x-\mu)^2}{2\sigma^2}\right) dx $$

I checked with Wolfram|Alpha, but didn't get any answer.

$\endgroup$
1
$\begingroup$

One possible approach is below.

Your integral is $$ \begin{split} I &= \frac{-1}{\sqrt{2\pi\sigma^2}} \int_{-\infty}^{+\infty} \log\left(1+\exp(-x)\right) \exp\left(-\frac{(x-\mu)^2}{2\sigma^2}\right) dx \\ &= \frac{-1}{\sqrt{2\pi}} \int_{-\infty}^{+\infty} \log\left(1+e^{-\mu - \sigma u}\right) e^{-u^2/2} du \end{split} $$ and now expand $\ln(1+y)$ into Taylor series, and integrate term-by-term. Not sure If you can find a closed form expression for the final result, but you may have a good chance.

A possibly good approximation is to cut off the Taylor series after a couple of terms and integrate by parts what you can in the result.

$\endgroup$
1
  • $\begingroup$ Thanks. @gt6989b I think there is no analytical solution for this integral, so approximation is necessary. I tried Gaussian quadrature, the result is good. $\endgroup$
    – feng zhou
    Jul 9 '19 at 0:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.