How to compute the variance of a truncated logistic distribution / this exponential integral?

325 Views Asked by At

A random variable $X$ follows a truncated logistic distribution with truncation in 0, location parameter $m$, scale parameter $s$, and has density

$$ f(x) = \frac{1+e^{m/s}}{e^{m/s}} \times \frac{e^{-\frac{x-m}{s}}}{s\left(1+e^{-\frac{x-m}{s}}\right)^2} $$ for $x \geq 0$, and 0 otherwise.

How can I compute the variance of this distribution?

If $m = 0, s = 1$, then following the answer here allows to compute the second moment.

However, for the general case, I have to compute

$$ \int_0^\infty\frac{x^2e^{-\frac{x-m}{s}}}{s\left(1+e^{-\frac{x-m}{s}}\right)^2}dx, $$

Substitution $z = \frac{x-m}{s}$ leads to a similar looking integral,

$$ \int_{-\frac{m}{s}}^\infty\frac{(zs+m)^2 e^{-z}}{\left(1+e^{-z}\right)^2} dz, $$

where, however, I don't know how to proceed due to the shift in integration limit.

How can I compute the mean value?

1

There are 1 best solutions below

0
On

Don't know if this helps, after the long time -- i had a similar question, and this is what I got from Mathematica. Would welcome any tips on simplifying it

d = TruncatedDistribution[{a, b}, LogisticDistribution[m, s]]

FullSimplify[Variance[d], a < b]

$-\frac{e^{-\frac{2 m}{s}} \left(e^{a/s}+e^{m/s}\right) \left(e^{b/s}+e^{m/s}\right) \left(2 s^2 e^{m/s} \left(e^{a/s}-e^{b/s}\right) \left(\text{Li}_2\left(-e^{\frac{a-m}{s}}\right)-\text{Li}_2\left(-e^{\frac{b-m}{s}}\right)\right)+2 a s e^{m/s} \left(e^{a/s}-e^{b/s}\right) \log \left(e^{\frac{a-m}{s}}+1\right)-2 b s e^{m/s} \left(e^{a/s}-e^{b/s}\right) \log \left(e^{\frac{b-m}{s}}+1\right)+s \left(-2 e^{m/s} \left(a e^{a/s}-b e^{b/s}\right)+s \left(e^{a/s}+e^{m/s}\right) \left(e^{b/s}+e^{m/s}\right) \left(\log \left(e^{a/s}+e^{m/s}\right)-\log \left(e^{b/s}+e^{m/s}\right)\right)-2 (a-b) e^{\frac{a+b}{s}}\right) \left(\log \left(e^{a/s}+e^{m/s}\right)-\log \left(e^{b/s}+e^{m/s}\right)\right)+(a-b)^2 e^{\frac{a+b}{s}}\right)}{\left(e^{a/s}-e^{b/s}\right)^2}$

Here, $Li_2$ is the polylog function