# Calculating mean and variance of reparameterized distributions

If I have an exponential distribution:

$$x \sim \operatorname{Exponential}(1)$$ mean and variance can be expressed as: $$\lambda = 1$$ $$\text{variance} = \lambda^{-2}$$ $$\text{mean} = 1 / \lambda$$

How would the mean and variance change if the distribution was expressed with respect to a normal random variable with mean $= 1$?

$$x \sim \operatorname{HalfNormal}(1, 3)$$ $$y \sim \operatorname{Exponential}(x)$$

It doesn't seem like the mean of the exponential distribution would change but it does feel like variance should increase. How can you express this mathematically?

• How do you mean "if the distribution was expressed with respect to"? I don't see how the two scenarios you describe relate to the same distribution. Are you interested in comparing two different distributions? Or in transforming one distribution? If the latter, in what way? – joriki Jun 7 '18 at 20:57
• The mean of an exponentially distributed random variable is positive. A normally distributed random variable is not always positive, and with a mean of $1$ and variance $3,$ the probability of its being negative is rather large. – Michael Hardy Jun 7 '18 at 21:04
• @MichaelHardy, bad example on my part, I've updated it to use a HalfNormal distribution. – jvans Jun 7 '18 at 21:32
• @joriki I want to know how express the mean and variance of an exponential distribution when the λ parameter is itself a distribution – jvans Jun 7 '18 at 21:33
• @jvans : I presume that instead of saying "The $\lambda$ parameter is itself a distribution" you mean "The $\lambda$ parameter is itself a random variable." – Michael Hardy Jun 7 '18 at 21:44

The half-normal distribution is not parametrized by two parameters, but only one: $$f_X(x) = \frac{\sqrt{2}}{\sigma \sqrt{\pi}} e^{-x^2/(2\sigma^2)}, \quad x \ge 0.$$ Thus its mean and variance are uniquely determined by $\sigma$.
In any case, the general approach to computing moments for a hierarchical model is to use the formulas for total expectation and total variance; namely, $$\operatorname{E}[Y] = \operatorname{E}[\operatorname{E}[Y \mid X]], \\ \operatorname{Var}[Y] = \operatorname{E}[\operatorname{Var}[Y \mid X]] + \operatorname{Var}[\operatorname{E}[Y \mid X]].$$ In the case that $$Y \mid X \sim \operatorname{Exponential}(X),$$ with your choice of parametrization such that $$\operatorname{E}[Y \mid X] = 1/X, \quad \operatorname{Var}[Y \mid X] = 1/X^2,$$ we then get $$\operatorname{E}[Y] = \operatorname{E}[1/X], \\ \operatorname{Var}[Y] = \operatorname{E}[1/X^2] + \operatorname{Var}[1/X].$$ For a half-normal $X$, the expectation of $1/X$ is not finite, thus the unconditional moments of $Y$ fail to exist.