# Moment Generating Function of a nonlinear transformation of an exponential random variable

Let $\tau$ be an exponential random variable, with parameter $\lambda$. Let $$V = \delta^\tau$$ where $0 < \delta <1$. Sorry if this notation seems strange, but it is what I am using, I will get confused if I switch it around! What I want is the moment generating function of $V$. The density function of $\tau$ is $f(\tau) = \lambda \exp(-\lambda \tau)$. The change of variable to $V$ is $$\delta^\tau = V \\ \tau \log \delta = \log V \\ \tau = \frac{\log V}{\log \delta}$$ And $\frac{\partial \tau }{\partial V } = \frac{1}{V \log \delta}$. So the density of $V$ is $$g(v) = f(\frac{\log v}{\log \delta}) \frac{\partial \tau }{\partial V }\\ = \lambda \exp(-\lambda \frac{\log v}{\log \delta})\frac{1}{v \log \delta}$$ The moment generating function of $V$ is therefore $$MGF_V(t) = \int_0^1 \exp(t v) \lambda \exp(-\lambda \frac{\log v}{\log \delta})\frac{1}{v \log \delta} dv$$ Integrating this is Mathematica gives me a seriously complicated function of Gamma functions:

$$-\frac{\lambda}{\log \delta} (-t)^{\frac{\lambda}{\log \delta}} (\Gamma(-\frac{\lambda}{\log \delta})-\Gamma(\frac{-\lambda}{\log \delta} ,-t))$$ where the second gamma is using Mathematica's implementation of the Incomplete Gamma function. I need to do further things with this function, including use it numerically in either Matlab or Mathematica, and have serious trouble working with it. Compare this to the pleasantly simply moment generating function of $\tau$ $$MGF_{\tau}(t) = \int_0^{\infty} \exp{(t \tau)} \lambda \exp(-\lambda \tau) d \tau = \frac{\lambda}{\lambda - t}$$

To have a sense of what I'm doing, think of $\tau$ as wait time, and $\delta$ as a discount factor. So if I have wait time 0 I get value 1, but if I have to wait two periods I get value $\delta^2$. Everything that is going on with $V$ is completely pinned down by $\tau$, so I feel like I should be able to work in terms of $\tau$, but I know I can't just perform my change of variable after calculating the MGF. Can I?

For further information, there are a variety of ways to express the $MGF_V(t)$, depending on how you feed it to Mathematica. One additional way is $$-\frac{\lambda}{\log \delta} ( - ExpIntegralE[1+\frac{\lambda}{\log \delta},-t]+(-t)^{\frac{\lambda}{\log \delta}} \Gamma[-A])$$ where ExpIntegralE is Mathematica's implementation of the Exponential Integral Function:

$$ExpIntegralE[n,t] = \int \exp(-z t) \frac{1}{t^n} dt$$

I've done a lot of messing about with various forms of this expression, but none are really helpful. I need, eventually, to take derivatives of this thing and or calculate it numerically. Eventually I have a calculus of variations problem that uses it! All these implementations (including Matlab's, which are annoyingly different that Mathematica's) seem to have real instability issues, at least the way I want to use them.

This is cross posted from Mathematics, didn't get much interest there.

• Are you sure that you are calculating the definite integral (0 to infty), and not just the indefinite integral? I don't get the incomplete Gamma function in there. – Aniko Sep 16 '14 at 18:51
• I didn't specify the limits of integration, but for $\tau$ it is 0 to inf, and after the change of variable for $v$ it is from 0 to 1 (with a sign change), since the density is 0 elsewhere. When I calculate the MGF at particular values, it does have the properties I expect, so I think it is correct. The problems come when I want to invert it, take derivatives, and do all this other stuff later in my problem, and it becomes a nightmare. – Dennis Sep 16 '14 at 18:56
• I don't know why Mathematica comes up with the forms it does. If I simplify the density, letting $A=\frac{\lambda}{\log \delta}$, and reducing things like $Exp[-A Log[v]]= v^{-A}$, it will give the expression in the later part of my note. – Dennis Sep 16 '14 at 18:58
• You are right, I missed the fact that the limits become 0 to 1 after the variable change. – Aniko Sep 16 '14 at 18:58
• (1) For the record, the correct formula for $\text{ExpIntegralE}(n,t)$ is $\int_1^\infty \exp(-t x) /x^n dx$. Differentiating it with respect to $t$ is easy, because it just produces another exponential integral. Differentiation with respect to $n$ is very messy. (2) It's not evident where the "instability issues" are: could you be more specific about that? (3) The Gamma function representation looks particularly nice and is straightforward to differentiate with respect to $t$. – whuber Sep 16 '14 at 20:40

Since $0 < \delta <1$, then $\log \delta <0$. So the density of $V$ is

$$g(v) = f\left(\frac{\log v}{\log \delta}\right)\cdot \left|\frac{\partial \tau }{\partial V }\right| = \lambda \exp\left\{-\lambda \frac{\log v}{\log \delta}\right\}\frac{1}{v |\log \delta|} \\= \frac {\lambda}{|\log \delta|}\frac 1v\exp\left\{ \frac{\lambda}{|\log \delta|}\log v\right\}$$

Set $\alpha \equiv \frac{\lambda}{|\log \delta|}$. Then, manipulating,

$$g(v) = \alpha v^{\alpha-1}, \;\;v\in [0,1]$$

which is the density of a $\text{Beta}(\alpha,1)$ distribution.

The moment generating function is

$$MGF_V(\alpha,1,t) = 1 +\sum_{k=1}^{\infty} \left( \prod_{r=0}^{k-1} \frac{\alpha+r}{\alpha+r+1} \right) \frac{t^k}{k!}$$

and which, among other things provides a nice recursive formula

$$E[V^s] = \frac {\alpha +s-1}{\alpha+s}E[V^{s-1}]$$

• +1 Very nice! You have also incidentally provided another answer to stats.stackexchange.com/questions/114481 for the case $\lambda/\log(\delta)=-2$. Note that the MGF is a confluent hypergeometric function, which makes its computation susceptible to a huge array of techniques. – whuber Sep 16 '14 at 20:54
• @whuber Thanks. Indeed, there lies the general case. – Alecos Papadopoulos Sep 16 '14 at 21:27
• Thanks very much! I think this answer(and whuber's comment) will help a lot. Other than typical equation solving approaches, any advice for solving an equation of the type: $\frac{MGF_V^{\prime}(t)}{MGF_V(t)} - s =0$ for $t$? This was the sort of exercise that gives me trouble, numerically. What I had been doing was using implementations of the $\Gamma$ function and then using either built in or home-cooked equation solving methods, having a lot of trouble as parameters and $s$ varied. – Dennis Sep 16 '14 at 21:51
• It appears that your interest in the MGF is not so much in its capacity as a generator of distribution moments (which happens when $t=0$), since you want to solve for $t$. This apparently makes your problem much more mathematical than statistical, don't you think? – Alecos Papadopoulos Sep 16 '14 at 21:58
• Then perhaps, if you update your question in math.SE using the results from my answer, and the "equation of the type..." you typed in your comment above, perhaps you will get some useful feedback there, adjusting perhaps also the tags of the question. – Alecos Papadopoulos Sep 16 '14 at 22:04