# Expected log value of noncentral exponential distribution

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$?

-
Have you tried integrating in Mathematica? –  user10525 Jun 18 '12 at 16:01
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
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. –  user10525 Jun 18 '12 at 16:35
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
@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. –  user10525 Jun 18 '12 at 18:45

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)$.


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)$.

-
+1 @Michael Chernick It seems like not everyone is lazy ;). –  user10525 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