7

I recently came across a question in my graduate course where we have to calculate the characteristic function for the Logistic distribution. The Logistic distribution we are working with is given by the following PDF: $$ f(x) = \frac{e^{-x}}{(1 + e^{-x})^2}. $$

The way that I went about doing this is the following: $$E\left[ e^{itX} \right] = E[\cos(tX)] + iE[\sin(tX)]. $$ The $E[\sin(tX)] = 0$.

The real problem for me comes when calculating $E[\cos(tX)]$. I tried to express $\cos$ in its exponential representation, but I didn't get too far with that. Upon plugging this integral into WolframAlpha, it says that the hypergeometric function is used for it. Any thoughts on how I can analytically compute this? I'd be happy to use the hypergeometric function, but I don't quite see the connection between that and $\text{csch}(x)$, which is part of the result that WolframAlpha gives (and this result matches the characteristic function listed for the Logistic distribution).

Edit: I would like to be able to do this problem without a computer and solely pencil and paper. This is what I mean by an analytic solution.

whuber
  • 8,750
  • 1
    You have computed the cf. What, then, are you looking for? – whuber Nov 04 '20 at 16:53
  • I would like an analytic solution which doesn't involve WolframAlpha. I should've made that clearer. –  Nov 04 '20 at 17:06
  • 1
    The whole point of the hypergeometric function is that it is an analytic solution. What would "doesn't involve WolframAlpha" mean? That you want to use some other procedure or software to derive the solution instead? – whuber Nov 04 '20 at 17:09
  • I would like to do it without a computer. Are you implying that a computer is necessary for this integral? –  Nov 04 '20 at 17:18
  • I don't even understand what you mean by any of that. What would it mean to compute an integral without some form of computing device, even if it's pencil and paper? Could you indicate what kind of answer you are hoping for and tell us how it needs to differ from the answers you already have? – whuber Nov 04 '20 at 17:21
  • With all due respect, I think you are being deliberately nitpicky with my language. I have a solution with a computer. I, as a theory-focused person, am not satisfied with using a computer to get my integral if there is a closed form solution using elementary functions (the result is not some series or approximation, it involves csch(x)). How can I calculate it if I had no access to a computer. I would like to do it with solely pencil and paper. –  Nov 04 '20 at 17:26
  • I was truly struggling to determine your objective, so thank you for leaving a clue. It appears, from your last comment, that you are not "happy to use the hypergeometric function" but are seeking a solution in terms of elementary functions. Why didn't you say so? Just edit your post to help others understand what you're looking for. – whuber Nov 04 '20 at 17:30

2 Answers2

2

This integral can be evaluated with elementary steps and knowledge of basic facts about Beta and Gamma functions (such as the most elementary portions of Whitaker & Watson, A Course of Modern Analysis (4th Ed.) Chapter 12).

In the following I emulate the approach taken to evaluate a related integral at https://math.stackexchange.com/a/2828293/1489 .

First, substitute $y = e^{-x}:$

$$\begin{aligned} E\left[e^{itX}\right] = \int_{-\infty}^\infty e^{itx}\,\frac{e^{-x}}{(1+e^{-x})^2}\,\mathrm{d}x = \int_0^\infty y^{-it}\,\frac{y}{(1+y)^2}\,\frac{\mathrm{d}y}{y} = \int_0^\infty \frac{y^{-it}}{(1+y)^2}\,\mathrm{d}y. \end{aligned}$$

This is a well-known expression for the Beta function. Simplify it using the basic relations $\Gamma(2)=1,$ $\Gamma(1+z)=z\Gamma(z),$ $\Gamma(z)\Gamma(1-z)=\pi\csc(\pi z),$ and $\csc(ix) = i\operatorname{csch(x)}:$

$$\begin{aligned} \int_0^\infty \frac{y^{-it}}{(1+y)^2}\,\mathrm{d}y &= B\left(-it+1, 1-it\right) & \\ & =\frac{\Gamma(1-it)\Gamma(1+it)}{\Gamma(2)} \\ &= \Gamma(1-it)\Gamma(1+it) \\ &= (-it)\Gamma(-it)\Gamma(1+it)\\ &= -it \pi \csc(\pi t i) \\ &= \pi t \operatorname{csch}(\pi t). \end{aligned}$$

This procedure readily generalizes to integral powers larger than $2$ in the denominator.

Mittens
  • 46,352
whuber
  • 8,750
1

Here is an alternative solution using the moment generator function and analytic continuation. The standard logistic distribution has the form $$\mu(dx)=\frac{e^x}{(1+e^x)^2}\,dx$$ $$\mathcal{M}(\mu)(s)=\int_{\mathbb{R}}e^{sx}\frac{e^x}{(1+e^x)^2}\,dx $$ The change of variables $u=\frac{1}{1+e^x}$ ($du=-\frac{e^x}{(1+e^x)^2}\,dx$) yields $$\begin{align} \mathcal{M}(\mu)(s)&=\int^1_0\Big(\frac{1-u}{u}\Big)^s du=\int^1_0u^{(1-s)-1}(1-u)^{(s+1)-1}\,du\\ &=B(1-s,s+1)=\frac{\Gamma(1-s)\Gamma(s+1)}{\Gamma(2)}=s\Gamma(1-s)\Gamma(s)\\ &=\frac{\pi s}{\sin(\pi s)} \end{align}$$ for $-1<s<1$. Notice $\mathcal{M}(\mu)$ can be defined analytically in the strip $(-1,1)\times\mathbb{R}$ and then, by analytic continuation it can be extended to all of $\mathbb{C}\setminus\mathbb{Z}$. In particular, for $s=it$, $t\in\mathbb{R}$, we obtain $$ \widehat{\mu}(t)=\int_{\mathbb{R}}e^{itx}\frac{e^x}{(1+e^x)^2}\,dx=\frac{\pi it}{\sin(\pi it)}=\frac{\pi t}{\operatorname{sinh}(\pi t)} $$

Since $\widehat{\mu}(t)$ is analytic on $(-1,1)\times\mathbb{R}$, $\int_{\mathbb{R}}|x|^n\mu(dx)<\infty$ for all $n\in\mathbb{Z}_+$. Using methods of complex analysis we can obtain a power series representation of $\widehat{\mu}$ around $0$ as follows. Recall that $b(z)=\frac{z}{e^z-1}$ with $b(0)=1$, has power series representation $$b(z)=\sum^\infty_{n=0}\frac{B_n}{n!}z^n, \qquad |z|<2\pi$$ where $B_n$ is the $n$-th Bernoulli number. The sequence $B_n$ satisfies $B_0=1$ and $$ \delta_{1n}=\sum^{n-1}_{k=0}\frac{B_k}{k!}\frac{1}{(n-k)!},\qquad n\in\mathbb{N}$$ A simple calculation shows that \begin{align} b(-z)+ b(z)&=z\frac{e^{z/2}+e^{-z/2}}{e^{z/2}-e^{z/2}}=z\operatorname{coth}\big(\tfrac{z}{2}\big)\\ b(-z)-b(z)&=z \end{align} These identities imply that $B_{2n+1}=0$ for $n\geq1$ and $$\operatorname{coth}\big(\tfrac{z}{2}\big)=\sum^\infty_{k=0}\frac{2B_{2k}}{(2k)!}z^{2k-1} $$ Since $\operatorname{coth}(z)-\operatorname{coth}(2z)=\frac{2}{e^{2z}-e^{-2z}}=\operatorname{csch}(2z)$, $$z\operatorname{csch}(z)=\sum^{\infty}_{k=0}\frac{2B_{2k}}{(2k)!}\Big(1-2^{2k-1}\Big)z^{2k} $$ Therefore $$\widehat{\mu}(t)=\pi t\operatorname{csch}(\pi t)=\sum^\infty_{k=0}\frac{2B_{2k}}{(2k)!}(1-2^{2k-1})\pi^{2k}t^{2k} $$

Mittens
  • 46,352