10

Suppose $X$ is non-central exponentially distributed with location $k$ and rate $\lambda$. Then, what is $E(\log(X))$.

I know that for $k=0$, the answer is $-\log(\lambda) - \gamma$ where $\gamma$ is the Euler-Mascheroni constant. What about when $k > 0$?

Neil G
  • 13,633
  • 3
  • 41
  • 84
  • Have you tried integrating in Mathematica? –  Jun 18 '12 at 16:01
  • @Procrastinator: Thanks for the suggestion. I just tried online, but the computation times out. I unfortunately don't own Mathematica. – Neil G Jun 18 '12 at 16:12
  • 4
    I assume $k > 0$ (when the density is written as $\lambda \exp\{-\lambda(x-k)\}$,) otherwise $x < 0$ with probability > 0, with dreadful consequences for $\mathbb{E}\log x$. – jbowman Jun 18 '12 at 16:25
  • @jbowman is right. I tried to integrate it like this: http://www.wolframalpha.com/input/?i=integrate+log%28x%2Bm%29ke%5E%7B-kx%7D+dx+from+x%3D0+to+infinity – Neil G Jun 18 '12 at 16:31
  • 2
    I got ${\mathbb E}[\log(X)]=e^{k\lambda}\Gamma(0,k\lambda)+\log(k)$. Mathematica is faster if you use the command `Assumptions` for specifying the parameter space. –  Jun 18 '12 at 16:35
  • Given that these integrals have a closed form shouldn't we as mathematicians be able ot do the integration without the aid of Mathematica? – Michael R. Chernick Jun 18 '12 at 16:44
  • @MichaelChernick It always help and does not take too long to have a quick look on the outcome of Mathematica. Also, we know that this integral have a "closed form" thanks to Mathematica, otherwise how? This sounds a bit circular. The next step would be to check this integral by hand, depending on the goals of the OP. –  Jun 18 '12 at 16:48
  • 4
    Does the upper incomplete gamma function count as *closed form*? (To me, it does not.) This is just conveniently hiding an integral via notation. – cardinal Jun 18 '12 at 16:50
  • @Procrastinator: Wow! Would you mind adding an answer? I am also very interested in the command you used with Mathematica. – Neil G Jun 18 '12 at 16:58
  • @cardinal: You're right. But, for my purpose Procrastinator's answer is perfect because I want to implement this in software and there are software libraries that evaluate the incomplete gamma function. – Neil G Jun 18 '12 at 17:00
  • @MichaelChernick: I tried to do this integral by hand, but wasn't able to. I am also very interested in seeing such a solution. (I remember seeing whuber solve some amazing integrals on other questions…) – Neil G Jun 18 '12 at 17:03
  • @NeilG I guess my point is that maybe our increasing reliance on the computer is making us a little lazy by allowing a machine to do something we should be able to do ourselves. However, having said that when I was doing my PhD over 30 years ago I always got hung up with algebra mistakes that would take a long time to catch and correct and automated tools that do not err would have really come in handy back then. – Michael R. Chernick Jun 18 '12 at 17:28
  • 2
    @NeilG This is the Mathematica code `Integrate[Log[x + k]*\[Lambda]*Exp[-\[Lambda]*x], {x, 0, \[Infinity]}, Assumptions -> k > 0 && \[Lambda] > 0]`. You can just copy it and paste it on a .nb file. I am not sure if the Wolfram Alpha allows for including restrictions. –  Jun 18 '12 at 18:45

1 Answers1

11

The desired integral can be wrestled into submission by brute-force manipulations; here, we instead try to give an alternative derivation with a slightly more probabilistic flavor.

Let $X \sim \mathrm{Exp}(k,\lambda)$ be a noncentral exponential random variable with location parameter $k > 0$ and rate parameter $\lambda$. Then $X = Z + k$ where $Z \sim \mathrm{Exp}(\lambda)$.

Note that $\log(X/k) \geq 0$ and so, using a standard fact for computing the expectation of nonnegative random variables, $$ \newcommand{\e}{\mathbb E}\newcommand{\rd}{\mathrm d}\renewcommand{\Pr}{\mathbb P} \e \log(X/k) = \int_0^\infty \Pr(\log(X/k) > z)\,\rd z = \int_0^\infty \Pr(Z > k(e^z - 1)) \,\rd z \>. $$ But, $\Pr(Z > k(e^z -1)) = \exp(-\lambda k(e^z - 1))$ on $z \geq 0$ since $Z \sim \mathrm{Exp}(\lambda)$ and so $$ \e \log(X/k) = e^{\lambda k} \int_0^\infty \exp(-\lambda k e^z) \, \rd z = e^{\lambda k} \int_{\lambda k}^\infty t^{-1} e^{-t} \,\rd t \>, $$ where the last equality follows from the substitution $t = \lambda k e^z$, noting that $\rd z = \rd t / t$.

The integral on the right-hand size of the last display is just $\Gamma(0,\lambda k)$ by definition and so $$ \e \log X = e^{\lambda k} \Gamma(0,\lambda k) + \log k \>, $$ as confirmed by @Procrastinator's Mathematica computation in the comments to the question.

NB: The equivalent notation $\mathrm E_1(x)$ is also often used in place of $\Gamma(0,x)$.

cardinal
  • 24,973
  • 8
  • 94
  • 128
  • 4
    +1 @Michael Chernick It seems like not everyone is lazy ;). –  Jun 18 '12 at 18:39
  • This is really great. I just want to point out for anyone implementing this that many implementations of the incomplete gamma function restrict the first parameter to be strictly positive. The identity $\Gamma(0, z) = -\operatorname{Ei}(-z)$ solves that minor problem. – Neil G Jun 18 '12 at 18:51