# Mean of TransformedDistribution returns wrong result

I want to compute the mean of this transformed distribution $$10^{(25+5x+y)/5}$$, where $$x$$ and $$y$$ are independent normal random variables.

Here is my code

oneStepDist =
TransformedDistribution[10^(
1/5 (25 + 5 x + y)), {x \[Distributed]
NormalDistribution[71273/100000, 11/6250],
y \[Distributed] NormalDistribution[-4811/250, 21/500]}];
twoStepDist =
TransformedDistribution[10^t, t \[Distributed] #] &@
TransformedDistribution[
1/5 (25 + 5 x + y), {x \[Distributed]
NormalDistribution[71273/100000, 11/6250],
y \[Distributed] NormalDistribution[-4811/250, 21/500]}];


I found Mean[oneStepDist] returns $$0$$ while N@Mean[twoStepDist] gives correct result $$73.1164$$. Is this a bug or I'm missing something?

• Look like a bug in Expectation. Expectation @@ dist returns 0, but NExpectation @@ dist gives 73.1164. Commented Mar 22, 2021 at 8:15
• Also PDF[oneStepDist, x] fails in 12.3 on Windows 10 Pro, returning the input. Commented Jun 27, 2021 at 8:39

## 1 Answer

Just an extended comment stating that the one-step can be made to work but it's a very fragile approach. The list z below is a list of equivalent formulations of the desired random variable:

z = {10^(1/5 (25 + 5 x + y)), Exp[5 Log[10] + Log[10] x + Log[10] y/5],
Exp[Log[10] (5 + x + y/5)], Exp[a (5 + x + y/5)]};
TableForm[results = {#, Mean[TransformedDistribution[#, {x \[Distributed]
NormalDistribution[71273/100000, 11/6250],
y \[Distributed] NormalDistribution[-(4811/250), 21/500]}]]/. a -> Log[10]} & /@ z,
TableHeadings -> {None, {"Random variable", "Mean"}}]


TableForm[results // N, TableHeadings -> {None, {"Random variable", "Mean"}}]


The moral is to avoid random variables of the form 10^z ??