5
$\begingroup$

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?

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

1 Answer 1

3
$\begingroup$

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"}}]

Table of means for

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

Same table as above but with //N applied

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

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.